Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Backport automation for separately versioned content #3889

Closed
wants to merge 1 commit into from

Conversation

bmorelli25
Copy link
Member

@bmorelli25 bmorelli25 commented May 14, 2024

This is a WIP. Feedback is very welcome.

Summary

This PR adds two new automations to the observability-docs repo:

  • add-backport-labels.yml
  • clean-backports.yml

Contributor flow

This PR proposes the following contributor flow:

  1. A contributor opens a PR that adds content to this repository. When opening the PR, the contributor will add one or more deployment-type labels: serverless, stateful, or cloud. Note that cloud is not currently relevant to this repo.
  2. After the PR is reviewed and merged, the add-backport-labels.yml automation will run. This automation uses the label-mapping.yml file to map the deployment-type labels to the relevant backport branches. For example, if the PR is labeled with stateful, the stateful label would be removed and replaced with the backport-8.13 and backport-8.12 labels.
  3. Mergify automatically opens PRs to the correct branches based on the newly added backport-* labels.
  4. On these backport PRs, a new automation, clean-backports.yml will run. This automation uses regex to match the base branch of the backport PR with any block-listed directories. In this PR, backport-mapping.yml block-lists the serverless dir for branches that match the following regex pattern: [7,8].*. This means if our original PR had both serverless and stateful content, and has a backport that is targeting 8.13, an automation will run that rm -rf serverless on the backport PR. This ensures serverless content is not backported to branches other than main even when it exists in a stateful PR.
  5. The backport PR passes checks and can be merged.

Problems solved

  • Contributors don't need to know relevant backport branches. All they need to know is if the content applies to serverless, stateful, cloud, or apm-agents.
  • Contributors don't have to open separate PRs for separately-versioned content. Any content can go into any PR and will make it to the appropriate backport branches.

Copy link
Contributor

mergify bot commented May 14, 2024

This pull request does not have a backport label. Could you fix it @bmorelli25? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-/d./d is the label to automatically backport to the /d./d branch. /d is the digit
    NOTE: backport-skip has been added to this pull request.

@mergify mergify bot added the backport-skip Skip notification from the automated backport with mergify label May 14, 2024
@bmorelli25
Copy link
Member Author

Replaced (for now) with #3916

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-skip Skip notification from the automated backport with mergify
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant