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: compressed changelogs by minor version #6854

Closed
wants to merge 1 commit into from

Conversation

gunnar-solo
Copy link
Contributor

@gunnar-solo gunnar-solo commented Aug 3, 2022

Since that is "a lot" of change files, this might be an easier view:

Screen Shot 2022-08-03 at 3 38 34 PM

changelog/squash-changelog.sh

#!/bin/bash -e
CURRENT_MAJOR_VERSION=1         # major semvar version of supported product
CURRENT_MINOR_VERSION=13        # minor semvar version of supported product
SUPPORTED_VERSIONS=4            # how many versions of product are in active support
LEGACY_CODE_FOLDER="_legacy"    # intended destination of legacy changelogs

for folder in v*.*.*; do
    folder="${folder#?}"
    semver=( ${folder//./ } )
    major="${semver[0]}"
    minor="${semver[1]}"

    # active version, supported version, legacy version
    if   [ $CURRENT_MAJOR_VERSION = $major ] && [ $CURRENT_MINOR_VERSION = $minor ]; then
        continue
    elif [ $CURRENT_MAJOR_VERSION = $major ] && [ $(($minor+$SUPPORTED_VERSIONS+1)) -gt $CURRENT_MINOR_VERSION ]; then
        dst="$major.$minor"
    else
        dst="$LEGACY_CODE_FOLDER/$major.$minor"
    fi

    mkdir -p $dst
    mv "v$folder" $dst
done

@github-actions github-actions bot added the keep pr updated signals bulldozer to keep pr up to date with base branch label Aug 3, 2022
@jbohanon
Copy link
Contributor

jbohanon commented Aug 3, 2022

relevant: solo-io/go-utils#492

@gunnar-solo gunnar-solo force-pushed the changelog-compression branch from 7f260f8 to 8249150 Compare August 3, 2022 19:37
@gunnar-solo gunnar-solo force-pushed the changelog-compression branch from 8249150 to 11c2cc6 Compare August 3, 2022 19:39
@gunnar-solo
Copy link
Contributor Author

gunnar-solo commented Aug 3, 2022

/skip-changelog

(needed because more than 300 files have been changed)

@gunnar-solo gunnar-solo marked this pull request as ready for review August 3, 2022 19:41
@nfuden
Copy link
Contributor

nfuden commented Aug 3, 2022

How would you feel about having a seperate pr for the script and for the changelogs.

Can we change the output folder to _archive?

Should the script be in the hack folder?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
keep pr updated signals bulldozer to keep pr up to date with base branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants