I've got a set of python targets that deploy using...
# general
w
I've got a set of python targets that deploy using PEX/Docker. I'd like to get a workflow where on CI only targets that have changed are linted/tested/built, for speed, but on main also package and deploy those targets. I've seen
--changed-since
, which seems good for the first case, but i'm not sure how that would work when running on
main
. I'd like to avoid publishing/triggering deploys for targets that haven't changed, is that something pants can help orchestrate, or is that up to user infra?
s
@witty-agent-59418 You can pass the ref of the last packaged commit to
changed_since
, and pants will use that diff: • On PRs/branches:
--changed-since=origin/main
• On main:
--changed-since=$COMMIT_OF_LAST_PACKAGE
ā—¦ The value of
COMMIT_OF_LAST_PACKAGE
is up to your workflow and CI provider
w
Thats what I suspected, somewhere in the middle then šŸ™‚
c
On trunk for publishing we do
--changed-since=HEAD^ --changed-dependents=transitive
(obviously CI/vcs dependent)
šŸ‘ 1
w
Kinda related - is it possible to generate a hash for a target that reflects all dependencies, equivalent to the SHA of a git repo, but limited to a single target?