Repository navigation
Check owner IDs of added and changed collection index entries - #760
Merged
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the collection-index validation changes.
No open issues 🎉
What changed in this PR
Adds pull-request validation for collection index entries, complementing the crawler’s owner-ID checks so invalid submissions are caught before merging.
Changes:
- Compares the index with the base branch to check only added or changed entries.
- Validates required fields and verifies numeric
ownerIdvalues forghcr.iocollections against GitHub account IDs, retrying unauthenticated after a 403 response. - Adds a lint job and triggers it when the index, validation script, or workflow changes.
| File | Description |
|---|---|
.github/workflows/lint.yml |
Adds the entry-validation job and expands trigger paths. |
.github/scripts/check-collection-index.sh |
Checks changed entries for required fields and matching GitHub owner IDs. |
Review effort: Balanced
Christof Marti (chrmarti)
marked this pull request as ready for review
November 23, 2026 09:19
Abdurrahmaan Iqbal (abdurriq)
approved these changes
Nov 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a job to the
collection-index.ymllint workflow that checks the entries a pull request adds or changes. Each entry must havename,maintainer,contact,repositoryandociReference. Aghcr.iocollection must also have a numericownerIdthat matches the GitHub account named in itsociReference. A wrong or missingownerIdis caught during review instead of the collection being skipped silently at the next crawl.Session Context
Key decisions from the development session:
ownerIdto everyghcr.ioentry, and the crawler now skips collections whoseownerIdis missing or doesn't match the account that currently holds the owner name (protecting against reused names of renamed or deleted accounts). Nothing checked the field on submission.yqto JSON, then jq array difference), so it makes a handful of API calls per PR and doesn't fail unrelated PRs when an existing collection's owner changes. The daily crawl still checks every entry.ociReference(like the existingocireferenceandociReferencesentries) would otherwise bypass theownerIdcheck. The four existing broken entries aren't touched, so they don't fail this PR or others.ociReference, as in the crawler. A 403 with the Actions token is retried once without it, because organizations with an IP allow list (e.g.wandb) reject the token even for public profile data. Other lookup failures fail the job.^[A-Za-z0-9-]+$before it's used in the API URL..github/scripts/check-collection-index.sh, so it can be run and tested locally. The workflow and script paths were added to the trigger so changes to the check run it.yq,jqandcurl, which are preinstalled onubuntu-latest, so there's nothing to install.ownerIds from Remove entries of renamed or deleted accounts and add owner IDs #755 (compared with the commit before it) pass. Crafted entries with a reused name, missing, string-typed or wrongownerId, unknown account, misspelledociReference, mixed-caseGHCR.IO, and an invalid owner segment each produce an error annotation. A different registry needs noownerId. Works with and without a token; a failed lookup fails the job. shellcheck and actionlint pass.wandbentry and added an entry with a reused owner name. The job checked both, rejected the reused name, and acceptedwandb, so the unauthenticated retry for IP allow lists works with the Actions token.Changes
.github/scripts/check-collection-index.sh: new check script..github/workflows/lint.yml: newCheck added and changed entriesjob; trigger paths include the workflow and script.