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
ci: Add a call to the update label backport action #29902
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've experimented with this a bit in a test repository.
Here the final version of the relevant workflow.
I made some changes to avoid the usage of ${{ matrix.branch }}
in the if
condition. Reading the docs it seems that the condition is evaluated before the matrix expansion, so it is not possible to write it like that. Relevant excerpt from the docs:
Note: The jobs.<job_id>.if condition is evaluated before jobs.<job_id>.strategy.matrix is applied.
That workflow seems to work correctly, but unfortunately, it doesn't when its file is only on the main
branch. I think that's related to what is explained here:
GitHub searches the .github/workflows directory in your repository for workflow files that are present in the associated commit SHA or Git ref of the event.
I think that in our case (a PR with a stable branch as target) the workflow file is searched in the target branch, and since it is not found, it isn't triggered.
Oh, awesome thanks @pippolo84 . If I follow your response right, I've made a mistake here in this PR, thinking that GitHub workflows on main can trigger on PRs merged into stable branches, but that's not the case. When I look through the other workflows on main, I don't see any examples that try to do what I'm doing in the initial iteration of this PR. There's some ariane or other configuration but I think they're invoked from a workflow on another branch, so it doesn't quite fit the pattern I was attempting.
We don't need to call the label updater on PRs to the main branch though right? Because backports only go to stable branches?
Let's say we merge this version of the workflow. It won't match for PRs to stable branches, because this only lives on Is that your understanding as well, or do you think I missed something? |
Yep, that's correct. 👍
👍
That's my understanding too. 👍 Just a note: if you intend to go ahead with this version, beware of the call at line 33, it should be changed to be:
|
4dee9b3
to
87f6285
Compare
@pippolo84 I've synced to your version, updated the versions + target branch for the action, and updated the commit metadata to reflect your contribution to this PR. I think this should be ready for review now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
I saw an optional job fail here: Applying this incremental change to the patch to fix it:
|
Add an action to call the workflow that update the labels of backported PRs in stable branch. This commit is based on the following commits by Fabio from v1.14 branch: - 81ade5f ("ci: Call the workflow to update labels of backported PRs") - a5a047f ("ci: Use pull_request_target in update label workflow") The primary change here is to list all maintained branches in a single workflow on main in order to simplify the maintenance burden when creating new stable branches (eg, during v1.15 stable branch creation). This action will not trigger from the main branch for PRs targeted to stable branches. However, when we copy this workflow to stable branches, it will run for PRs targeted to that stable branch (assuming that the versions referenced in this file are kept in sync with the branch version). Signed-off-by: Fabio Falzoi <fabio.falzoi@isovalent.com> Co-authored-by: Joe Stringer <joe@cilium.io> Signed-off-by: Joe Stringer <joe@cilium.io>
87f6285
to
c399f34
Compare
/test |
Add an action to call the workflow that update the labels of backported
PRs in all stable branches.
This commit is based on the following commits by Fabio from v1.14 branch:
The primary change here is to list all maintained branches in a single
workflow on main in order to simplify the maintenance burden when
creating new stable branches (eg, during v1.15 stable branch creation).
This action will not trigger from the main branch for PRs targeted to
stable branches. However, when we copy this workflow to stable branches,
it will run for PRs targeted to that stable branch (assuming that the
versions referenced in this file are kept in sync with the branch
version).
Related: #27875
Tested here: https://github.com/pippolo84/gh-action-label-test/actions/runs/6773033350/job/18406926291