Skip to content

Add classpath_depth to allow controlling transitive dependency depth #503

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Jul 19, 2024

Conversation

brian-mcnamara
Copy link
Contributor

@brian-mcnamara brian-mcnamara commented Jun 27, 2024

The work here it to add a classpath_depth option to the bazel project view. This configuration allows the classpath of the project to be reduced, where 1 is only the dependencies required for the targets imported to compile. Setting it less then 0 disables the filtering and the existing functionality to be used.

This allows functionality similar to the IJ bazel plugin, which excludes transitives and provides a partial classpath. I would also like this concept be brought into IJ, but starting here

Copy link
Contributor

@plaird plaird left a comment

Choose a reason for hiding this comment

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

Cool feature. Doesn't Eclipse complain though if it can't find necessary classes when it launches tests?

Copy link

github-actions bot commented Jun 27, 2024

Test Results

 38 files  ±0   38 suites  ±0   21s ⏱️ -1s
 55 tests ±0   54 ✅ ±0   1 💤 ±0  0 ❌ ±0 
110 runs  ±0  100 ✅ ±0  10 💤 ±0  0 ❌ ±0 

Results for commit 0e36caa. ± Comparison against base commit 6de8135.

♻️ This comment has been updated with latest results.

@brian-mcnamara
Copy link
Contributor Author

Cool feature. Doesn't Eclipse complain though if it can't find necessary classes when it launches tests?

Yes, good call out. I need to think though this one, I know IJ invokes bazel to remove the classpath in the IDE from causing issues, may have to do something similar, or figure out a way to store the actual runtime classpath outside Eclipse's project model.

@guw
Copy link
Contributor

guw commented Jun 28, 2024

@brian-mcnamara I think it would be good to capture the motivation for this change. Perhaps we should open an issue and add a few screenshots or some date showing before and/or after timings/memory consumption?

@brian-mcnamara brian-mcnamara marked this pull request as ready for review July 8, 2024 17:07
@brian-mcnamara brian-mcnamara changed the title Add import_depth to allow controlling transative dependency depth Add runtime_import_depth to allow controlling transative dependency depth Jul 8, 2024
@brian-mcnamara
Copy link
Contributor Author

I renamed import_depth to runtime_import_depth due to JetBrains BSP plugin using import_depth flag as a helper to specify the depth of source projects to pull into the project view during sync.

@guw
Copy link
Contributor

guw commented Jul 8, 2024

hmm ... should we use classpath_depth?

@brian-mcnamara
Copy link
Contributor Author

brian-mcnamara commented Jul 8, 2024

hmm ... should we use classpath_depth?

Not opposed to that, the only thing that may be confusing is setting the value to 0, which in the current implementation means exclude all runtime dependencies, but with classpath_depth, 0 to me would indicate even compile time classpath are excluded. I could just subtract 1 from the input to get around this and make it more intuitive.

@brian-mcnamara brian-mcnamara changed the title Add runtime_import_depth to allow controlling transative dependency depth Add classpath_depth to allow controlling transative dependency depth Jul 16, 2024
@brian-mcnamara brian-mcnamara changed the title Add classpath_depth to allow controlling transative dependency depth Add classpath_depth to allow controlling transitive dependency depth Jul 16, 2024
brian-mcnamara and others added 2 commits July 18, 2024 08:47
Co-authored-by: Gunnar Wagenknecht <gunnar@wagenknecht.org>
@brian-mcnamara brian-mcnamara requested a review from guw July 18, 2024 16:54
@guw guw merged commit 8441840 into salesforce:main Jul 19, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants