https://pantsbuild.org/ logo
#general
Title
# general
b

blue-city-46130

03/30/2023, 2:45 PM
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

enough-analyst-54434

03/30/2023, 2:49 PM
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

bitter-ability-32190

03/30/2023, 2:53 PM
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

blue-city-46130

03/30/2023, 2:56 PM
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

enough-analyst-54434

03/30/2023, 3:12 PM
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

ripe-gigabyte-88964

03/30/2023, 3:15 PM
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

blue-city-46130

03/30/2023, 3:21 PM
Thanks for the info, I will perform some tests and see if I can get something working
e

enough-analyst-54434

03/30/2023, 3:23 PM
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

ripe-gigabyte-88964

03/30/2023, 3:25 PM
@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

blue-city-46130

03/30/2023, 3:30 PM
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)