Hi! Im evaluating pants for use on existing projec...
# general
b
Hi! Im evaluating pants for use on existing projects, we want to move to a monorepo architecture and use pants to help us manage dependencies. The question we have is how does Pants handle multiple github deployment targets for different projects within the same repo?
e
You mean these?: https://docs.github.com/en/rest/deployments?apiVersion=2022-11-28 Pants has no current support at all for those GitHub Deployments. That would require plugin work or adhoc tool usage.
b
Should be pretty workable though and a useful plugin. Let us know if youre interested in experimenting yourself, we're here to help along the way 🙂
b
ah, sorry, we use github workflows to deploy our code so for example a unittest.yaml and a deploy.yaml where the deploy.yaml calls a python script to handle the deployment to our platform. by merging our repos into a monorepo we would then have multiple of these deploy stages (one for each project), does pants have a nice way to manage which deploy scripts are run based on what was updated?
Maybe this is a little out of scope for what Pants is intended for
e
Pants has
pants --changed-since=<sha/branch> <goals>
. Now the
run
goal only accepts one thing to run and fails otherwise; so this wouldn't work if there are multiple deploys needed. The
package
goal can package multiple changed deployment artifacts (they'll be deposited under
dist/
). You could then operate on all such deployment artifacts. Likely, though you'll need to customize some. The
--changed-since
basic infra is there though.
r
I was actually just about to post a question about running
--changed-since
on Github because on pull requests I get
Invalid symmetric difference expression
- I'm assuming this is calling
git log
under the hood but the only thing git log shows on PRs is something like
cc87e7389fa19c0a4b68af21212a9b50ae9f8469 Merge c98ed6b4db10b6dc7612dea68e3c338f6efc6b42 into 57fbc92e7ca355ce28c061dadc358d9e7daa34fb
rather than the full commit history
b
Thanks for the info, I will perform some tests and see if I can get something working
e
One thing to be wary of on GH is the default checkout action fetch depth. You need to have enough commit history in the clone to do the calcs.
r
@blue-city-46130 I've been doing something similar with my team and once you get used to the Pants ecosystem it's fairly easy to wire up whatever you need. What I've been setting up is an initial workflow job that packages everything up, stores the
dist
folder as an artifact, and then uses a custom script to output a list of artifacts to deploy. Then a second workflow job runs on a matrix to grab each individual deployment artifact and deploys it out. Depending on what you're working with though you could even have pants do your deployments for you, which is the most convenient option.
b
Thanks, just getting into it, overall looks fairly easy, just some small things here and there. We work alot with pyspark, and looking through the previous questions I see it being mentioned a few times.
In our case we dont actually package anything just an api call to update the repo on another platform with the new version(s)