[M] Change in dart/sdk[main]: [migrate] Allow additional force enabled codes in BulkFixProcessor.

0 views
Skip to first unread message

Kallen Tu (Gerrit)

unread,
Jun 8, 2026, 2:46:56 PM (yesterday) Jun 8
to Paul Berry, Brian Wilkerson, Konstantin Shcheglov, dart-...@luci-project-accounts.iam.gserviceaccount.com, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Brian Wilkerson and Konstantin Shcheglov

Kallen Tu added 2 comments

Patchset-level comments
File-level comment, Patchset 3:
Kallen Tu . resolved

Hey everyone. This is a WIP of changing the BulkFixProcessor to be able to handle force-enabled lints, which will eventually be used for the migrate tool's pre-migration and post-migration phase.

I cloned the driver and the analysis options map. The analysis options map has existing lints and the new ones we're trying to enable.

This is what I understood from our email thread, so let me know if I'm overlooking some API I should be using or if this is different than what you envisioned. I'd appreciate if you could give this a look to LMK if I'm completely off the mark here. Thank you!

Konstantin Shcheglov

My understanding of the email thread was: don't clone, prefer using API; so create a new `AnalysisContextCollection` using the same `ByteStore` instance, maybe with `OverlayResourceProvider` to patch `analysis_options.yaml` file(s).

Kallen Tu

Noted. Made more changes, PTAL.

Kallen Tu

Resolving.

File pkg/analysis_server/lib/src/services/correction/bulk_fix_processor.dart
Line 554, Patchset 9: var originalDriver = (originalContext as DriverBasedAnalysisContext).driver;
Konstantin Shcheglov . resolved

The server already knows resourceProvider and byteStore, there is no need to pick them out of the driver. Pass them down from the calling context.

Kallen Tu

Passed them in as parameters, PTAL

Open in Gerrit

Related details

Attention is currently required from:
  • Brian Wilkerson
  • Konstantin Shcheglov
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I346a1fba8a25d7ebc6a2d95828796e7f7c0ff52c
Gerrit-Change-Number: 509681
Gerrit-PatchSet: 12
Gerrit-Owner: Kallen Tu <kall...@google.com>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Kallen Tu <kall...@google.com>
Gerrit-Reviewer: Konstantin Shcheglov <sche...@google.com>
Gerrit-Reviewer: Paul Berry <paul...@google.com>
Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
Gerrit-Attention: Konstantin Shcheglov <sche...@google.com>
Gerrit-Comment-Date: Mon, 08 Jun 2026 18:46:52 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Kallen Tu <kall...@google.com>
Comment-In-Reply-To: Konstantin Shcheglov <sche...@google.com>
unsatisfied_requirement
open
diffy

Konstantin Shcheglov (Gerrit)

unread,
Jun 8, 2026, 2:49:15 PM (yesterday) Jun 8
to Kallen Tu, Paul Berry, Brian Wilkerson, dart-...@luci-project-accounts.iam.gserviceaccount.com, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Brian Wilkerson and Kallen Tu

Konstantin Shcheglov voted and added 1 comment

Votes added by Konstantin Shcheglov

Code-Review+1

1 comment

File pkg/analysis_server/lib/src/services/correction/bulk_fix_processor.dart
Line 188, Patchset 12 (Latest): this._workspace, {
Konstantin Shcheglov . unresolved

These probably could be part of workspace.

Open in Gerrit

Related details

Attention is currently required from:
  • Brian Wilkerson
  • Kallen Tu
Submit Requirements:
    • requirement is not satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: sdk
    Gerrit-Branch: main
    Gerrit-Change-Id: I346a1fba8a25d7ebc6a2d95828796e7f7c0ff52c
    Gerrit-Change-Number: 509681
    Gerrit-PatchSet: 12
    Gerrit-Owner: Kallen Tu <kall...@google.com>
    Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
    Gerrit-Reviewer: Kallen Tu <kall...@google.com>
    Gerrit-Reviewer: Konstantin Shcheglov <sche...@google.com>
    Gerrit-Reviewer: Paul Berry <paul...@google.com>
    Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
    Gerrit-Attention: Kallen Tu <kall...@google.com>
    Gerrit-Comment-Date: Mon, 08 Jun 2026 18:49:12 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    unsatisfied_requirement
    satisfied_requirement
    open
    diffy

    Kallen Tu (Gerrit)

    unread,
    Jun 8, 2026, 4:34:12 PM (yesterday) Jun 8
    to Konstantin Shcheglov, Paul Berry, Brian Wilkerson, dart-...@luci-project-accounts.iam.gserviceaccount.com, dart-analys...@google.com, rev...@dartlang.org
    Attention needed from Brian Wilkerson and Konstantin Shcheglov

    Kallen Tu added 1 comment

    File pkg/analysis_server/lib/src/services/correction/bulk_fix_processor.dart
    Line 188, Patchset 12: this._workspace, {
    Konstantin Shcheglov . unresolved

    These probably could be part of workspace.

    Kallen Tu

    Adding byteStore to `DartChangeWorkspace` changes 20+ callsites if the parameter was required, and many of those call sites aren't using BulkFixProcessor afterwards. If we kept it optional, I'd prefer it to be in the parameter list of BulkFixProcessor, like how it is now.

    Removed the resourceProvider though. We can get that through the workspace.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Brian Wilkerson
    • Konstantin Shcheglov
    Submit Requirements:
    • requirement is not satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: sdk
    Gerrit-Branch: main
    Gerrit-Change-Id: I346a1fba8a25d7ebc6a2d95828796e7f7c0ff52c
    Gerrit-Change-Number: 509681
    Gerrit-PatchSet: 13
    Gerrit-Owner: Kallen Tu <kall...@google.com>
    Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
    Gerrit-Reviewer: Kallen Tu <kall...@google.com>
    Gerrit-Reviewer: Konstantin Shcheglov <sche...@google.com>
    Gerrit-Reviewer: Paul Berry <paul...@google.com>
    Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
    Gerrit-Attention: Konstantin Shcheglov <sche...@google.com>
    Gerrit-Comment-Date: Mon, 08 Jun 2026 20:34:09 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Konstantin Shcheglov <sche...@google.com>
    unsatisfied_requirement
    satisfied_requirement
    open
    diffy

    Brian Wilkerson (Gerrit)

    unread,
    1:52 PM (9 hours ago) 1:52 PM
    to Kallen Tu, Brian Wilkerson, Konstantin Shcheglov, Paul Berry, dart-...@luci-project-accounts.iam.gserviceaccount.com, dart-analys...@google.com, rev...@dartlang.org
    Attention needed from Kallen Tu and Konstantin Shcheglov

    Brian Wilkerson voted and added 1 comment

    Votes added by Brian Wilkerson

    Code-Review+1

    1 comment

    File pkg/analysis_server/lib/src/services/correction/bulk_fix_processor.dart
    Line 558, Patchset 13 (Latest): includedPaths: [originalContext.contextRoot.root.path],
    Brian Wilkerson . unresolved

    I think this needs to pass in the excluded paths as well, otherwise it might analyze more files than intended, which could lead to unwanted fixes being applied.

    If that's true, then we should have a regression test.

    I don't think it will break users to land this as-is and address the exclusions in a follow-on CL if you want.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Kallen Tu
    • Konstantin Shcheglov
    Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: sdk
    Gerrit-Branch: main
    Gerrit-Change-Id: I346a1fba8a25d7ebc6a2d95828796e7f7c0ff52c
    Gerrit-Change-Number: 509681
    Gerrit-PatchSet: 13
    Gerrit-Owner: Kallen Tu <kall...@google.com>
    Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
    Gerrit-Reviewer: Kallen Tu <kall...@google.com>
    Gerrit-Reviewer: Konstantin Shcheglov <sche...@google.com>
    Gerrit-Reviewer: Paul Berry <paul...@google.com>
    Gerrit-Attention: Kallen Tu <kall...@google.com>
    Gerrit-Attention: Konstantin Shcheglov <sche...@google.com>
    Gerrit-Comment-Date: Tue, 09 Jun 2026 17:52:24 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Kallen Tu (Gerrit)

    unread,
    2:02 PM (8 hours ago) 2:02 PM
    to Brian Wilkerson, Konstantin Shcheglov, Paul Berry, dart-...@luci-project-accounts.iam.gserviceaccount.com, dart-analys...@google.com, rev...@dartlang.org
    Attention needed from Brian Wilkerson and Konstantin Shcheglov

    Kallen Tu voted and added 1 comment

    Votes added by Kallen Tu

    Commit-Queue+2

    1 comment

    File pkg/analysis_server/lib/src/services/correction/bulk_fix_processor.dart
    Line 558, Patchset 13 (Latest): includedPaths: [originalContext.contextRoot.root.path],
    Brian Wilkerson . unresolved

    I think this needs to pass in the excluded paths as well, otherwise it might analyze more files than intended, which could lead to unwanted fixes being applied.

    If that's true, then we should have a regression test.

    I don't think it will break users to land this as-is and address the exclusions in a follow-on CL if you want.

    Kallen Tu

    Good point. I'll make a follow up, thanks.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Brian Wilkerson
    • Konstantin Shcheglov
    Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: sdk
    Gerrit-Branch: main
    Gerrit-Change-Id: I346a1fba8a25d7ebc6a2d95828796e7f7c0ff52c
    Gerrit-Change-Number: 509681
    Gerrit-PatchSet: 13
    Gerrit-Owner: Kallen Tu <kall...@google.com>
    Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
    Gerrit-Reviewer: Kallen Tu <kall...@google.com>
    Gerrit-Reviewer: Konstantin Shcheglov <sche...@google.com>
    Gerrit-Reviewer: Paul Berry <paul...@google.com>
    Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
    Gerrit-Attention: Konstantin Shcheglov <sche...@google.com>
    Gerrit-Comment-Date: Tue, 09 Jun 2026 18:02:26 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Brian Wilkerson <brianwi...@google.com>
    satisfied_requirement
    open
    diffy

    dart-scoped@luci-project-accounts.iam.gserviceaccount.com (Gerrit)

    unread,
    2:29 PM (8 hours ago) 2:29 PM
    to Kallen Tu, Brian Wilkerson, Konstantin Shcheglov, Paul Berry, dart-analys...@google.com, rev...@dartlang.org

    dart-...@luci-project-accounts.iam.gserviceaccount.com submitted the change

    Change information

    Commit message:
    [migrate] Allow additional force enabled codes in BulkFixProcessor.

    This CL allows the BulkFixProcessor to handle additional force-enabled
    codes that may not be enabled in the existing analysis options of the
    current project.
    Change-Id: I346a1fba8a25d7ebc6a2d95828796e7f7c0ff52c
    Commit-Queue: Kallen Tu <kall...@google.com>
    Reviewed-by: Konstantin Shcheglov <sche...@google.com>
    Reviewed-by: Brian Wilkerson <brianwi...@google.com>
    Files:
    • M pkg/analysis_server/lib/src/handler/legacy/edit_bulk_fixes.dart
    • M pkg/analysis_server/lib/src/lsp/handlers/commands/fix_all.dart
    • M pkg/analysis_server/lib/src/lsp/handlers/commands/fix_all_in_workspace.dart
    • M pkg/analysis_server/lib/src/services/correction/bulk_fix_processor.dart
    • M pkg/analysis_server/lib/src/services/user_prompts/dart_fix_prompt_manager.dart
    • M pkg/analysis_server/test/abstract_context.dart
    • M pkg/analysis_server/test/src/services/correction/fix/bulk_fix_processor_test.dart
    • M pkg/analysis_server/test/src/services/correction/fix/fix_processor.dart
    Change size: M
    Delta: 8 files changed, 203 insertions(+), 13 deletions(-)
    Branch: refs/heads/main
    Submit Requirements:
    • requirement satisfiedCode-Review: +1 by Brian Wilkerson, +1 by Konstantin Shcheglov
    Open in Gerrit
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: merged
    Gerrit-Project: sdk
    Gerrit-Branch: main
    Gerrit-Change-Id: I346a1fba8a25d7ebc6a2d95828796e7f7c0ff52c
    Gerrit-Change-Number: 509681
    Gerrit-PatchSet: 14
    Gerrit-Owner: Kallen Tu <kall...@google.com>
    Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
    Gerrit-Reviewer: Kallen Tu <kall...@google.com>
    Gerrit-Reviewer: Konstantin Shcheglov <sche...@google.com>
    Gerrit-Reviewer: Paul Berry <paul...@google.com>
    open
    diffy
    satisfied_requirement
    Reply all
    Reply to author
    Forward
    0 new messages