mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-05-17 18:25:26 +00:00
Merge pull request #4548 from KnVerey/improve-logs
Improve logging for changelong builder
This commit is contained in:
@@ -118,7 +118,13 @@ refreshMaster &&
|
||||
testKustomizeRepo
|
||||
```
|
||||
|
||||
While you're waiting for the tests, review the commit log. Based on the changes to be included in this release, decide whether a patch, minor or major version bump is needed: [semver review].
|
||||
While you're waiting for the tests, review the commit log:
|
||||
|
||||
```
|
||||
releasing/compile-changelog.sh kyaml HEAD
|
||||
```
|
||||
|
||||
Based on the changes to be included in this release, decide whether a patch, minor or major version bump is needed: [semver review].
|
||||
|
||||
kyaml has no intra-repo deps, so if the tests pass,
|
||||
it can just be released.
|
||||
@@ -185,7 +191,13 @@ refreshMaster &&
|
||||
testKustomizeRepo
|
||||
```
|
||||
|
||||
While you're waiting for the tests, review the commit log. Based on the changes to be included in this release, decide whether a patch, minor or major version bump is needed: [semver review].
|
||||
While you're waiting for the tests, review the commit log:
|
||||
|
||||
```
|
||||
releasing/compile-changelog.sh cmd/config HEAD
|
||||
```
|
||||
|
||||
Based on the changes to be included in this release, decide whether a patch, minor or major version bump is needed: [semver review].
|
||||
|
||||
#### Release it
|
||||
|
||||
@@ -243,7 +255,13 @@ refreshMaster &&
|
||||
testKustomizeRepo
|
||||
```
|
||||
|
||||
While you're waiting for the tests, review the commit log. Based on the changes to be included in this release, decide whether a patch, minor or major version bump is needed: [semver review].
|
||||
While you're waiting for the tests, review the commit log:
|
||||
|
||||
```
|
||||
releasing/compile-changelog.sh api HEAD
|
||||
```
|
||||
|
||||
Based on the changes to be included in this release, decide whether a patch, minor or major version bump is needed: [semver review].
|
||||
|
||||
#### Release it
|
||||
|
||||
@@ -298,7 +316,13 @@ refreshMaster &&
|
||||
testKustomizeRepo
|
||||
```
|
||||
|
||||
While you're waiting for the tests, review the commit log. Based on the changes to be included in this release, decide whether a patch, minor or major version bump is needed: [semver review].
|
||||
While you're waiting for the tests, review the commit log:
|
||||
|
||||
```
|
||||
releasing/compile-changelog.sh kustomize HEAD
|
||||
```
|
||||
|
||||
Based on the changes to be included in this release, decide whether a patch, minor or major version bump is needed: [semver review].
|
||||
|
||||
#### Release it
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
if [[ -z "${1-}" ]] || [[ -z "${2-}" ]] || [[ -z "${3-}" ]]; then
|
||||
if [[ -z "${1-}" ]] || [[ -z "${2-}" ]]; then
|
||||
echo "Usage: $0 <module> <fullTag> <changeLogFile>"
|
||||
echo "Example: $0 kyaml kyaml/v0.13.4 changelog.txt"
|
||||
exit 1
|
||||
@@ -26,16 +26,19 @@ fi
|
||||
|
||||
module=$1
|
||||
fullTag=$2
|
||||
changeLogFile=$3
|
||||
changeLogFile="${3:-}"
|
||||
|
||||
# Find previous tag that matches the tags module
|
||||
prevTag=$(git tag -l "$module*" --sort=-version:refname --no-contains="$fullTag" | head -n 1)
|
||||
echo "Compiling $module changes from $prevTag to $fullTag"
|
||||
|
||||
commits=( $(git log "$prevTag".."$fullTag" \
|
||||
--pretty=format:'%H' \
|
||||
--abbrev-commit --no-decorate --no-color --no-merges \
|
||||
-- "$module") )
|
||||
|
||||
echo "Gathering PRs for commits: ${commits[*]}"
|
||||
|
||||
# There is a 256 character limit on the query parameter for the GitHub API, so split into batches then deduplicate results
|
||||
batchSize=5
|
||||
results=""
|
||||
@@ -45,9 +48,17 @@ do
|
||||
if newResults=$(curl -sSL "https://api.github.com/search/issues?q=$commitList+repo%3Akubernetes-sigs%2Fkustomize" | jq -r '[ .items[] | { number, title } ]'); then
|
||||
results=$(echo "$results" "$newResults" | jq -s '.[0] + .[1] | unique')
|
||||
else
|
||||
echo "Failed to fetch results for commits: $commitList"
|
||||
echo "Failed to fetch results for commits (exit code $?): $commitList"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
echo "${results}" | jq -r '.[] | select( .title | startswith("Back to development mode") | not) | "#\(.number): \(.title)" ' > "$changeLogFile"
|
||||
changelog=$(echo "${results}" | jq -r '.[] | select( .title | startswith("Back to development mode") | not) | "#\(.number): \(.title)" ')
|
||||
|
||||
if [[ -n "$changeLogFile" ]]; then
|
||||
echo "$changelog" > "$changeLogFile"
|
||||
else
|
||||
echo
|
||||
echo "----CHANGE LOG----"
|
||||
echo "$changelog"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user