Repository navigation
fix(ci): Let destroy-all run on a stack that has no D1 database - #945
Conversation
destroy-all read the enabled services from D1 before anything else and failed when the query did. A stack that was set up but never deployed has no D1 database, so its destroy could never succeed — and Nexus-Conductor will not delete a user's repository until one does. Seen on a Conductor user whose stack was never deployed. When the query fails, the step now asks whether the database exists. Only a successful listing that does not contain it counts as absent; a failed or unparsable listing is still a failure. With the database absent, the destroy proceeds with no enabled services: tofu destroy acts on the state, and the init step already skips the destroy when the state bucket is missing too.
|
Sorry @stefanko-ch, you've used your own review budget of 250,000 diff characters for the last 7 days. You can request another review in 5 days and 4 hours by commenting |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Reviewer's GuideThe workflow now distinguishes a genuinely absent D1 database from an unavailable or invalid D1 lookup, allowing never-deployed stacks to reach the existing state checks and complete destroy successfully without weakening error handling. Flow diagram for handling an absent D1 database during destroyflowchart TD
A[Read enabled services from D1] --> B{D1 query failed?}
B -->|No| C[Continue with enabled services]
B -->|Yes| D[Run wrangler d1 list --json]
D --> E{Database absent and listing valid?}
E -->|Yes| F[Set empty enabled services]
E -->|No| G[Fail destroy]
F --> H[Run existing state checks]
C --> H
H --> I[OpenTofu destroy or skip when state bucket is missing]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
🤖 I have created a release *beep* *boop* --- ## [0.87.0](v0.86.0...v0.87.0) (2026-10-29) ### 🚀 Features * **control-plane:** Drive the lifecycle buttons on a Forgejo-hosted fork ([#946](#946)) ([b04a57e](b04a57e)) ### 🐛 Bug Fixes * **ci:** Let destroy-all run on a stack that has no D1 database ([#945](#945)) ([d6485a0](d6485a0)) * **stacks:** Let the Forgejo runner take four jobs on three CPUs ([#944](#944)) ([4cc3fc3](4cc3fc3)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). ## Summary by Sourcery Release version 0.87.0 with Forgejo lifecycle controls and fixes for stack cleanup and runner capacity. New Features: - Add lifecycle button control for forks hosted on Forgejo. Bug Fixes: - Allow destroy-all to run for stacks without a D1 database. - Increase Forgejo runner capacity to four jobs on three CPUs. Documentation: - Document the 0.87.0 release in the changelog. Chores: - Bump the release manifest to version 0.87.0. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Summary
destroy-all.ymlread the enabled services from D1 before anything else, and stopped when the query failed. A stack that was set up but never deployed has no D1 database, so its destroy could never succeed.Nexus-Conductor will not delete a user's repository until a destroy succeeds. A never-deployed Conductor user (
yara-koch, run 1 on that user's fork) therefore failed at "Generate config.tfvars" and could not be removed.The fix: when the query fails, the step now asks whether the database exists.
wrangler d1 list --jsonsucceeds and its list does not contain the name. A failed or unparsable listing is still a failure.tofu destroyacts on the state;Checks
nexus-yara-koch-nona-company-dbreads as absent;nexus-deads8-test-nona-company-dbreads as present;jq -e(rc 5) and takes the error path.Local review
CodeRabbit CLI on
1b5d91c5: 0 findings.Not yet verified
The fix has not run on a real fork; it needs a release first.
How to test
After the release reaches the Conductor template mirror, run destroy for
yara-koch(class BIA22) in Conductor. Expect:Summary by Sourcery
Bug Fixes: