You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Weekly harvest workflow that opens a pull request #9
.github/workflows/harvest.yaml: a weekly harvest whose output arrives as one pull request for the maintainer to merge.
Rewritten 2026-09-04 per dev/decisions-2026-09.md. Start from .github/workflows-pending/harvest.yaml on the closed PR #15 branch, minus the direct push, the registry sync and the failure issue.
Workflow
Triggers: schedule cron 0 3 * * 1 and workflow_dispatch
Steps: checkout main; r-lib/actions setup-r and setup-r-dependencies with needs: harvest; Rscript data-raw/harvest.R with the GitHub backend and LANG=C.UTF-8; roxygen2::roxygenise(); testthat::test_local(stop_on_failure = TRUE) as the gate; if anything under R/sysdata.rda, inst/extdata/, data-raw/packages.json, data-raw/harvest_report.md, man/ or DESCRIPTION changed, open or update a pull request on a fixed branch harvest (for example with peter-evans/create-pull-request), body from harvest_report.md
The built-in GITHUB_TOKEN is enough. A pull request opened with it triggers no pull_request workflows, so the gate runs inside this job and R-CMD-check plus pkgdown run on main after the merge. Do not make R-CMD-check a required status on main, or the harvest PR can never merge.
Failure surfacing: a failed run is red in the Actions tab and opens no PR. No issue automation.
Acceptance criteria
A workflow_dispatch run opens a pull request with a bumped version and date, or reports no changes
Merging that pull request rebuilds the site through the pkgdown workflow
A forced gate failure (temporarily break a schema test) leaves the run red and opens no PR
Premortem findings for this issue (advisory, non-blocking)
From the 2026-07-18 premortem (report in docs/ on branch claude/implementation-premortem-jd5udn):
The gate is schema tests, and schema tests assert names, types, and non-emptiness, never values. NA is a valid entry, so a run that half-parses several packages into blank DOIs and wrong tiers passes the gate, commits to main, and publishes to the site. The failure-surfacing path (auto-opened harvest-failure issues) only works if a human sees the issue; in a repo with one part-time maintainer that is not guaranteed, and the org PAT for the registry sync expires silently.
Suggestions:
Add content-level checks to the gate: fail or at least alert on week-over-week increases in problems-tibble rows, NA rates in doi, tier, or description columns, and unexplained tier changes.
Route harvest failures to a channel a human actually reads (an email step, or GitHub notification settings verified for the harvest-failure label), and treat a harvest-failure issue that is open more than 14 days with only bot comments as its own alarm.
Put the PAT expiry date on a calendar, or replace the PAT with a GitHub App installation token.
After the sync step, assert the registry repo's packages.json equals the harvester's copy; a non-empty diff for more than a week means the sync is broken.
First workflow_dispatch run after the merge: run 34355264180.
Everything the issue specifies worked, except one organisation setting.
What passed
The harvest ran on the runner against the GitHub backend
roxygen2::roxygenise() regenerated the documentation
testthat::test_local(stop_on_failure = TRUE) passed as the gate, inside the job, which is where it has to run because a pull request opened with the built-in token triggers no pull_request workflows
The harvest branch was pushed, one commit ahead of main, touching only DESCRIPTION, R/sysdata.rda and data-raw/harvest_report.md
##[error]GitHub Actions is not permitted to create or approve pull requests.
The organisation does not allow Actions to open pull requests. The workflow declares pull-requests: write and the repository default is write, but the organisation switch overrides both.
Fix, which needs an organisation owner: Settings, Actions, General, Workflow permissions, tick Allow GitHub Actions to create and approve pull requests. Then re-run the workflow; the branch it needs is already pushed.
A note on the diff
The run harvested the same data that was committed three hours earlier, so the expectation was "no changes". The branch is one commit ahead anyway, because the version bump and the harvest report changed. inst/extdata/ is absent from the diff, meaning the three CSVs are byte identical and the catalogue itself did not move. The change detection is behaving as designed: it bumps on a real difference in the generated files, not on a re-run alone.
Activity
larnsce commentedon Jul 18, 2026
Premortem findings for this issue (advisory, non-blocking)
From the 2026-07-18 premortem (report in
docs/on branchclaude/implementation-premortem-jd5udn):The gate is schema tests, and schema tests assert names, types, and non-emptiness, never values. NA is a valid entry, so a run that half-parses several packages into blank DOIs and wrong tiers passes the gate, commits to main, and publishes to the site. The failure-surfacing path (auto-opened harvest-failure issues) only works if a human sees the issue; in a repo with one part-time maintainer that is not guaranteed, and the org PAT for the registry sync expires silently.
Suggestions:
Generated by Claude Code
[-]Automate the weekly harvest[/-][+]Weekly harvest workflow that opens a pull request[/+]Merge pull request #19 from openwashdata/harvest-core
larnsce commentedon Sep 9, 2026
First
workflow_dispatchrun after the merge: run 34355264180.Everything the issue specifies worked, except one organisation setting.
What passed
roxygen2::roxygenise()regenerated the documentationtestthat::test_local(stop_on_failure = TRUE)passed as the gate, inside the job, which is where it has to run because a pull request opened with the built-in token triggers nopull_requestworkflowsharvestbranch was pushed, one commit ahead of main, touching onlyDESCRIPTION,R/sysdata.rdaanddata-raw/harvest_report.mdmainwas not touched. It is still the merge commit of Parsers, harvest, catalog and the weekly workflow (#3, #4, #5, #6, #9) #19. That is the change this issue asked for over the original workflow, which pushed generated data straight to mainWhat failed
The organisation does not allow Actions to open pull requests. The workflow declares
pull-requests: writeand the repository default iswrite, but the organisation switch overrides both.Fix, which needs an organisation owner: Settings, Actions, General, Workflow permissions, tick Allow GitHub Actions to create and approve pull requests. Then re-run the workflow; the branch it needs is already pushed.
A note on the diff
The run harvested the same data that was committed three hours earlier, so the expectation was "no changes". The branch is one commit ahead anyway, because the version bump and the harvest report changed.
inst/extdata/is absent from the diff, meaning the three CSVs are byte identical and the catalogue itself did not move. The change detection is behaving as designed: it bumps on a real difference in the generated files, not on a re-run alone.