Repository navigation
Go: Fix database upgrade script - #22783
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The upgrade accurately reproduces the extractor’s new relations and parent structure.
0 open findings
What changed in this PR
Adds a complete Go database upgrade for synthesized range-loop element expressions.
Changes:
- Synthesizes range-element nodes, reparents loop variables, and copies locations.
- Marks the upgrade as fully compatible and configures relation transformations.
| File | Description |
|---|---|
upgrade.ql |
Reconstructs extractor-equivalent range-element data. |
upgrade.properties |
Runs transformations and declares full compatibility. |
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
michaelnebel
reviewed
Oct 8, 2026
michaelnebel
reviewed
Oct 8, 2026
| idx in [0 .. 1] | ||
| } | ||
|
|
||
| query predicate new_exprs(NewExpr id, int kind, NewExprParent parent, int idx) { |
Contributor
There was a problem hiding this comment.
With the upgrade script, the parent/child relation is expanded
Before
range_stmt ->_0 expr_0
range_stmt ->_1 expr_1
After
range_stm ->_0 range_expression
range_expression ->_0 expr_0
range_expression ->_1 expr_1
Perhaps, a downgrade script is needed as well that contracts the parent/child relation (and deletes the range_expression's).
Contributor
Author
There was a problem hiding this comment.
That was already done in the original commit.
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.
In #22182 a change was made to the dbsceme for
rangeloops. The upgrade script (in 171046a) was a no-op and was marked aspartialcompatibility. It should have been marked asbreakingcompatibility. Instead, this PR actually makes afullcompatibility upgrade script. I have tested this locally and it worked as expected. I have also done careful manual review that this reproduces the missing relations that the new version of the extractor creates.