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

Adjust release scripts to work with scripts as monorepo #141

Merged
merged 1 commit into from
Apr 6, 2023

Conversation

pothos
Copy link
Member

@pothos pothos commented Apr 5, 2023

The change prepared in flatcar/scripts#699 means that we don't use the coreos-overlay/portage-stable repos anymore.
Skip these repositories and the submodule handling, too. Leave existing logic there to support doing releases the old way (at least for the nearer future).

How to use

Merge before trying to do a release. Also required for proper output in the image-changes job.

Testing done

  • Make a new branch with change on top of the current PR (use the mirror script for that even if it's easy to do manually) ./mirror-repos-branch t-lo/merge-submodules-to-paths kai/t-lo/merge-submodules-to-paths
  • Then tag this with the release script SCRIPTS_REF=origin/kai/t-lo/merge-submodules-to-paths SDK_VERSION=1.2.3 VERSION=1.2.3 CHANNEL=main ./tag-release (see diff needed below)
  • and run the show-changes script as flatcar-build-scripts/show-changes origin/t-lo/merge-submodules-to-paths main-1.2.3, FETCH=0 flatcar-build-scripts/show-changes alpha-3549.0.0 main-1.2.3, and FETCH=0 flatcar-build-scripts/show-changes beta-3510.1.0 alpha-3549.0.0 (to test for regressions)

Local test diff for tag-release was

diff --git a/tag-release b/tag-release
index aca1bcf..e105c98 100755
--- a/tag-release
+++ b/tag-release
@@ -26,6 +26,9 @@ if [ "$CHANNEL" = lts ] && [ "$MAJOR" = "2605" ]; then
   MAINT="flatcar-lts"
 fi
 
+MAINT="kai/t"
+MAJOR="lo/merge-submodules-to-paths"
+
 SCRIPTS_REF="${SCRIPTS_REF-origin/$MAINT-$MAJOR}"
 OVERLAY_REF="${OVERLAY_REF-origin/$MAINT-$MAJOR}"
 PORTAGE_REF="${PORTAGE_REF-origin/$MAINT-$MAJOR}"

mirror-repos-branch Outdated Show resolved Hide resolved
tag-release Outdated Show resolved Hide resolved
tag-release Outdated Show resolved Hide resolved
@pothos pothos force-pushed the kai/monorepo branch 9 times, most recently from 60804bd to f39d78b Compare April 5, 2023 10:20
@pothos
Copy link
Member Author

pothos commented Apr 5, 2023

A problem is that for the next round of releases we would have to run it manually twice, one from the old release tag to the last commit ID before the switchover, then for the new commit ID after the switchover to the release tag.

Or we could run hardcode the commit IDs from before and after the switch and handle this case explicitly by running the git diff twice. Instead of hardcoding it could work to use git log to find the appearance or disappearance commit of something related to the switch.

@pothos
Copy link
Member Author

pothos commented Apr 5, 2023

New alternative, wait for the next round of releases to happen for all channels.

@pothos
Copy link
Member Author

pothos commented Apr 6, 2023

A problem is that for the next round of releases we would have to run it manually twice, one from the old release tag to the last commit ID before the switchover, then for the new commit ID after the switchover to the release tag.

Instead of hardcoding it could work to use git log to find the appearance or disappearance commit of something related to the switch.

This is implemented now.

@pothos pothos requested review from a team and krnowak April 6, 2023 05:53
mirror-repos-branch Show resolved Hide resolved
show-changes Show resolved Hide resolved
show-changes Show resolved Hide resolved
show-changes Show resolved Hide resolved
git -C "${REPOPATH}" difftool --no-prompt --extcmd='sh -c "cat \"$REMOTE\"" --' "${OLDREF}..${NEWREF}" -- "changelog/${section}/" | sort || { echo "Error: git difftool failed" ; exit 1 ; }

# The assumption is that the old ref is really older, so we can assume that old would have submodules while new doesn't have them anymore
if [ "${OLDREPOPATH}" != "${NEWREPOPATH}" ] && [ "${NEWREPOPATH}" = "scripts" ]; then
Copy link
Member

Choose a reason for hiding this comment

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

I'm wondering if this handling will actually be needed, because we plan the next releases to use the submodules for both old and new releases, then we switch to merged scripts by retagging the newest release. So after that we are going to have both old and new release using merged scripts.

Also, I'm thinking that with merged scripts repos, we will abandon the changelog directories in sdk_container/src/third_party/<repo> in favor of using the toplevel one, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it's good to be able to diff releases instead of having a had break.

Yes, future entries can directly go to /changelog/ in scripts but the old ones should stay there.

Copy link
Member Author

Choose a reason for hiding this comment

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

Having this also is an alternative to doing the retag, which I think it more elegant - specially when there are follow-up fixes needed to get the build working and other changes also start to slip in.

The change prepared in flatcar/scripts#699
means that we don't use the coreos-overlay/portage-stable repos
anymore.
Skip these repositories and the submodule handling, too. Leave existing
logic there to support doing releases the old way (at least for the
nearer future).
@pothos pothos merged commit 79ead6c into master Apr 6, 2023
@pothos pothos deleted the kai/monorepo branch April 6, 2023 07: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