-
Notifications
You must be signed in to change notification settings - Fork 7
fix: moduleArtifacts is sometimes empty #292
Conversation
d10d977
to
85fd648
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good generally; left a lot of mostly-minor comments
any ideas on unit testing this script
No, short of breaking the script out into a separate repo (which I'd certainly like to do).
Please pay particular attention to the documentation and comment changes. Do these help improve understandability?
Yes, these docs are great and seem approachable.
It might be helpful to occasionally link to key terms in a glossary or other relevant documentation -- especially for the warnings like "This strategy requires dynamic analysis", which probably wouldn't mean anything to me as a user (both what "dynamic analysis" means, and the impact of requiring it). I also likely wouldn't understand the ramifications of "This tactic provides a graph for subproject dependencies" without a link to additional documentation.
Additionally, linking to relevant documentation the first time we use our own defined terms like "tactic" or "strategy" or "analysis target" might be helpful, as those terms likely won't mean anything to a user directly navigating to the gradle docs page
b122716
to
8ec3cca
Compare
Thanks for the thorough docs read! |
Overview
This PR fixes an issue where
moduleArtifacts
could be empty, causing a silentNoSuchElementException
that would cause certain Gradle configurations to not resolve dependencies.Please pay particular attention to the documentation and comment changes. Do these help improve understandability? I would like to use the documentation I wrote here as the model for docs for all future analyzers.
Acceptance criteria
Gradle projects relying on dependencies with no module artifacts (e.g.
jackson-bom
orjunit-bom
) should successfully resolve.Testing plan
Put this
build.gradle.kts
file in a new empty directory to use as a test project:(Run
gradle :dependencies
in the directory to see that this is a valid project, and to make sure yourgradle
is working.)Run
fossa analyze --output
using a build frommaster
on the directory containing this file. Notice that no dependencies are found.Then, switch to this PR, and try again. You should now get working dependencies.
Risks
I'm not sure how to actually unit test this change. @cnr, any ideas on unit testing this script?
If not, I think I'll add this to our integration tests once they merge back into Spectrometer (i.e. once https://github.com/fossas/team-analysis/issues/676 lands).
References
Resolves support conversation in Slack here.
Checklist
haskell-language-server
) any haskell files I touched in this PR.docs/
.Changelog.md
if this change is externally facing. If this PR did not mark a release, I added my changes into an# Unreleased
section at the top.