Skip to content

Latest commit

 

History

History
100 lines (72 loc) · 6.42 KB

README.md

File metadata and controls

100 lines (72 loc) · 6.42 KB

Xamarin Backport Bot

Note: this is used for internal use only.

Contains an action that's responsible for running an Azure DevOps build which backports a PR based on one branch to another branch.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

Onboarding

A federated credential needs to be added for each repo where the Backport bot runs. Peform the following steps to add the federated credential representing a repo to the VSEng-AzureDevOps-Xamarin-BackportBot-Identity managed identity

  • Navigate to the federated credentials section for VSEng-AzureDevOps-Xamarin-BackportBot-Identity
  • Click + Add Credential
  • Select Github Actions deploying Azure resources from the Federated credential scenario dropdown
  • Fill out the rest of the form as follows. Leave any field not specified below set to its default value.
    • Organization: Name of the GitHub organziation such as xamarin
    • Repository: Name of a repo within the organization such as xamarin-macios
    • Entity: Select Branch from the dropdown
    • Branch: main (or the name of the default branch for the repo)
    • Name: Enter a name using the naming format of [Oranization]--[repo-name]--main-branch such as xamarin--xamarin-macios--main-branch

Testing

To test backport-bot.yml pipeline changes, you will need to edit the .github/workflows/backport-action.yml file and temporarily update the trigger target branch from main to the name of your topic branch here:

refName = "refs/heads/main"

For example change the refName setting from refs/heads/main to your topic branch such as refs/heads/[TOPIC-BRANCH]. You should also add warning comment on the same line as a reminder to undo the change prior to merging your PR to main as follows:

refName = "refs/heads/[TOPIC-BRANCH]"  # UNDONE: DO NOT MERGE TO MAIN: Revert to using the main branch after testing

You can test changes from your topic branch (PR branch) by using the v1.0-test tag. Associate the tag with your latest changes by performing the following steps

git checkout [TOPIC_BRANCH_NAME]
git tag -f v1.0-test
git push --tags --force

To exercise your changes associated with the v1.0-test tag, use the following test PR #11

Apply the following comment to the PR

@gitbot backport backport-target

See the test PR for additional guidance & details

Deploying

Release management of the backport bot action is done though git tags. At present, the current release can be found at v1.1.

To deploy your changes, please:

  1. Update the tag locally with:
git tag -f $TAG_NAME
  1. Push the tag to the remote (https://github.com/xamarin/backport-bot-action):
git push --tags

Please note that for updating the v1.1 tag (or any other tag you want to push if it already exists), you will need to push --force to overwrite the existing tag.

In order to pick up the changes for Staging, make sure that the backport trigger YAML in your target repo (usually found at https://github.com/xamarin/$REPO_NAME/blob/main/.github/workflows/backport-trigger.yml) points to your desired tag.

For example, https://github.com/xamarin/.github/blob/main/.github/workflows/backport-trigger.yml#L13, the uses line should be updated as follows:

      - uses: xamarin/backport-bot-action@$TAG_NAME

where $TAG_NAME is filled in with the actual name of the tag.

You can list tags by executing the following command

git tag

To view the contents of a tag execute the following command:

git show $TAG_NAME

Resources

Resource type Resource Resource group
Backport Build Xamarin Backport Bot N/A
Telemetry PipelineTelemetry PipelineTelemetry
Managed identity VSEng-AzureDevOps-Xamarin-BackportBot-Identity AzureDevOps