You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using the set-parameters command in the path-filtering orb to try to minimize how often have to run certain jobs in our workflow. The idea is that if the code has not changed fundamentally, we can rely on artifacts created, and scans that have been performed in a previous branch.
The issue we are running to is on branch creation. Here is the scenario:
So the idea is if api-changed, service-changed, or version-changed are not set to true, then we don't need to re-run our full build and scan workflow. We can just pick up the latest artifacts and use them.
However, lets say I run my DEVELOP branch pipeline, and I have done all the necessary scans and builds there. I then create my RELEASE branch from DEVELOP. Because nothing has changed, I would expect that the path-filtering logic would reflect that, and queue the pipeline to use the existing artifacts.
Unfortunately, because of this piece of code found in the set-parameters command in the path-filtering orb:
(Lines 198 - 210)
if head == base:
try:
# If building on the same branch as BASE_REVISION, we will get the
# current commit as merge base. In that case try to go back to the
# first parent, i.e. the last state of this branch before the
# merge, and use that as the base.
base = parent_commit()
except:
# This can fail if this is the first commit of the repo, so that
# HEAD~1 actually doesn't resolve. In this case we can compare
# against this magic SHA below, which is the empty tree. The diff
# to that is just the first commit as patch.
base = '4b825dc642cb6eb9a060e54bf8d69288fbee4904'
that will never happen. Because on the creation of a new branch, "head == base" will always be true, thereby triggering this piece of code to force comparison with the parent commit instead.
The ask here if CircleCI can please parameterize this logic and allow the consumer to pass turn this off when desired. The default logic can stay the same, as to not introduce any breaking changes. This will provide functionality to tweak this logic as needed per workflow.
Describe Request:
We are using the set-parameters command in the path-filtering orb to try to minimize how often have to run certain jobs in our workflow. The idea is that if the code has not changed fundamentally, we can rely on artifacts created, and scans that have been performed in a previous branch.
The issue we are running to is on branch creation. Here is the scenario:
Our path-filtering is set up as follows:
So the idea is if api-changed, service-changed, or version-changed are not set to true, then we don't need to re-run our full build and scan workflow. We can just pick up the latest artifacts and use them.
However, lets say I run my DEVELOP branch pipeline, and I have done all the necessary scans and builds there. I then create my RELEASE branch from DEVELOP. Because nothing has changed, I would expect that the path-filtering logic would reflect that, and queue the pipeline to use the existing artifacts.
Unfortunately, because of this piece of code found in the set-parameters command in the path-filtering orb:
(Lines 198 - 210)
that will never happen. Because on the creation of a new branch, "head == base" will always be true, thereby triggering this piece of code to force comparison with the parent commit instead.
The ask here if CircleCI can please parameterize this logic and allow the consumer to pass turn this off when desired. The default logic can stay the same, as to not introduce any breaking changes. This will provide functionality to tweak this logic as needed per workflow.
Examples:
There's probably a better name for it, but thats kind of the idea
Supporting Documentation Links:
The orb command: https://circleci.com/developer/orbs/orb/circleci/path-filtering#commands-set-parameters
The text was updated successfully, but these errors were encountered: