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

Elide version.txt sync when merging develop into nightly #80

Merged
merged 1 commit into from
Oct 23, 2024

Conversation

synecdoche
Copy link
Contributor

Description

Before merging develop into nightly, sync version.txt with develop to avoid a merge conflict; afterward, remove this sync commit.

The reason for removing the commit afterward is that we run update-version.sh, which rewrites the file as necessary. Since nightly merges from both jdk21u and jdk21-dev, but develop only merges from jdk21u, version.txt may be newer in nightly. If we sync version.txt with develop and don't remove it, as we do currently, we avoid the merge conflict, but then update-version.sh (which we treat as authoritative) overwrites version.txt, and we have the two mechanisms writing two new commits each time the action is run.

Motivation and context

The goal is to avoid merge conflicts in version.txt during automated merges between upstream repos and various branches. However, this proves to be slightly complex due to the flow of the code. The current technique of simply copying version.txt from develop into nightly can result in an incorrect version of the file being written, which is later corrected by update-version.sh. There may be a cleaner way to avoid the merge conflict than simply copying the file, writing a (possibly empty) commit, doing the merge, and then removing the commit with a rebase before pushing it. If you know of one, please suggest it.

How has this been tested?

Tested in a forked repo, as well as on the command line.

avoid a merge conflict; afterward, remove this sync commit.

The reason for removing the commit afterward is that we run
`update-version.sh`, which rewrites the file as necessary. Since
`nightly` merges from both `jdk21u` and `jdk21-dev`, but `develop`
only merges from jdk21u, version.txt may be newer in `nightly`. If we
sync `version.txt` with `develop` and don't remove it, as we do
currently, we avoid the merge conflict, but then `update-version.sh`
(which we treat as authoritative) overwrites `version.txt`, and we
have the two mechanisms writing two new commits each time the action
is run.
@synecdoche synecdoche merged commit fb5f36d into corretto:develop Oct 23, 2024
76 checks passed
github-actions bot pushed a commit that referenced this pull request Oct 24, 2024
…to (#80)

avoid a merge conflict; afterward, remove this sync commit.

The reason for removing the commit afterward is that we run
`update-version.sh`, which rewrites the file as necessary. Since
`nightly` merges from both `jdk21u` and `jdk21-dev`, but `develop`
only merges from jdk21u, version.txt may be newer in `nightly`. If we
sync `version.txt` with `develop` and don't remove it, as we do
currently, we avoid the merge conflict, but then `update-version.sh`
(which we treat as authoritative) overwrites `version.txt`, and we
have the two mechanisms writing two new commits each time the action
is run.
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