Add agent skill to update OWNERS file across all Shipwright repositories - #313
Add agent skill to update OWNERS file across all Shipwright repositories#313SaschaSchwarze0 wants to merge 1 commit into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
8d8f2a2 to
1fa021c
Compare
Signed-off-by: Sascha Schwarze <schwarzs@de.ibm.com>
1fa021c to
0c8ecf4
Compare
qu1queee
left a comment
There was a problem hiding this comment.
Thanks for adding this. A shared skill for OWNERS updates is useful, and .github/skills/ is the right location.
Requesting a few instruction changes before merge: the current wording can discard unrelated local work, and it does not fully match how we maintain OWNERS and MAINTAINERS.md. Inline comments have the specifics.
| @@ -0,0 +1,43 @@ | |||
| --- | |||
| name: update-owners | |||
| description: Update OWNERS file across all Shipwright repositories | |||
There was a problem hiding this comment.
GitHub uses this description to decide when to load the skill. Please include both what it does and when to use it, for example adding/removing/moving reviewers, approvers, or emeritus entries in Shipwright OWNERS files.
|
|
||
| ## Context gathering | ||
|
|
||
| The user must provide which user to add, remove or move in the OWNERS file. The user must also provide the repositories where the changes should be made. If no repositories are provided, then all Shipwright-related repositories will be updated. |
There was a problem hiding this comment.
Defaulting to every repository is a large blast radius. Please confirm the repo list with the user first, skip archived repos and repos with no root OWNERS file, and skip a repo if the requested change is already present.
|
|
||
| In general, if you create some temporary scripts that you then run to perform some of the work, then put them into the `.github/skills/update-owners/work/scripts` directory so that they are not accidentally committed. | ||
|
|
||
| Use the `gh` CLI to verify that users that should be added to an OWNERS file are actually member of the shipwright-io GitHub organization. If they are not, then inform the user that they need to be invited to the organization first. |
There was a problem hiding this comment.
Please give the exact command, for example gh api orgs/shipwright-io/memberships/USERNAME. This check should apply only to users being added, not to emeritus moves.
|
|
||
| Use the `gh` CLI to list all repositories in the shipwright-io organization. | ||
|
|
||
| Clone the relevant repositories using `git clone --single-branch --depth 1` with SSH protocol into the .github/skills/update-owners/work/repos directory. Some of the repositories may already be locally present. If so, reuse them. Make sure the default branch of the repository (usually main) is checked out and that the branch is up-to-date. If there are dirty files in any locally available repository, then discard those. |
There was a problem hiding this comment.
Please do not instruct the agent to discard dirty files, and please do not reuse arbitrary local checkouts.
An agent can take this as git reset --hard on any Shipwright clone it finds, including this community checkout.
Prefer: clone only into the gitignored work/repos directory (for example with gh repo clone so HTTPS or SSH both work), start from an updated default branch, and if a reused work/repos clone is dirty, skip it or ask instead of wiping it.
|
|
||
| In all repositories, there is a file called OWNERS in the repository root which is in YAML format and lists approvers, reviewers and emeritus_approvers and emeritus_reviewers. You can check the existing files to get an overview. | ||
|
|
||
| Make the user-requested changes to the OWNERS file. When making somebody approver, make sure that user is also a reviewer. |
There was a problem hiding this comment.
Please spell out the OWNERS edits more completely:
- Preserve existing YAML style and GitHub IDs; do not duplicate someone already on a list.
- When making someone an approver, also add them as a reviewer (this line is good).
- When moving someone to emeritus, remove them from
approversand/orreviewers, add them to the matchingemeritus_*list, and include a date comment (for example# 2026-08-18). - In the
communityrepo, keepMAINTAINERS.mdin sync for approver add/remove and emeritus. - Do not grant emeritus status for Code of Conduct removals (see CONTRIBUTOR-LADDER.md).
|
|
||
| In each repository where you made changes, do the following: | ||
|
|
||
| - Checkout a feature branch and commit your change using `git commit -s -m "<summary>"` where the summary should summarize the changes (for example "add user-abc to reviewers") you made. Use one message per change that you made. |
There was a problem hiding this comment.
Please make this explicit: one Signed-off-by commit per change (git commit -s), matching the OWNERS PRs this skill already opened. Also create a unique feature branch from the updated default branch so leftover branches in work/repos are not reused.
| - Push the branch to the remote. | ||
| - Open a pull request using the `gh` CLI with the following constraints: | ||
| - If only one change was made, use that as PR description. Otherwise use `Update OWNERS`. | ||
| - Use `.github/.github/pull_request_template` as template for the body. .github is one of the repositories of shipwright-io. You should have cloned it already earlier, if not do so now so that you can access the template. |
There was a problem hiding this comment.
The shared template is pull_request_template.md, not pull_request_template. After cloning shipwright-io/.github into work/repos, the path is work/repos/.github/.github/pull_request_template.md.
Please also tell the agent to drop empty Fixes #, check the Kind and Release notes boxes, and include a filled-in body example. The first OWNERS PRs still shipped the HTML coach comments.
| @@ -0,0 +1,2 @@ | |||
| repos | |||
| scripts No newline at end of file | |||
There was a problem hiding this comment.
Please add a trailing newline.
Changes
This pull request adds an agent skill which one can use to update the OWNERS files of all shipwright-io repositories. I used it to create pull requests such as shipwright-io/build#2282. Note that at the time I used it, I had not yet included the check on the organization members.
Related Issue
None
Fixes #
/kind cleanup
Submitter Checklist
See the contributor guide
for details on coding conventions, github and prow interactions, and the code review process.
Release Notes