Skip to content

fix(reset-action): Reset Workshop Data: use the dispatched ref, surface the confirm value - #60

Merged
alukach merged 1 commit into
mainfrom
fix/reset-workflow-dispatched-ref
Sep 14, 2026
Merged

alukach merged 1 commit into
mainfrom
fix/reset-workflow-dispatched-ref

Conversation

@alukach

@alukach alukach commented Sep 14, 2026

Copy link
Copy Markdown
Member

Follow-up to #59. The first real dispatch of Reset Workshop Data failed:

python3: can't open file '.../scripts/fixture_collections.py': [Errno 2] No such file or directory

Run: https://github.com/developmentseed/eoapi-workshop/actions/runs/34893948324

The bug

The workflow was dispatched from the feature branch, but the ref input defaults to main — so actions/checkout replaced the dispatched branch with main, which had neither scripts/fixture_collections.py nor the fixture files it reads.

The mismatch was the design, not the default. A workflow whose logic lives in the repository should not check out a ref other than the one it was dispatched from.

Failing on a missing file was the lucky outcome. The same input pointed at a branch that has the script but is missing a fixture file would have run to completion and deleted that fixture as a leftover — silently, and irreversibly. Concretely: dispatching against main today, before data/tenant-collections.ndjson lands, would delete private-alice-demo and private-bob-demo.

So the ref input is removed rather than given a better default. actions/checkout now uses the dispatched ref, which means the workflow, the script, and data/ always come from the one branch chosen in Use workflow from.

Making the confirmation value discoverable

Separately, finding the string to type into confirm meant knowing to go read the PROJECT variable — a memory test standing in front of an irreversible action.

The dry run now prints it, in both the log and the job summary:

Dry run: nothing deleted.
To delete the 29 collection(s) above, re-run this workflow with
  mode    = apply
  confirm = workshop

Since the intended flow is always dry-run → read the list → apply, the value shows up exactly where the decision is made. Three smaller supports: the input description points at the dry run, the mismatch error now says where the value comes from (the PROJECT variable, and the prefix of every {PROJECT}-*.eoapi.dev hostname), and DEPLOYMENT.md lists all three places to find it.

Verification

Extracted the Reset collections step verbatim from the YAML and ran it against the deployed database in dry-run mode — the actual shipped code path, which is what would have caught the original failure:

  • exits 0
  • reports 29 non-fixture collections against 2 fixtures
  • prints confirm = workshop

Also confirmed the YAML parses, the step is valid bash, the ref input is gone, and Checkout code no longer carries a with: block.

Note for whoever runs it next

Dispatch from a branch that has data/tenant-collections.ndjson — currently feat/stac-auth-proxy-lambda (#49), or main once that merges. From main today the keep-list is only 2 fixtures, and the two private-*-demo collections would be classified as leftovers.

🤖 Generated with Claude Code

https://claude.ai/code/session_01P1CCcrx5fDKuAGsNh8DUFG

Dispatching the workflow from this branch failed:

  python3: can't open file '.../scripts/fixture_collections.py'

The `ref` input defaults to main, so the checkout replaced the dispatched
branch with main, which has neither the script nor the fixture files. The
mismatch was the design: a workflow whose logic lives in the repository
should not check out a ref other than the one it was dispatched from.

Remove the input and let actions/checkout use the dispatched ref, so the
workflow, the script and data/ always come from the branch chosen in "Use
workflow from". That also removes the sharper version of the same hazard,
where pointing `ref` at a branch missing a fixture file would classify that
fixture as a leftover and delete it.

Make the confirmation value discoverable rather than something to look up.
The dry run now prints the exact string to type, in the log and the job
summary, which lands it in front of whoever is reading the dry run they are
about to act on. The mismatch error also says where the value comes from,
and the input description points at the dry run.

Verified by running the step verbatim against the deployed database in
dry-run: exits 0, reports 29 non-fixture collections against 2 fixtures,
and prints `confirm = workshop`.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1CCcrx5fDKuAGsNh8DUFG
@alukach alukach changed the title Fix Reset Workshop Data: use the dispatched ref, surface the confirm value fix(reset-action): Reset Workshop Data: use the dispatched ref, surface the confirm value Sep 14, 2026
@alukach
alukach merged commit e210b7f into main Sep 14, 2026
3 checks passed
@alukach
alukach deleted the fix/reset-workflow-dispatched-ref branch September 14, 2026 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant