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

ci-automation: Follow-up fix for 2-phase nightly SDK build tags #799

Merged
merged 2 commits into from
Sep 29, 2023

Conversation

krnowak
Copy link
Member

@krnowak krnowak commented May 8, 2023

We push a commit with the nightly SDK tag to the main branch if the SDK was built from the main branch. Which is what happens when we build the nightly intermediate SDK. The final nightly SDK is not built from the main branch, but rather from the nightly intermediate SDK tag. Both of them point to the exactly same commit, but the difference is in what git rev-parse --abbrev-ref HEAD returns for each of those. When the main branch is checked out, the command will return "main". When the nightly intermediate SDK tag is checked out, the command will return "HEAD". So when nightly final SDK is being built, the command returns a string different than "main" and thus decides not to push the commit with the final nightly SDK tag to the main branch. Rework it to assume that if git rev-parse HEAD and git rev-parse main return the same commit hash (and it's the nightly build and all that) then the commit should be pushed.

@krnowak krnowak added the main label May 8, 2023
@krnowak krnowak requested a review from a team May 8, 2023 08:39
@dongsupark
Copy link
Member

As GitHub Actions cannot run SDK builds yet, can you please start Jenkins SDK builds?

@github-actions
Copy link

github-actions bot commented May 8, 2023

@krnowak
Copy link
Member Author

krnowak commented May 8, 2023

I discussed this with Thilo and will introduce a two-phase build flag to nightly builds job, so I can run it manually instead of waiting for Friday.

@dongsupark
Copy link
Member

Moved to backlog

We push a commit with the nightly SDK tag to the main branch if the
SDK was built from the main branch. Which is what happens when we
build the nightly intermediate SDK. The final nightly SDK is not built
from the main branch, but rather from the nightly intermediate SDK
tag. Both of them point to the exactly same commit, but the difference
is in what `git rev-parse --abbrev-ref HEAD` returns for each of
those. When the main branch is checked out, the command will return
"main". When the nightly intermediate SDK tag is checked out, the
command will return "HEAD". So when nightly final SDK is being built,
the command returns a string different than "main" and thus decides
not to push the commit with the final nightly SDK tag to the main
branch. Rework it to assume that if `git rev-parse HEAD` and `git
rev-parse origin/main` return the same commit hash (and it's the
nightly build and all that) then the commit should be pushed.

We use "origin/main" instead of just "main" just in case the main
branch was not checked out before, for some reason (may come up in
testing with different names for the main branch when testing).
Changing the name of the main branch and the name of the nightly tag
may be useful for testing, so let's have them defined in one place.
@krnowak
Copy link
Member Author

krnowak commented Sep 28, 2023

Tested it with my branch krnowak/fake-main (where I actually skip building stuff and focus on the tagging issue) and with some jenkins modifications to avoid running irrelevant jobs.

See: http://jenkins.infra.kinvolk.io:8080/job/container/job/nightly/429/cldsv/

@krnowak krnowak requested review from a team and removed request for a team September 28, 2023 15:33
@krnowak krnowak merged commit 0c96ff6 into main Sep 29, 2023
1 check failed
pothos added a commit that referenced this pull request Oct 5, 2023
ci-automation: Follow-up fix for 2-phase nightly SDK build tags
pothos added a commit that referenced this pull request Oct 5, 2023
ci-automation: Follow-up fix for 2-phase nightly SDK build tags
pothos added a commit that referenced this pull request Oct 5, 2023
ci-automation: Follow-up fix for 2-phase nightly SDK build tags
pothos added a commit that referenced this pull request Oct 5, 2023
ci-automation: Follow-up fix for 2-phase nightly SDK build tags
@pothos
Copy link
Member

pothos commented Oct 5, 2023

Backported to all branches

pothos added a commit to flatcar/flatcar-build-scripts that referenced this pull request Oct 5, 2023
The tagging function was changed in the scripts repo with
flatcar/scripts#799 (not on all branches but
this is solved now) and since the tag-release script uses it we also
have to adjust the function call here.
@krnowak krnowak deleted the krnowak/more-2-phase-tag-fixes branch October 11, 2023 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants