Repository navigation
fix(memory): add missing artifact columns to databases created before pin/rename - #3450
Merged
zhayujie merged 1 commit intoOct 3, 2026
Merged
Conversation
… pin/rename
The artifacts table evolved in place: pinned_at and title were written into
_ARTIFACTS_DDL while the ADD COLUMN migration path that carried them was
removed. CREATE TABLE IF NOT EXISTS is a no-op on a database an older release
already created, so those databases keep the old shape; _artifacts_ready still
turns True, writes keep landing, and every read of a.pinned_at raises
OperationalError. The artifact view then returns {"status":"error"} forever and
pin/rename can never work.
Restore the added-column list and apply it after the DDL, and cover it with a
test that starts from the pre-pin table shape.
Owner
|
Thanks for the column backfill for databases created before pin/rename — merged! |
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.
What does this PR do?
74cc1a7fadded thepinned_atandtitlecolumns by editing_ARTIFACTS_DDLdirectly, and at the same time removed_ARTIFACTS_ADDED_COLUMNSand its regression test — the ADD-COLUMN path thate9bff3ddhad established for exactly this situation, under a comment reading "Evolve the schema by appending here, never by editing the DDL alone".CREATE TABLE IF NOT EXISTSis a no-op on a table an older release already created, so any database whoseartifactstable was built bye9bff3ddkeeps the old shape permanently. Setup still succeeds, so_artifacts_readystaysTrueandrecord_artifacts()keeps writing rows, while every read of the new columns raises:channel/web/api/artifacts.pycatches every exception and answers{"status": "error", ...}, so on such an install the artifact center is permanently empty and pin/rename always fail, with no self-repair. Fresh installs happen to look fine, which is why the break does not show up from a clean checkout.This restores the added-column list (
extras,pinned_at,title) and applies it after the DDL, so an existing table gains whatever it lacks.Type of change
How was it tested?
New regression test
test_a_table_from_before_pin_and_title_gained_themcreates the pre-pin table shape, opens the store on it, and asserts the columns appear and listing, pinning and renaming all work.Before the fix it fails, as expected:
After the fix, measured on Python 3.13 / Windows:
The 4 failures are pre-existing on this platform and unrelated (
docs\guide.docxvsdocs/guide.docxpath separators); they fail identically at74cc1a7fwithout this change.The full suite was run on the branch, and then the 17 files those failures came from were re-run with this change reverted:
So the failure set is identical at the base; this change turns one failure green and adds none.
ruff check --select F --ignore F403,F405on both changed files:All checks passed!.Checklist
Disclosure: this PR was written and tested by an AI agent operating this account; no human has reviewed the diff yet. The "tested locally" box refers to the agent's runs, whose commands and outputs are quoted above.