Merged
Conversation
Security InsightsNo security relevant content was detected by automated scans. Action Items
Questions or Comments? Reach out on Slack: #support-infosec. |
…ces in CI This comment used to go at the end of the line, b but that caused formatting difference between dart_style 2.2.5 and 2.3.2 when the name was prefixed, causing CI failures due to the output sometimes being different, so we'll put it on the previous line for now as an easy fix.
This code doesn't currently run, so this implementation may not be correct.
Before this change, each test would spin up a new AnalysisContextCollection, which was much too slow
7a1a718 to
25ab621
Compare
b3b93cb to
d49d36a
Compare
|
|
||
| abstract class OverReactAnalyzerPluginBase extends ServerPlugin | ||
| with | ||
| mixin OverReactAnalyzerPluginBase |
Contributor
Author
There was a problem hiding this comment.
I made this into a mixin so that we could extend from a stubbed version of ServerPlugin in tests
Contributor
Author
There was a problem hiding this comment.
Whitespace-agnostic diff is helpful for this file.
robbecker-wf
reviewed
Sep 8, 2023
| # Pin mockito to work around https://github.com/dart-lang/mockito/issues/552 | ||
| # until we can get to 5.3.1, which requires a newer analyzer. | ||
| mockito: '>=5.0.0 <5.3.0' | ||
| mockito: ^5.3.1 |
Comment on lines
+109
to
+117
| /// An extension that supports APIs that changed from [Identifier] to [Token], | ||
| /// in order to cut down on diffs in the analyzer 5 upgrade (and subsequent | ||
| /// merge conflicts with the null-safety branch. | ||
| /// | ||
| /// TODO remove this and inline the [name] member. | ||
| extension NameIdentifierTokenCompat on Token { | ||
| String get name => lexeme; | ||
| } | ||
|
|
Member
There was a problem hiding this comment.
oh, good trick! So, then after this merges there's follow up work to inline the lexeme according to that TODO a few lines up?
| (a) => a.nodeHelper.mixins.map((name) => name.name).toList(), | ||
| (b) => [b.name], | ||
| List<String> get allPropsMixins => this.switchCase( | ||
| (a) => a.nodeHelper.mixins.map((name) => name.name.name).toList(), |
Member
There was a problem hiding this comment.
Wow ... name.name.name. Not much to do about that but it's funny.
For some reason, the call to getResolvedUnitResult within DartNavigationMixin results in an InconsistentAnalysisException only in VS Code and not in JetBrains IDES.
robbecker-wf
approved these changes
Sep 8, 2023
Member
|
QA+1
|
Member
|
@Workiva/release-management-p |
This was referenced Sep 15, 2023
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.
Motivation
The
analyzerdependency in over_react and its analyzer plugin are outdated and need to be upgraded. We want to jump from analyzer 2 to analyzer 5.Changes
Root over_react package
class Foo = Bar with Baz) into a single APIAnalyzer plugin subpackage
Update to analyzer 5 and update related dependencies (notably including analyzer_plugin)
Address analyzer breakages, notably:
Fix some built-in analysis warnings in test cases
Address analyzer_plugin breakages.
Mainly, they moved away from having ServerPlugin subclasses instantiate their own
AnalysisDrivers, in favor of the base class managing its ownAnalysisContextCollection(link to main changes). This caused our analyzer setup both in the main plugin and in tests to become invalid, and needed to be refactored.Changes to address this:
Remove invalid
createAnalysisDriveroverride, and instead use theAnalysisContextCollectionprovided by the base classWire up diagnostics to the new
analyzeFilehook, which also seems to be called for non-"priority" files, allowing us to remove the workarounds we had in place to ensure diagnostics were run on all files within a package (see_updatePriorityFilesremoval).Refactor tests to use a slimmed down copy of over_react_codemod's
SharedAnalysisContext. More details:Our tests were pretty tightly coupled to that old implementation, and involved creating our own analysis driver. This setup involved a mock Dart SDK, a memory-based resource provider that required copying code needed for resolved analysis (like over_react and transitive dependencies) and a custom package config.
This setup was pretty complicated, involved src imports, and also needed to be migrated in response to Dart SDK changes. As opposed to trying to update it, I opted to refactor these to use the approach we use in over_react_codemod's tests, which involves creating real
AnalysisContextCollections and sharing them across tests for performance.Release Notes
Review
See CONTRIBUTING.md for more details on review types (+1 / QA +1 / +10) and code review process.
Please review:
QA Checklist
Merge Checklist
While we perform many automated checks before auto-merging, some manual checks are needed: