Skip to content

Commit 2ed987f

Browse files
authored
Merge pull request #22827 from github/rust/update-workflow
Rust: Update instructions for rust-analyzer update automation
2 parents 35510a5 + 89fca11 commit 2ed987f

3 files changed

Lines changed: 34 additions & 24 deletions

File tree

‎.github/workflows/update-rust-analyzer.lock.yml‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.github/workflows/update-rust-analyzer.md‎

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -109,23 +109,16 @@ CI, modify files, or create a pull request.
109109

110110
Otherwise, continue the update from the existing working tree and commits:
111111

112-
1. Read `rust/updating-rust-analyzer.md` and all applicable repository
113-
instructions.
114-
2. Review the updater log, exit status, commits, and working tree. Do not rerun
115-
the updater script.
116-
3. Complete as much of the documented update as possible. Fix extractor or
117-
code-generation breakage, keep all `ra_ap_` dependency versions aligned,
118-
regenerate required files, and add schema upgrade/downgrade scripts, tests,
119-
and a change note when the schema changed.
120-
4. Run the relevant formatting, linting, code generation, build, and tests,
121-
including `bazel run //rust:install`. Use `gh` to inspect relevant existing
122-
CI configuration and prior failures while diagnosing problems.
123-
5. Review the complete diff and commits. Do not include secrets. Do not refer
112+
1. Review the updater log, exit status, commits, and working tree. Do not rerun
113+
the updater script or undo changes that it successfully made.
114+
2. Read `rust/updating-rust-analyzer.md` and all applicable repository
115+
instructions, then complete the remaining update steps.
116+
3. Review the complete diff and commits. Do not include secrets. Do not refer
124117
to private repositories, internal issues, or internal pull requests in the
125118
public pull request.
126-
6. Use `create_pull_request` exactly once to create a focused draft pull
127-
request. Summarize the updater output, changes, and validation. If the
128-
update cannot be finished, still create a partial draft pull request when
119+
4. Use `create_pull_request` exactly once. Summarize the updater output,
120+
changes, and validation. If the update cannot be finished, still create a
121+
partial draft pull request when
129122
there are useful changes, and clearly list failures, missing work, and the
130123
next commands for a maintainer.
131124

@@ -134,9 +127,3 @@ CI cannot be awaited in this run. Compensate with the strongest practical
134127
local validation and state this limitation accurately in the pull request.
135128
If the updater did not report `no-update` but no useful patch can be produced,
136129
call `report_incomplete` with the updater failure and exact blocker.
137-
138-
## Safe Outputs
139-
140-
- Use `create_pull_request` for the update or partial update.
141-
- Use `noop` only for the exact no-update result.
142-
- Use `report_incomplete` only when no useful pull request can be created.

‎rust/updating-rust-analyzer.md‎

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,35 @@ pkg-config`.
107107
toolchain, running `rust/lint.py` might reformat or apply new lints to the
108108
code.
109109
110-
7. Check with CI if everything is in order.
110+
7. Update `.expected` files by running:
111+
```
112+
codeql test run --learn --search-path=rust/extractor-pack:. \
113+
--consistency-queries=rust/ql/consistency-queries rust/ql/test
114+
```
115+
The search path selects the newly built extractor from step 6.
116+
117+
If there are changes, commit the updated expectations:
118+
```
119+
git add 'rust/ql/test/**/*.expected'
120+
git commit -m 'Rust: Update test expectations'
121+
```
111122
112-
8. Run DCA with database caching disabled. Iterate on the code if needed.
123+
8. Check the `.expected` files for `testFailures` and fix the underlying
124+
problems.
125+
126+
For each separate problem address the issue, regenerate the `.expected`
127+
files with the command from step 7, and create a commit.
128+
129+
Repeat until no rows under `testFailures` remain and the tests pass.
113130
114131
9. If in step 5 the schema was updated, add upgrade/downgrade scripts and a
115132
change note. This is best done last to reduce the chance of merge conflicts
116133
(none of the other testing depends on having upgrade and downgrade scripts
117134
in place). See [Upgrading a language database
118135
schema](docs/prepare-db-upgrade.md).
136+
137+
10. Create a PR with the changes thus far.
138+
139+
11. Check with CI if everything is in order.
140+
141+
12. Run DCA with database caching disabled. Iterate on the code if needed.

0 commit comments

Comments
 (0)