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

[Test] Reduce index branch size by squashing all commits #25712

Merged
merged 8 commits into from May 15, 2024

Conversation

jotamartos
Copy link
Contributor

@jotamartos jotamartos commented May 13, 2024

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

  • [Na] Chart version bumped in Chart.yaml according to semver. This is not necessary when the changes only affect README.md files.
  • [NA] Variables are documented in the values.yaml and added to the README.md using readme-generator-for-helm
  • [NA] Title of the pull request follows this pattern [bitnami/<name_of_the_chart>] Descriptive title
  • All commits signed off and in agreement of Developer Certificate of Origin (DCO)

Signed-off-by: Jota Martos <jotamartos@vmware.com>
@bitnami-bot bitnami-bot added the verify Execute verification workflow for these changes label May 13, 2024
@github-actions github-actions bot requested a review from andresbono May 13, 2024 11:42
Signed-off-by: Jota Martos <jotamartos@vmware.com>
Signed-off-by: Jota Martos <jotamartos@vmware.com>
Signed-off-by: Jota Martos <jotamartos@vmware.com>
fmulero
fmulero previously approved these changes May 14, 2024
Copy link
Collaborator

@fmulero fmulero left a 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>
Comment on lines +21 to +24
# 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 }}/
Copy link
Contributor Author

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.

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")
Copy link
Contributor Author

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.

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"
Copy link
Contributor Author

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

Comment on lines +91 to +92
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
Copy link
Contributor Author

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'
Copy link
Contributor Author

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

carrodher
carrodher previously approved these changes May 14, 2024
Signed-off-by: Jota Martos <jotamartos@vmware.com>
Signed-off-by: Jota Martos <jotamartos@vmware.com>
Copy link
Collaborator

@fmulero fmulero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jotamartos jotamartos merged commit c137430 into main May 15, 2024
8 checks passed
@jotamartos jotamartos deleted the reduce-size-branches branch May 15, 2024 07:57
jotamartos added a commit that referenced this pull request May 15, 2024
Signed-off-by: Jota Martos <jotamartos@vmware.com>
jotamartos added a commit that referenced this pull request May 15, 2024
Signed-off-by: Jota Martos <jotamartos@vmware.com>
jotamartos added a commit that referenced this pull request May 15, 2024
Signed-off-by: Jota Martos <jotamartos@vmware.com>
jotamartos added a commit that referenced this pull request May 15, 2024
Signed-off-by: Jota Martos <jotamartos@vmware.com>
@jotamartos jotamartos changed the title Reduce index branch size by squashing all commits [Test] Reduce index branch size by squashing all commits May 15, 2024
toobster pushed a commit to toobster/charts that referenced this pull request May 15, 2024
* 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>
toobster pushed a commit to toobster/charts that referenced this pull request May 15, 2024
Signed-off-by: Jota Martos <jotamartos@vmware.com>
Signed-off-by: Tobias Schneeberger <tobias.schneeberger@bernmobil.ch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bitnami solved verify Execute verification workflow for these changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants