[CI] GH workflow to assign reviewer for manual backport#253949
Conversation
|
@macroscope-app review |
|
Code review is in progress. Results will be posted as check runs complete. Previously completed: |
|
Pinging @elastic/kibana-operations (Team:Operations) |
ApprovabilityVerdict: Needs human review This PR introduces a new GitHub Actions workflow for automatic reviewer assignment on backport PRs. The workflow file is owned by @elastic/kibana-operations, and since the author is not a designated owner of this CI configuration, the operations team should review this new automation. No code changes detected at You can customize Macroscope's approvability policy. Learn more. |
💚 Build Succeeded
cc @Ikuni17 |
TamerlanG
left a comment
There was a problem hiding this comment.
What do you think about having this be a script we call from the operations repo or a github javascript action?
Maybe, I'm missing something, what would be the advantage of doing that or do you have something specific in mind? |
delanni
left a comment
There was a problem hiding this comment.
I think the potential benefit in having this in a separate repo is that the code is not in a yml file, and could be called outside of github actions, as an operational action - but I don't see this being ran by us very often.
I still would prefer if this was not inline a yml file, but somewhere in a scripts folder and sourced/used from there.
Move the reviewer selection and update logic into a script and skip the manual backport author when selecting fallback approvers. Co-authored-by: Cursor <cursoragent@cursor.com>
|
@delanni Converted to a script inside of inline Local run logs➜ kibana (ci/assign-backport-reviewer) ✔ act pull_request_target \
-W .github/workflows/assign-backport-reviewer.yml \
-e data/assign-backport-reviewer.pull_request_target.pr-260565.json \
--env GITHUB_REPOSITORY=elastic/kibana \
--env GITHUB_REPOSITORY_OWNER=elastic \
-s GITHUB_TOKEN="$(gh auth token)" \
-s KIBANAMACHINE_TOKEN="$(gh auth token)"
INFO[0000] Using docker host 'unix:///var/run/docker.sock', and daemon socket 'unix:///var/run/docker.sock'
[Assign manual backport reviewer/Find reviewer for manual backport] ⭐ Run Set up job
[Assign manual backport reviewer/Find reviewer for manual backport] 🚀 Start image=catthehacker/ubuntu:act-latest
[Assign manual backport reviewer/Find reviewer for manual backport] 🐳 docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=true
[Assign manual backport reviewer/Find reviewer for manual backport] 🐳 docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host"
[Assign manual backport reviewer/Find reviewer for manual backport] 🐳 docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host"
[Assign manual backport reviewer/Find reviewer for manual backport] 🐳 docker exec cmd=[node --no-warnings -e console.log(process.execPath)] user= workdir=
[Assign manual backport reviewer/Find reviewer for manual backport] ✅ Success - Set up job
[Assign manual backport reviewer/Find reviewer for manual backport] ☁ git clone 'https://github.com/actions/github-script' # ref=ed597411d8f924073f98dfc5c65a23a2325f34cd
[Assign manual backport reviewer/Find reviewer for manual backport] Non-terminating error while running 'git clone': some refs were not updated
[Assign manual backport reviewer/Find reviewer for manual backport] ⭐ Run Main Checkout repository
[Assign manual backport reviewer/Find reviewer for manual backport] 🐳 docker cp src=/home/brad/kibana/. dst=/home/brad/kibana
[Assign manual backport reviewer/Find reviewer for manual backport] ✅ Success - Main Checkout repository [5m30.132362977s]
[Assign manual backport reviewer/Find reviewer for manual backport] ⭐ Run Main Assign reviewers
[Assign manual backport reviewer/Find reviewer for manual backport] 🐳 docker cp src=/home/brad/.cache/act/actions-github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd/ dst=/var/run/act/actions/actions-github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd/
[Assign manual backport reviewer/Find reviewer for manual backport] 🐳 docker exec cmd=[/opt/acttoolcache/node/24.15.0/x64/bin/node /var/run/act/actions/actions-github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd/dist/index.js] user= workdir=
| Updating reviewers: teamReviewers=elastic/kibana-operations, reviewer=undefined
[Assign manual backport reviewer/Find reviewer for manual backport] ✅ Success - Main Assign reviewers [3.166924089s]
[Assign manual backport reviewer/Find reviewer for manual backport] ⚙ ::set-output:: result=
[Assign manual backport reviewer/Find reviewer for manual backport] ⭐ Run Complete job
[Assign manual backport reviewer/Find reviewer for manual backport] Cleaning up container for job Find reviewer for manual backport
[Assign manual backport reviewer/Find reviewer for manual backport] ✅ Success - Complete job
[Assign manual backport reviewer/Find reviewer for manual backport] 🏁 Job succeeded
I also don't really see a need to run this ourselves. We can always add |
Summary
AI assisted with Cursor +
gpt-5.4-highAdds a Github Workflow that automatically assigns a reviewer for manual backports and removes
kibanamachine. This avoids common confusion withkibanamachinebeing the codeowner and improves DX. This workflow is gated behind PRs wherekibanamachineis not the author, therefore it does not collide with backports that were created automatically and are auto-approved through.github/workflows/auto-approve-backports.yml.The reviewer is chosen with this algorithm:
onBehalfOfproperty).kibanamachinestays as the reviewer.Testing
I used a generated
jsonevent for an old backport: #260565. You can see the reviewers changed at the bottom when running locally withact.Local run