Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/update-rust-analyzer.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 8 additions & 21 deletions .github/workflows/update-rust-analyzer.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,23 +109,16 @@ CI, modify files, or create a pull request.

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

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

Expand All @@ -134,9 +127,3 @@ CI cannot be awaited in this run. Compensate with the strongest practical
local validation and state this limitation accurately in the pull request.
If the updater did not report `no-update` but no useful patch can be produced,
call `report_incomplete` with the updater failure and exact blocker.

## Safe Outputs

- Use `create_pull_request` for the update or partial update.
- Use `noop` only for the exact no-update result.
- Use `report_incomplete` only when no useful pull request can be created.
27 changes: 25 additions & 2 deletions rust/updating-rust-analyzer.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,35 @@ pkg-config`.
toolchain, running `rust/lint.py` might reformat or apply new lints to the
code.

7. Check with CI if everything is in order.
7. Update `.expected` files by running:
```
codeql test run --learn --search-path=rust/extractor-pack:. \
--consistency-queries=rust/ql/consistency-queries rust/ql/test
```
The search path selects the newly built extractor from step 6.

If there are changes, commit the updated expectations:
```
git add 'rust/ql/test/**/*.expected'
git commit -m 'Rust: Update test expectations'
```

8. Run DCA with database caching disabled. Iterate on the code if needed.
8. Check the `.expected` files for `testFailures` and fix the underlying
problems.

For each separate problem address the issue, regenerate the `.expected`
files with the command from step 7, and create a commit.
Comment on lines +126 to +127

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this needs to be said. Of course the extractor must be re-built if its code is changed.


Repeat until no rows under `testFailures` remain and the tests pass.

9. If in step 5 the schema was updated, add upgrade/downgrade scripts and a
change note. This is best done last to reduce the chance of merge conflicts
(none of the other testing depends on having upgrade and downgrade scripts
in place). See [Upgrading a language database
schema](docs/prepare-db-upgrade.md).

10. Create a PR with the changes thus far.

11. Check with CI if everything is in order.

12. Run DCA with database caching disabled. Iterate on the code if needed.
Loading