I’ve been setting up my monorepo projects with a S...
# plugins
c
I’ve been setting up my monorepo projects with a Software Composition Analysis (SCA) platform (product security tools to manage/monitor dependencies licensing/vulnerabilities) and it is straight forward export the python dependancies for the whole monorepo (just strip off the comment lines off a python pex lock file and
pex lock export
to a compatible format for the SCA platform). But what I really need is the ability to
pex lock export
per component/target in the monorepo, different artefacts are used/distributed differently, and thus have different risk profiles. I’ve manually determined the steps to go from
pants dependencies --dependencies-transitive
to a requirements.txt for python, and something similar with golang, and now I’m deciding how to best put this into code. Would this be a good candidate for a pants plugin?
h
So
./pants dependencies --transitive
(note in passing that you can omit the goal name in the flag if it's after the goal) will give you the direct third-party reqs that Pants knows about, but not those reqs transitive reqs
👍 1
But Pants does have that information! It's in the lockfile.
We just don't surface it at the moment.
What is this SCA's input format? A requirements.txt, and it does the transitive resolution itself?
c
it supports pipfile, requirements.txt, or a poetry lock file for python. It's not able to do transitive resolution itelsef. I've found how to parse the lock file to get the versions etc.
I feel like this doesn't really warrant it's own plugin, but rather an enhancement to the existing functionality
I'm happy to contribute this functionality if it's useful to others. I see it as two small improvement tasks to the
dependencies
goal: • an additional flag to show reqs transitive reqs • an additional flag to format this output in in a requirements.txt syntax
h
The first thing would definitely be valuable.
The second has an overlap with
export
But I think we can ignore that for now (
export
exports an entire lockfile, which is not what you want, right?)
There are some design issues to discuss, can you open a github issue for this feature, and we can discuss there?
👍 1
c
Thanks @happy-kitchen-89482 I’ve opened the issue here: https://github.com/pantsbuild/pants/issues/17813
👀 1