Skip to content

Add agent skill to update OWNERS file across all Shipwright repositories - #313

Open
SaschaSchwarze0 wants to merge 1 commit into
shipwright-io:mainfrom
SaschaSchwarze0:sascha-skill-update-owners
Open

Add agent skill to update OWNERS file across all Shipwright repositories#313
SaschaSchwarze0 wants to merge 1 commit into
shipwright-io:mainfrom
SaschaSchwarze0:sascha-skill-update-owners

Conversation

@SaschaSchwarze0

@SaschaSchwarze0 SaschaSchwarze0 commented Aug 9, 2026

Copy link
Copy Markdown
Member

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

  • Includes tests if functionality changed/was added
  • Includes docs if changes are user-facing
  • Kind label has been set
  • Release notes block has been filled in, or marked NONE

See the contributor guide
for details on coding conventions, github and prow interactions, and the code review process.

Release Notes

NONE

@openshift-ci openshift-ci Bot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Aug 9, 2026
@pull-request-size pull-request-size Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Aug 9, 2026
@openshift-ci
openshift-ci Bot requested review from HeavyWombat and qu1queee August 9, 2026 13:46
@openshift-ci

openshift-ci Bot commented Aug 9, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign saschaschwarze0 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Signed-off-by: Sascha Schwarze <schwarzs@de.ibm.com>
@SaschaSchwarze0
SaschaSchwarze0 force-pushed the sascha-skill-update-owners branch from 1fa021c to 0c8ecf4 Compare August 9, 2026 14:10

@qu1queee qu1queee left a comment

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.

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

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.

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.

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.

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.

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.

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.

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.

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.

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.

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 approvers and/or reviewers, add them to the matching emeritus_* list, and include a date comment (for example # 2026-08-18).
  • In the community repo, keep MAINTAINERS.md in 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.

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.

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.

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.

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

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.

Please add a trailing newline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants