Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get artifacts for version 'latest' from the last successful CICD run on the corresponding branch #802

Merged
merged 40 commits into from
Nov 17, 2023

Conversation

mazhelez
Copy link
Collaborator

@mazhelez mazhelez commented Nov 3, 2023

Issues: Currently, the artifacts are fetched through the artifacts API, which means that for version 'latest' some artifacts may be picked from the latest CICD run that succeeded partially, while others — from a previous CICD run that succeeded. This could lead to a lot of issues for both incremental builds (PR builds) and releasing 'latest' version.

Solution:
When getting artifacts via GetArtifacts, use only artifacts from the latest successful CICD run when the version is 'latest'.
CICD is considered successful if the build jobs succeeded.

Note: GitHub API returns the workflow runs ordered by created_date in descending order.

Actions/Github-Helper.psm1 Fixed Show fixed Hide fixed
Actions/Github-Helper.psm1 Fixed Show fixed Hide fixed
@mazhelez mazhelez changed the title Use GitHub workflow API to get artifacts in GetArtifacts Use GitHub workflow runs API to get artifacts in GetArtifacts Nov 3, 2023
@mazhelez mazhelez marked this pull request as ready for review November 6, 2023 15:22
@mazhelez mazhelez requested a review from a team as a code owner November 6, 2023 15:22
Copy link
Collaborator

@aholstrup1 aholstrup1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall I think 👍
In the future.. I wonder if we should investigate publishing CI/CD artifacts to GitHub packages instead. I'm guessing finding artifacts for 'latest' or for 'specific version' would be significantly easier if the artifacts are in a nuget feed.

Actions/Github-Helper.psm1 Outdated Show resolved Hide resolved
Actions/Github-Helper.psm1 Outdated Show resolved Hide resolved
Actions/Github-Helper.psm1 Outdated Show resolved Hide resolved
Actions/Github-Helper.psm1 Outdated Show resolved Hide resolved
Actions/Github-Helper.psm1 Outdated Show resolved Hide resolved
@mazhelez mazhelez changed the title Use GitHub workflow runs API to get artifacts in GetArtifacts Use GitHub workflow runs API to get artifacts in GetArtifacts when version is 'latest' Nov 8, 2023
Actions/Github-Helper.psm1 Show resolved Hide resolved
Actions/Github-Helper.psm1 Outdated Show resolved Hide resolved
@mazhelez mazhelez changed the title Use GitHub workflow runs API to get artifacts in GetArtifacts when version is 'latest' Get artifacts for version 'latest' from the last successful CICD run on the corresponding branch Nov 14, 2023
Actions/Github-Helper.psm1 Fixed Show fixed Hide fixed
@mazhelez mazhelez enabled auto-merge (squash) November 15, 2023 21:49
@mazhelez mazhelez merged commit 3924697 into microsoft:main Nov 17, 2023
4 checks passed
@mazhelez mazhelez deleted the fix-getdependencies branch November 17, 2023 15:15
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.

4 participants