-
-
Notifications
You must be signed in to change notification settings - Fork 113
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
If branches diverge, the first target is marked as CHANGED and this causes dependent targets be executed.
Expected Behavior
I expect diverged branches NOT to subtly mark the target as CHANGED; unless there are actual changes, dependent targets should be skipped.
Steps To Reproduce
For a repro, I created a repo for managing a container image (say a Dockerfile) which is then tagged by a version.txt file.
I wrote a pipeline to automatically update the dependencies and if anything has changed, automatically bump my image's version tag (version.txt).
For that I have 3 sources:
latest_busybox_tagwhich is the dependency itselfthis_tagwhich is the current version in version.txtnext_tagwhich is the next version (if necessary) through `semverinc: 'patch``
Then I have two targets:
update_busybox_versionwhich will update theDockerfilewith the newest versionbump_versionwhichdependson:"update_busybox_version:or"
What happens is that if the dependency is updated manually (i.e. IF the following happens):
a) there is already a branch (e.g. due to a previous PR) for such pipeline, i.e. updatecli_<main_branch>_<pipelineid>, and
b) the <main_branch> has evolved
c) there is no new version of the dependency available
Then updatecli will internally mark latest_busybox_tag as CHANGED, and therefore execute bump_version with a new, unwanted version tag.
This run shows the following output:
update_busybox_version
----------------------
WARNING: branch "refs/heads/updatecli_main_image_contents" diverged from "refs/heads/main", resetting it to "refs/heads/main"
✔ - all contents from 'file' and 'files' combined already up to date
⚠ While nothing change in the current pipeline run, according to the git history, some commits must be pushed
^^^^^^^^^^^
Notice how this does not get reflected in the summary as update_busybox_version shows as SUCCESS:
Target:
⚠ [bump_version] Bump image version to 0.0.3
✔ [update_busybox_version] Update busybox version
In my repro this results in the PR being updated (through force-push) with an unneeded bump, but in the production environment this results in the PR being automatically closed and a new one being opened, for reasons which I have not yet been able to identify (and which is probably a separate issue).
Environment
- OS:
- updatecli:Anything else?
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Status