diff --git a/.github/workflows/backport.yaml b/.github/workflows/backport.yaml new file mode 100644 index 000000000000..4ce9f273bfa4 --- /dev/null +++ b/.github/workflows/backport.yaml @@ -0,0 +1,40 @@ +name: Backport merged pull request +on: + pull_request_target: + types: [closed] + issue_comment: + types: [created] +permissions: + contents: write # so it can comment + pull-requests: write # so it can create pull requests +jobs: + backport: + name: Backport pull request + runs-on: ubuntu-latest + + # Only run when pull request is merged + # or when a commment of `/backport` is created by someone other than the + # https://github.com/backport-action bot user (user id: 97796249). + if: > + ( + github.event_name == 'pull_request_target' && + github.event.pull_request.merged + ) || ( + github.event_name == 'issue_comment' && + github.event.issue.pull_request && + github.event.comment.user.id != 97796249 && + github.event.comment.author_association == 'MEMBER' && + github.event.comment.body == '/backport' + ) + steps: + - uses: actions/checkout@v4 + - name: Create backport pull requests + uses: korthout/backport-action@be567af183754f6a5d831ae90f648954763f17f5 # v3.1.0 + with: + label_pattern: ^backport/([^ ]+)$ + pull_title: ${pull_title} [Backport ${target_branch}] + pull_description: |- + Automated backport of #${pull_number} to `${target_branch}` + Associated issues if any: [${issue_refs}] + experimental: | + {"conflict_resolution": "draft_commit_conflicts"} diff --git a/.github/workflows/ci-build.yaml b/.github/workflows/ci-build.yaml index df33236c2ac8..7b6fb5314eb2 100644 --- a/.github/workflows/ci-build.yaml +++ b/.github/workflows/ci-build.yaml @@ -8,6 +8,9 @@ on: pull_request: branches: - "main" + - "release-*" + issue_comment: + types: [created] concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -19,6 +22,15 @@ permissions: jobs: changed-files: name: Get changed files + if: > + ( + github.event_name == 'issue_comment' && + github.event.issue.pull_request != null && + github.event.comment.author_association == 'MEMBER' && + github.event.comment.body == '/test' + ) || ( + github.event_name != 'issue_comment' + ) outputs: # reference: https://github.com/tj-actions/changed-files#outputs- tests: ${{ steps.changed-files.outputs.tests_any_modified == 'true' }} diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index b16e1a62bbd2..f61a6dc52507 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -7,6 +7,9 @@ on: pull_request: branches: - main + - release/* + issue_comment: + types: [created] concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -18,6 +21,15 @@ permissions: jobs: docs: runs-on: ubuntu-24.04 + if: > + ( + github.event_name == 'issue_comment' && + github.event.issue.pull_request != null && + github.event.comment.author_association == 'MEMBER' && + github.event.comment.body == '/test' + ) || ( + github.event_name != 'issue_comment' + ) steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0 diff --git a/.spelling b/.spelling index 661c7e52d415..1013d4c15ed0 100644 --- a/.spelling +++ b/.spelling @@ -139,7 +139,9 @@ args async auth backend +backport backported +backporting boolean booleans buildkit diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 4afbdacbaf96..0964d5695449 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -134,6 +134,15 @@ Subsequently, if there is still no response, it will be automatically closed as See the [Stale Action configuration](https://github.com/argoproj/argo-workflows/blob/main/.github/workflows/stale.yaml) for more details. +## Automated actions + +As a member (see [roles](https://github.com/argoproj/argoproj/blob/main/community/membership.md)) of the argo-project you can use the following comments on PRs to trigger actions: + +* `/retest` - re-run any failing test cases +* `/test` - trigger the full test suite. +Only use this for PRs where the test suite has not automatically triggered - this is almost always wasteful and will not make things pass that `/retest` doesn't pass. +* `/backport` - see [these instructions](releasing.md#backporting-fixes) for how to use automated backporting. + ## Sustainability Effort Argo Workflows is seeking more [Reviewers and Approvers](https://github.com/argoproj/argoproj/blob/main/community/membership.md) to help keep it viable. diff --git a/docs/releasing.md b/docs/releasing.md index 8293f62226f2..755acc9baebc 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -1,5 +1,21 @@ # Release Instructions +## Backporting fixes + +Fixes can be backported using the automated cherry-picker. +This will only work on merged commits, and always chooses the branches to backport based on labels. +Label of the form `backport/` will cherry-pick this commit to the given branch - e.g. `backport/release-3.6`. + +The backport will be triggered on merging, or on by adding a comment of `/backport`. +You cannot specify the backport target using comment text, only a label. + +Backported commits can be backported, so it may make sense to backport the `release-3.6` backport to `release-3.5` for example. + +Backported fixes may fail on merge conflicts and assistance will be given by the bot on how to manually create a backport. + +Commits generated this way do not get automated CI, so use a comment of `/test` to run the test suite on them. +They will need to be merged in the normal way, this part is not automated. + ## Cherry-Picking Fixes ✋ Before you start, make sure you have created a release branch (e.g. `release-3.3`) and it's passing CI.