Repository navigation
Conversation
The security fixes that block a release are tracked in the private cilium/security repository under label:release-blocker/X.Y, and are the only pre-check item the tool does not verify itself. This commit adds a step that searches for open items carrying that label and asks for confirmation before continuing when it finds any. Most release managers cannot read cilium/security, so the step asks about the repository first and, on the 404 GitHub answers for a repository it hides, warns that the check did not run instead of failing the release; a search alone cannot tell an invisible repository from a misspelled one, as both answer 422. Like the release blockers in cilium/cilium the check is skipped for pre-releases and release candidates, and it runs before the quay.io check, which exits the process on a transport error. Signed-off-by: André Martins <andre@cilium.io>
Pre-releases are development snapshots of the next minor version, and neither the release candidate nor the minor template asks for the security release blockers to be checked before cutting one. This commit removes the item from the pre-release template, so that the checklist matches the release tool, which skips that check for pre-releases and release candidates. Signed-off-by: André Martins <andre@cilium.io>
270541f to
ecdc70e
Compare
joestringer
left a comment
There was a problem hiding this comment.
LGTM, with some super minor nits for readability around the classic "double negative" case. I got confused for a bit trying to reason about this until I unwound per the suggestions below.
It would be good to test this with an upcoming release when we have a blocker to make sure that the implementation properly picks up the blockers when they're present (no typos or incorrect API handling).
| // repoNotVisible reports whether err means the token cannot see the repository: | ||
| // GitHub answers 404 for a private repository it hides and 403 when an | ||
| // organization denies the token. | ||
| func repoNotVisible(err error) bool { |
There was a problem hiding this comment.
nit: repoVisible() and flip the logic?
There was a problem hiding this comment.
Same for searchRepoNotVisible() -> searchRepoVisible() below.
| if !repoNotVisible(err) { | ||
| return fmt.Errorf("unable to fetch repository %s/%s: %w", owner, repo, err) | ||
| } | ||
| c.warnNotChecked(fmt.Sprintf("No access to the private %s/%s repository", owner, repo), releaseBlockerLabel) | ||
| return nil |
There was a problem hiding this comment.
nit: Flipping this around along with the corresponding suggestion earlier makes this flow much more clearly IMO.
| if !repoNotVisible(err) { | |
| return fmt.Errorf("unable to fetch repository %s/%s: %w", owner, repo, err) | |
| } | |
| c.warnNotChecked(fmt.Sprintf("No access to the private %s/%s repository", owner, repo), releaseBlockerLabel) | |
| return nil | |
| if !repoVisible(err) { | |
| c.warnNotChecked(fmt.Sprintf("No access to the private %s/%s repository", owner, repo), releaseBlockerLabel) | |
| return nil | |
| } | |
| return fmt.Errorf("unable to fetch repository %s/%s: %w", owner, repo, err) |
The security fixes that block a release are tracked in the private
cilium/security repository under label:release-blocker/X.Y, and are the
only pre-check item the tool does not verify itself.
This adds a step that searches for open items carrying that label and
asks for confirmation before continuing when it finds any. Most release
managers cannot read cilium/security, so the step asks about the
repository first and, on the 404 GitHub answers for a repository it
hides, warns that the check did not run instead of failing the release;
a search alone cannot tell an invisible repository from a misspelled
one, as both answer 422.
Like the release blockers in cilium/cilium the check is skipped for
pre-releases and release candidates, and it runs before the quay.io
check, which exits the process on a transport error. The pre-release
template drops the item as well, so that the checklist matches the
release tool.