Repository navigation
Remove legacy jobs and RunLog observability residue #1215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
8 changes: 8 additions & 0 deletions
8
packages/worker/migrations/0144-drop-jobs-observability-columns.sql
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| -- RunLog is the sole authority for job error, duration, and outcome counters. | ||
| -- Keep the D1 scheduling/retention anchors last_run_at and last_run_status. | ||
|
|
||
| ALTER TABLE jobs DROP COLUMN last_run_error; | ||
| ALTER TABLE jobs DROP COLUMN last_duration_ms; | ||
| ALTER TABLE jobs DROP COLUMN run_count; | ||
| ALTER TABLE jobs DROP COLUMN success_count; | ||
| ALTER TABLE jobs DROP COLUMN error_count; | ||
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration | 🔴 Critical | 🏗️ Heavy lift
Fix the
jobscolumn contract before applying migration0144.Preview deployment fails at Line 4 with
SQLite error - no such column: "last_run_error". The migration stops before it applies the remaining drops. Reconcile these statements with the schema produced before migration0144, then update the checksum intools/migration-ledger.jsonat Lines 584-585. Do not deploy until a clean preview applies the migration.🧰 Tools
🪛 GitHub Actions: 🔎 Preview / 🔎 Deploy Preview Resources
[error] Database migration failed: A request to the Cloudflare API failed. SQLite error - no such column: "last_run_error" at offset 32 [code: 7500]. The migration attempted to reference a column that does not exist in the database schema. Verify that the database schema matches the expected state before applying this migration.
🪛 Squawk (2.61.0)
[warning] 4-4: Dropping a column may break existing clients.
(ban-drop-column)
[warning] 5-5: Dropping a column may break existing clients.
(ban-drop-column)
[warning] 6-6: Dropping a column may break existing clients.
(ban-drop-column)
[warning] 7-7: Dropping a column may break existing clients.
(ban-drop-column)
[warning] 8-8: Dropping a column may break existing clients.
(ban-drop-column)
🤖 Prompt for AI Agents
Source: Pipeline failures
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: kentcdodds/kody
Length of output: 50372
🏁 Script executed:
Repository: kentcdodds/kody
Length of output: 21017
🏁 Script executed:
Repository: kentcdodds/kody
Length of output: 50371
Add a D1-to-run-log observability migration before dropping these columns.
0144-drop-jobs-observability-columns.sqlremoveslast_run_error,last_duration_ms,run_count,success_count, anderror_countfromjobswithout populatingjob_run_observability. Existing job records will lose historical D1 observability after this drop, so backfilluserId/jobIdand aggregate values intojob_run_observabilityfirst.🧰 Tools
🪛 GitHub Actions: 🔎 Preview / 🔎 Deploy Preview Resources
[error] Database migration failed: A request to the Cloudflare API failed. SQLite error - no such column: "last_run_error" at offset 32 [code: 7500]. The migration attempted to reference a column that does not exist in the database schema. Verify that the database schema matches the expected state before applying this migration.
🪛 Squawk (2.61.0)
[warning] 4-4: Dropping a column may break existing clients.
(ban-drop-column)
[warning] 5-5: Dropping a column may break existing clients.
(ban-drop-column)
[warning] 6-6: Dropping a column may break existing clients.
(ban-drop-column)
[warning] 7-7: Dropping a column may break existing clients.
(ban-drop-column)
[warning] 8-8: Dropping a column may break existing clients.
(ban-drop-column)
🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved operationally and verified on a clean preview. This PR’s persisted preview D1 had already applied the identical migration under its pre-rebase
0142filename, so the renamed0144replay correctly found the columns absent. Production never applied0142. I cleaned only PR #1215’s disposable preview resources and reran deployment from an empty preview database; migration0144and the full preview deploy now pass: https://github.com/kentcdodds/kody/actions/runs/30925518579/job/92049383782. Localnpm run validatealso passes from fresh E2E D1 state.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.