Repository navigation
[build] fetch the changelog history since the previous release tag instead of computing a depth #18044
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
Merged
Merged
[build] fetch the changelog history since the previous release tag instead of computing a depth #18044
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
9567ce5
[build] fetch the changelog history since the previous release tag in…
titusfortner 6cdbfbf
[build] drop narrating comments from the release fetch scripts
titusfortner 77cc023
[build] pass full language names to update_changelog so patch release…
titusfortner 08f5bb0
[build] create the release-line tag refs from ls-remote so fetching t…
titusfortner f41d1ed
[build] move the release history fetch into a script called from the …
titusfortner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| #!/usr/bin/env bash | ||
| # Deepen a shallow checkout back through the release before the given one and fetch the tags the | ||
| # changelog tasks look up. Takes the release tag being prepared, e.g. selenium-4.51.0 or selenium-4.51.2-python. | ||
| set -euo pipefail | ||
|
|
||
| release="${1:?release tag required}" | ||
| head="$(git rev-parse HEAD)" | ||
|
|
||
| IFS=.- read -r _ major minor patch language <<< "$release" | ||
|
|
||
| # Determine the previous release tag to compare against depending on tag pattern | ||
|
titusfortner marked this conversation as resolved.
|
||
| if [ "$patch" -gt 1 ]; then previous_release="selenium-${major}.${minor}.$((patch-1))-${language}" | ||
| elif [ "$patch" -eq 1 ]; then previous_release="selenium-${major}.${minor}.0" | ||
| elif [ "$minor" -gt 0 ]; then previous_release="selenium-${major}.$((minor-1)).0" | ||
| else previous_release="$(git ls-remote --tags --refs origin "selenium-$((major-1)).*" | awk -F/ '{print $NF}' | grep -E '^selenium-[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -1)" | ||
|
titusfortner marked this conversation as resolved.
|
||
| fi | ||
|
|
||
| # Fetch history backward from HEAD to the previous release tag | ||
| git fetch --no-tags --shallow-exclude="$previous_release" origin "$head" | ||
|
|
||
| # Make the previous release commit available for symmetric difference commands (`<tag>...HEAD`). | ||
| git fetch --no-tags --deepen=1 origin "$head" | ||
|
|
||
| # Determine which tags the changelog generator needs. | ||
| # Minor: get any patch release tags of the previous minor line | ||
| # Patch: only needs the previous release tag. | ||
| if [ "$patch" -eq 0 ]; then pattern="${previous_release%.*}.*"; else pattern="$previous_release"; fi | ||
|
|
||
| # Label tags locally without fetching additional/unnecessary data. | ||
| git fetch --no-tags origin "+refs/tags/${pattern}:refs/tags/${pattern}" | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.