-
Notifications
You must be signed in to change notification settings - Fork 8.9k
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
[Test] Reduce index branch size by squashing all commits #25712
Conversation
Signed-off-by: Jota Martos <jotamartos@vmware.com>
Signed-off-by: Jota Martos <jotamartos@vmware.com>
Signed-off-by: Jota Martos <jotamartos@vmware.com>
Signed-off-by: Jota Martos <jotamartos@vmware.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: Jota Martos <jotamartos@vmware.com>
Signed-off-by: Jota Martos <jotamartos@vmware.com>
# Configure AWS account | ||
export $(printf "AWS_ACCESS_KEY_ID=%s AWS_SECRET_ACCESS_KEY=%s AWS_SESSION_TOKEN=%s" $(aws sts assume-role --role-arn ${AWS_ASSUME_ROLE_ARN} --role-session-name GitHubIndex --query "Credentials.[AccessKeyId,SecretAccessKey,SessionToken]" --output text)) | ||
aws s3 cp --follow-symlinks bitnami/index.yaml s3://${{ secrets.AWS_S3_BUCKET }}/bitnami/ | ||
aws s3 cp --follow-symlinks bitnami/index.html s3://${{ secrets.AWS_S3_BUCKET }}/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do not need to check when to run this because we are pushing to the index branch safely.
.github/workflows/cd-pipeline.yml
Outdated
git fetch origin index | ||
git reset --hard origin/index | ||
current_commit_id=$(git rev-parse origin/index) | ||
git reset --hard $(git commit-tree origin/index^{tree} -m "Update index.yaml") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This command gets the commits from remote and squash them.
.github/workflows/cd-pipeline.yml
Outdated
git add bitnami/index.yaml && git commit -m "${chart_name}-${chart_version}: Update index.yaml" -s | ||
git push && is_index_updated=1 || echo "Failed to push during attempt $attempts" | ||
git add bitnami/index.yaml && git commit --signoff --amend --no-edit | ||
git push --force-with-lease=index:${current_commit_id} && is_index_updated=1 || echo "Failed to push during attempt $attempts" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are checking here that we are not pushing to remote if it changed during the execution of this job
yq eval '.entries[][].urls[]' indexes/last_index.yaml |sort| uniq > last_index_urls | ||
yq eval '.entries[][].urls[]' archive-full-index/index.yaml | sort| uniq > index_urls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Paths were updated
@@ -0,0 +1,123 @@ | |||
name: '[Index] Generate the full bitnami/charts index.yaml' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a copy of the workflows in the index branch
Signed-off-by: Jota Martos <jotamartos@vmware.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: Jota Martos <jotamartos@vmware.com>
Signed-off-by: Jota Martos <jotamartos@vmware.com>
* Reduce index branch size by squashing all commits Signed-off-by: Jota Martos <jotamartos@vmware.com> * Remove extra git reset line Signed-off-by: Jota Martos <jotamartos@vmware.com> * Add --signoff Signed-off-by: Jota Martos <jotamartos@vmware.com> * Ensure remote has not changed before pushing changes Signed-off-by: Jota Martos <jotamartos@vmware.com> * Move index branch workflows to main Signed-off-by: Jota Martos <jotamartos@vmware.com> * Fix file paths in archive-full-index.yaml Signed-off-by: Jota Martos <jotamartos@vmware.com> * Add temporary code to not test the changes Signed-off-by: Jota Martos <jotamartos@vmware.com> * Fix typo Signed-off-by: Jota Martos <jotamartos@vmware.com> --------- Signed-off-by: Jota Martos <jotamartos@vmware.com> Signed-off-by: Tobias Schneeberger <tobias.schneeberger@bernmobil.ch>
Signed-off-by: Jota Martos <jotamartos@vmware.com> Signed-off-by: Tobias Schneeberger <tobias.schneeberger@bernmobil.ch>
Description of the change
These changes squash all commits in the branch every time the job is executed
Benefits
Repo size is reduced
Possible drawbacks
None AFAIK
Applicable issues
Additional information
Related to #25730
Checklist
Chart.yaml
according to semver. This is not necessary when the changes only affect README.md files.README.md
using readme-generator-for-helm