Skip to content

Add a triagebot warning for rust-analyzer's generated files#158834

Open
ShoyuVanilla wants to merge 1 commit into
rust-lang:mainfrom
ShoyuVanilla:r-a-codegen-warning
Open

Add a triagebot warning for rust-analyzer's generated files#158834
ShoyuVanilla wants to merge 1 commit into
rust-lang:mainfrom
ShoyuVanilla:r-a-codegen-warning

Conversation

@ShoyuVanilla

@ShoyuVanilla ShoyuVanilla commented Jul 6, 2026

Copy link
Copy Markdown
Member

Warns whenever a contributor touches either src/tools/rust-analyzer/**/generated.rs or src/tools/rust-analyzer/**/generated/foo.rs files.

cc @rust-lang/rust-analyzer

@rustbot rustbot added A-meta Area: Issues & PRs about the rust-lang/rust repository itself S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 6, 2026
@rustbot

rustbot commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Fallback group: @Mark-Simulacrum, @jieyouxu
  • @Mark-Simulacrum, @jieyouxu expanded to Mark-Simulacrum, jieyouxu
  • Random selection from Mark-Simulacrum, jieyouxu

@rustbot

This comment has been minimized.

@ShoyuVanilla

Copy link
Copy Markdown
Member Author

@bors squash

@rust-bors

This comment has been minimized.

@rust-bors

rust-bors Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

🔨 2 commits were squashed into b8c1997.

@rust-bors rust-bors Bot force-pushed the r-a-codegen-warning branch from 1d7e5f2 to b8c1997 Compare July 6, 2026 03:20
@rust-log-analyzer

This comment has been minimized.

Comment thread triagebot.toml
"""
cc = ["@rust-lang/rust-analyzer"]

[mentions."src/tools/rust-analyzer/**/generated{,.rs}"]

@ChayimFriedman2 ChayimFriedman2 Jul 6, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We also have some files in generated/ directories.

View changes since the review

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah, this pattern catches both generated/ and generated.rs, though it is currently blocked in CI by tidy's false positive error

jhpratt added a commit to jhpratt/rust that referenced this pull request Jul 6, 2026
… r=jieyouxu

tidy: Use `empty_alternate = true` for triagebot mention glob check

In accordance with triagebot's following line:
https://github.com/rust-lang/triagebot/blob/8fe35ac13efb881598a4f1d7768d5dee5a3fff09/src/handlers/mentions.rs#L217

Fixes a false positive tidy failure in rust-lang#158834 (comment)
* Add a triagebot warning for `rust-analyzer`'s generated files
* Fix unmatched quotes
@ShoyuVanilla ShoyuVanilla force-pushed the r-a-codegen-warning branch from b8c1997 to 201ce96 Compare July 7, 2026 00:23
@rustbot

rustbot commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@ShoyuVanilla

Copy link
Copy Markdown
Member Author

Cool, with #158838, tidy doesn't fail anymore

jollaitbot pushed a commit to sailfishos-mirror/rust that referenced this pull request Jul 7, 2026
Rollup merge of #158838 - ShoyuVanilla:triagebot-glob-fixup, r=jieyouxu

tidy: Use `empty_alternate = true` for triagebot mention glob check

In accordance with triagebot's following line:
https://github.com/rust-lang/triagebot/blob/8fe35ac13efb881598a4f1d7768d5dee5a3fff09/src/handlers/mentions.rs#L217

Fixes a false positive tidy failure in rust-lang/rust#158834 (comment)
Comment thread triagebot.toml
message = """
⚠️ This PR modifies files generated by a `rust-analyzer` codegen command \
or CI job. If these changes were made manually, consider removing them from \
this PR by editing the relevant commit, if possible.

@Mark-Simulacrum Mark-Simulacrum Jul 7, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Shouldn't this say something about how to make them "intentionally"? Maybe we can reference some kind of documentation, e.g., link [codegen command](...) somewhere?

View changes since the review

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is different for each file. For some we have a CI job once per some time and you should never update them directly. For others you do need to manually update (although CI will fail if you do not), but the changes that require updating them are unlikely to be needed in r-l/r.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah, I was a bit hesitant to go for full details as it would be verbose for the reasons Chayim said. But I think perhaps I could add a comprehensive chapter for the generated files in rust-analyzer's docs and refer its link here

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We could also ensure that the generated files have a comment at the top pointing to the source, and then mention that in the message

pull Bot pushed a commit to xtqqczze/rust-lang-miri that referenced this pull request Jul 7, 2026
tidy: Use `empty_alternate = true` for triagebot mention glob check

In accordance with triagebot's following line:
https://github.com/rust-lang/triagebot/blob/8fe35ac13efb881598a4f1d7768d5dee5a3fff09/src/handlers/mentions.rs#L217

Fixes a false positive tidy failure in rust-lang/rust#158834 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-meta Area: Issues & PRs about the rust-lang/rust repository itself S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants