Skip to content

Bug: Job reattempt failed because artifact was published twice#69

Merged
alejandro-microsoft merged 5 commits into
mainfrom
alejandroma/quick-fix
Jul 30, 2025
Merged

Bug: Job reattempt failed because artifact was published twice#69
alejandro-microsoft merged 5 commits into
mainfrom
alejandroma/quick-fix

Conversation

@alejandro-microsoft
Copy link
Copy Markdown
Contributor

@alejandro-microsoft alejandro-microsoft commented Jul 30, 2025

🔍 Description

Change the artifact name on DeleteCosiFromAcr according to the number of job attempts.

🤔 Rationale

We can rerun the same job without worrying on the published artifact, as we can't publish to artifacts with the same name in the same pipeline run.

Note: Preferred solution would be to not publish anything at all here but seems one branch always attempts to publish an artifact if the job was successful.

📝 Checks

Multiple reruns of the stage: https://dev.azure.com/mariner-org/ECF/_build/results?buildId=885247&view=results

@alejandro-microsoft alejandro-microsoft requested a review from a team as a code owner July 30, 2025 00:58
@bfjelds
Copy link
Copy Markdown
Member

bfjelds commented Jul 30, 2025

why is delete running on rerun? other successful stages don't rerun.

this change is fine, but i think we are solving the wrong problem. i would suggest moving condition: always() from the stage to the task. maybe do this as well as what you have here?

@alejandro-microsoft
Copy link
Copy Markdown
Contributor Author

alejandro-microsoft commented Jul 30, 2025

@bfjelds

why is delete running on rerun? other successful stages don't rerun.

this change is fine, but i think we are solving the wrong problem. i would suggest moving condition: always() from the stage to the task. maybe do this as well as what you have here?

I agree this is a patch in the meanwhile.

Not sure if the focus should be on the run condition as, for example, if the pipeline fails the related test (misc), it could be because of the produced image or because an unrelated issue (like connection issues). In the former we want to run the delete and in the latter we don't so we can rerun the test (and still access the image). It would be too difficult to know which of the two cases happened.

In my opinion the solution would be to push and delete in the same job as the test, so everything is run and rerun together. I believe that @ayaegashi is working on a PR to remove the stage all together.

@alejandro-microsoft alejandro-microsoft merged commit affb0eb into main Jul 30, 2025
21 of 24 checks passed
alejandro-microsoft added a commit that referenced this pull request Aug 4, 2025
* Fix dependencies

* Remove publish directory to avoid publishing same artifact on reruns

* Change artifact name based on Job attempt
@alejandro-microsoft alejandro-microsoft deleted the alejandroma/quick-fix branch September 24, 2025 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants