Skip to content

feat: add backport.yml#13163

Merged
mladlow merged 5 commits intomainfrom
kevin/backport-assistant
Dec 15, 2021
Merged

feat: add backport.yml#13163
mladlow merged 5 commits intomainfrom
kevin/backport-assistant

Conversation

@thiskevinwang
Copy link
Copy Markdown
Contributor

@thiskevinwang thiskevinwang commented Nov 16, 2021

Description

This introduces a workflow that uses backport-assistant to backport changes (primarily docs changes) to designated release/branches and/or stable-website

The incoming behavior based on Waypoint

Usage

This replaces docs-cherrypick with a set of new labels.

Labels:

  • backport/website
    • will backport changes to stable-website (YES AUTOMERGE)
      • AND release/{LATEST} (NO AUTOMERGE)
    • {LATEST} is determined by the greatest semver out of all GitHub releases that match a regex (^v\d+\.\d+\.\d+$)
  • backport/{TARGET}
    • will backport changes to release/{TARGET} (NO AUTOMERGE)
    • ex. backport/1.8.x
      • will backport changes to release/1.8.x

image

Why is this being proposed?

The intent is to provide a more flexible backporting flow that...

  • is easy to use
  • is standardized across different teams (less for authors and engineers to re/learn when authoring docs-changes in different product repositories)
  • supports the future of versioned-docs

Dependencies

Requires a GitHub repo secret, ELEVATED_GITHUB_TOKEN to be created and added (should belong to a "hc-vault-bot" GitHub bot account)

Requires GitHub labels to be created - ex:

  • backport/website
  • backport/1.8.x
  • backport/1.7.x

@thiskevinwang thiskevinwang requested review from a team, brkalow and kalafut November 16, 2021 18:02
@thiskevinwang thiskevinwang marked this pull request as ready for review November 18, 2021 17:13
@thiskevinwang
Copy link
Copy Markdown
Contributor Author

Example gap to-be-filled

Here's is an example of a flow that backport-assistant will aid in

When v1.10.0 is released...

The source of truth of content for v1.9.x will flip from stable-website to release/1.9.x
The source of truth for v1.10.x will be stable-website

  • The changes in the above PR will no longer be reflected on the versioned-docs website for 1.9.x

@vercel vercel bot temporarily deployed to Preview – vault November 23, 2021 20:16 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook November 23, 2021 20:16 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook November 23, 2021 20:16 Inactive
@vercel vercel bot temporarily deployed to Preview – vault November 23, 2021 20:16 Inactive
@vercel vercel bot temporarily deployed to Preview – vault November 23, 2021 20:17 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook November 23, 2021 20:17 Inactive
Comment on lines +16 to +18
- name: Backport changes to stable-website
run: |
backport-assistant backport -automerge
Copy link
Copy Markdown
Contributor Author

@thiskevinwang thiskevinwang Nov 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now, only backport PRs to stable-website will be -automerge‘d

GITHUB_TOKEN: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
- name: Backport changes to latest release branch
run: |
resp=$(curl -f -s "https://api.github.com/repos/$GITHUB_REPOSITORY/releases?per_page=100")
Copy link
Copy Markdown
Contributor

@mladlow mladlow Dec 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing GITHUB_REPOSITORY resolves to hashicorp/vault and not just vault? Once I started thinking about that, I think we'll need to introduce backport-assistant to vault-enterprise as well, otherwise we'd wind up with a different workflow on OSS vs ENT.

Edit: though we won't need the website backport components for the ent action.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing GITHUB_REPOSITORY resolves to hashicorp/vault and not just vault?

Yep! - resolves to {owner}/{repo}

Once I started thinking about that, I think we'll need to introduce backport-assistant to vault-enterprise as well, otherwise we'd wind up with a different workflow on OSS vs ENT.

Should I open a similar PR in https://github.com/hashicorp/vault-enterprise? (minus the website components)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd appreciate it if you have time!

Copy link
Copy Markdown
Contributor Author

@thiskevinwang thiskevinwang Dec 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mladlow here's the Vault-ENT PR

I wasn't sure about the exact replacement for backport/website (given that it opens a backport PR against latest release/...) so I left a TBD comment.

@mladlow
Copy link
Copy Markdown
Contributor

mladlow commented Dec 1, 2021

This combination of jobs will backport anything labeled "backport/website" to both "stable-website" and the latest release branch, and will automerge the stable-website backports? I wanted to confirm my understanding based on my read of the yml.

Co-authored-by: Meggie <meggie@hashicorp.com>
@vercel vercel bot temporarily deployed to Preview – vault December 1, 2021 20:11 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook December 1, 2021 20:11 Inactive
@thiskevinwang
Copy link
Copy Markdown
Contributor Author

Re: #13163 (comment)

This combination of jobs will backport anything labeled "backport/website" to both "stable-website" and the latest release branch, and will automerge the stable-website backports? I wanted to confirm my understanding based on my read of the yml.

@mladlow yes, exactly that ^

The backport/website label will

  • backport & automerge into stable-website
  • open a backport PR against the latest release/... branch

Copy link
Copy Markdown
Contributor

@mladlow mladlow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving per discussions other places.

@mladlow mladlow merged commit 6ef50dc into main Dec 15, 2021
heppu pushed a commit to heppu/vault that referenced this pull request Jan 13, 2022
* feat: add `backport.yml`

* feat: check releases over labels for latest

* chore: Do not automerge for non `stable-website`

* chore: Do not automerge to not `stable-website`

* Update .github/workflows/backport.yml

Co-authored-by: Meggie <meggie@hashicorp.com>

Co-authored-by: Meggie <meggie@hashicorp.com>
@thiskevinwang thiskevinwang deleted the kevin/backport-assistant branch April 25, 2022 16:09
pull bot pushed a commit to benjivesterby/vault that referenced this pull request Mar 19, 2026
…shicorp#13163)

Co-authored-by: Kianna <30884335+kiannaquach@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants