Add opt-in upload-failure issue reporting to the action, and global watch for stale nightly - #172
Closed
Carreau wants to merge 3 commits into
Closed
Add opt-in upload-failure issue reporting to the action, and global watch for stale nightly#172Carreau wants to merge 3 commits into
Carreau wants to merge 3 commits into
Conversation
Carreau
force-pushed
the
nightly-failure-reporting
branch
3 times, most recently
from
July 25, 2026 07:03
8b4bbc7 to
2aa8917
Compare
With report_failures: true, a failed upload opens a tracking issue on the calling repository (label nightly-upload-failure) and the next successful upload closes it automatically. Idempotent: existing open issues are found by label rather than duplicated. Reporting is best-effort: the step is continue-on-error and the script treats a read-only token (HTTP 401/403, e.g. on pull requests and forks) as a clean skip, so it never fails a consumer's build. A genuine upload failure is still surfaced by a dedicated step. Logic lives in scripts/report_failure.py, run via the action's pixi Python. It uses requests, already in the pixi lock (a dependency of anaconda-client), so no dependency is added for consumers. Uses the built-in github.token by default; consumers only need to grant permissions: issues: write. New inputs: report_failures, github_token, issue_repository. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
A daily job queries the anaconda.org API for the scientific-python- nightly-wheels channel and files issues on this repo: - > 30 days without an upload opens a stale-nightly issue per package - > 60 days additionally opens a nightly-purge-candidate issue (both auto-closed when a fresh upload lands) It also, optionally, notifies each wheel's own source repository: - if a PAT is provided (secrets.NIGHTLY_UPLOAD_ISSUE_PAT) and the wheel is listed in packages-source-repos.yaml, a nightly-upload-stalled issue is opened on the producing repo at 15 days, escalated by comment at 30/60 days, and auto-closed on recovery - if that PAT is missing/expired/unauthorized, a nightly-pat-invalid issue is opened on this repo instead (auto-closed once the token works) Complements remove-wheels.yml (prunes old versions); this only opens/closes issues. Honors packages-ignore-from-cleanup.txt, guards on the scientific- python owner, and uses least-privilege for the built-in token. Logic lives in .github/scripts/monitor_nightly.py (PyGithub + requests + PyYAML, pinned in .github/scripts/requirements.txt). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Run ruff check and ruff format --check on scripts/ and .github/scripts/ on push/PR via uvx (uv), with the ruff version pinned inline and the rule selection pinned in ruff.toml so a new ruff release cannot change the lint outcome unexpectedly. The lint job needs no secrets, so it is safe on forks and pull requests. Ignore Python caches. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Carreau
force-pushed
the
nightly-failure-reporting
branch
from
July 25, 2026 07:14
2aa8917 to
29a6c80
Compare
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.
AI GENERATED, NOT REVIEWED IN DEPTH, MOSTLY FOR DISCUSSION in #171
(This is based on an old commit as I was not on my computer, but I'll ask Claude to redo on main, but the principle is the same)
--
Adds two capabilities to the nightly upload workflow, plus lint CI:
Both are implemented as small Python scripts run from GitHub Actions. No runtime dependency is added for consumers of the action.
1. Failure reporting (
report_failures)Extra composite steps wrap the existing pixi upload step:
nightly-upload-failureissue on the calling repo, then fails the job.github.tokenby default (no new secret). Logic inscripts/report_failure.py, run via the action's pixi Python. It usesrequests, which is already in the pixi lock (a dependency ofanaconda-client), so consumers gain no new dependency.report_failures,github_token(defaults to${{ github.token }}),issue_repository.2. Channel-freshness monitor (
.github/workflows/monitor-nightly.yml)A daily job queries the anaconda.org API for the
scientific-python-nightly-wheelschannel and files issues on this repo:stale-nightlyissue per package.nightly-purge-candidateissue.It complements
remove-wheels.yml(which prunes old versions); this only opens/closes issues and never deletes anything. It honorspackages-ignore-from-cleanup.txt(so exempt packages such asopenblas-libsare not flagged), guards ongithub.repository_owner == 'scientific-python', and uses a least-privilege built-in token.Notifying the producing projects directly (opt-in)
If a Personal Access Token is provided as
secrets.NIGHTLY_UPLOAD_ISSUE_PAT(the defaultGITHUB_TOKENcannot write issues on other repos) and the wheel appears in the hand-maintainedpackages-source-repos.yamlmapping:nightly-upload-stalledissue on the wheel's own source repo, escalated with a comment at the 30- and 60-day marks, auto-closed on recovery.nightly-pat-invalidissue is opened on this repo instead (using the built-in token) so maintainers rotate the secret; auto-closed once the token works again.Fully opt-in: with no PAT or an empty mapping, this behaviour is skipped entirely.
packages-source-repos.yamluses apackages:map where each entry is eitherwheel: owner/repoorwheel: {repo: owner/repo}, leaving room for per-repo config (labels, assignees, per-repo thresholds) later without a format change. It ships with an inert placeholder entry.Logic lives in
.github/scripts/monitor_nightly.py(PyGithub + requests + PyYAML, pinned in.github/scripts/requirements.txt).3. Lint CI
.github/workflows/lint.ymlrunsruff checkandruff format --checkonscripts/and.github/scripts/on push/PR.Configuration required (maintainers)
NIGHTLY_UPLOAD_ISSUE_PATsecret (a PAT withissues: writeon the target repos) and populatepackages-source-repos.yaml.report_failures: trueand grantpermissions: issues: write.Notes
run:/script:bodies. Package names reach only API calls;issue_repository/upload.outcomeare passed viaenv:and read fromos.environ/process.env. Actions are SHA-pinned (checkoutv7.0.0,setup-pythonv6.3.0).GithubExceptionfrom the PAT check is treated as "PAT broken"; transient/network errors are logged without filing a false alarm.Testing
Local validation only (no live GitHub run yet):
ruff checkandruff format --checkpass;py_compileclean; all YAML parses.Note: the "Testing" section is local-only — the workflows haven't run end-to-end on GitHub yet (real issue creation, scheduled trigger, PAT auth). Trim that section if you don't want to imply live verification.