Skip to content

Conversation

matthewnitschke-wk
Copy link
Contributor

@matthewnitschke-wk matthewnitschke-wk commented Jun 21, 2023

FEA-2048

Issue Status

Closes #59

Running scip-dart on a dart package with a nested pubspec.yaml file would result in an error (see #59), this pr ignores any subdirectories that declare their own pubspec.yaml file

If nested directories want to be indexed as well, scip-dart can just be re-run on that path

Also, as a QoL update, if the root path provided to scip_dart ./path did not contain a pubspec.yaml file, the cli logs an error and fails with a non-zero exit code.

some CI changes are in this pr as well:

  • fixed a bug where formatting was not failing when it detected changes
  • added an analysis step to ensure analysis passes, implemented default analysis rules, and disabled implicit casts

Comment on lines 11 to 15
return Directory(rootDirectory)
.list(recursive: true, followLinks: false)
.where((file) => p.basename(file.path) == 'pubspec.yaml')
.map((file) => file.path)
.toList();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tested the performance of this on a few different large dart packages

For a package that had 65,000 files, this took 300ms. An acceptable performance hit for a repo of that size

@aviary3-wk
Copy link

Security Insights

No security relevant content was detected by automated scans.

Action Items

  • Review PR for security impact; comment "security review required" if needed or unsure
  • Verify aviary.yaml coverage of security relevant code

Questions or Comments? Reach out on Slack: #support-infosec.

repo: ["Workiva/over_react", "rrousselGit/provider", "dart-lang/args"]
repo: [
"Workiva/over_react",
"Workiva/w_module",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

w_module has a nested pubspec.yaml file in example

Add it as a consumer to verify this new functionality of not breaking on nested packages

@matthewnitschke-wk matthewnitschke-wk changed the title Updated indexer to ignore nested subpackages Ignore nested subpackages Jun 21, 2023
@bender-wk bender-wk changed the title Ignore nested subpackages FEA-2048: Ignore nested subpackages Jun 21, 2023
@matthewnitschke-wk matthewnitschke-wk marked this pull request as ready for review June 21, 2023 20:49
textDocumentEncoding: TextEncoding.UTF8,
toolInfo: ToolInfo(
name: 'scip-dart',
version: '0.0.1',

Choose a reason for hiding this comment

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

Unrelated but should this match the version of this library? Do we need to move this to a constant somewhere and configure the release event to bump it as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea, ideally we do

I didn't love the idea of relying on a release event (if for whatever reason scip-dart changed owners outside of workiva one day) and wanted the solution to be baked into the project

I have an issue tracking this here and a spike pr for one of the solutions here: #45. Just haven't pushed on wrapping that up yet

@matthewnitschke-wk
Copy link
Contributor Author

QA +1

CI passes and verified that indexing works on some packages locally

@matthewnitschke-wk
Copy link
Contributor Author

🚀 @Workiva/release-management-p 🚢

Copy link

@rmconsole-wf rmconsole-wf left a comment

Choose a reason for hiding this comment

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

+1 from RM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Running on nested package throws exception
5 participants