fix(reset-action): Reset Workshop Data: use the dispatched ref, surface the confirm value - #60
Merged
Merged
Conversation
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
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.
Follow-up to #59. The first real dispatch of
Reset Workshop Datafailed:Run: https://github.com/developmentseed/eoapi-workshop/actions/runs/34893948324
The bug
The workflow was dispatched from the feature branch, but the
refinput defaults tomain— soactions/checkoutreplaced the dispatched branch withmain, which had neitherscripts/fixture_collections.pynor 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
maintoday, beforedata/tenant-collections.ndjsonlands, would deleteprivate-alice-demoandprivate-bob-demo.So the
refinput is removed rather than given a better default.actions/checkoutnow uses the dispatched ref, which means the workflow, the script, anddata/always come from the one branch chosen in Use workflow from.Making the confirmation value discoverable
Separately, finding the string to type into
confirmmeant knowing to go read thePROJECTvariable — a memory test standing in front of an irreversible action.The dry run now prints it, in both the log and the job summary:
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
PROJECTvariable, and the prefix of every{PROJECT}-*.eoapi.devhostname), and DEPLOYMENT.md lists all three places to find it.Verification
Extracted the
Reset collectionsstep 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:confirm = workshopAlso confirmed the YAML parses, the step is valid bash, the
refinput is gone, andCheckout codeno longer carries awith:block.Note for whoever runs it next
Dispatch from a branch that has
data/tenant-collections.ndjson— currentlyfeat/stac-auth-proxy-lambda(#49), ormainonce that merges. Frommaintoday the keep-list is only 2 fixtures, and the twoprivate-*-democollections would be classified as leftovers.🤖 Generated with Claude Code
https://claude.ai/code/session_01P1CCcrx5fDKuAGsNh8DUFG