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

for update-stemcell, only download releases if necessary #493

Merged
merged 2 commits into from
Dec 9, 2024

Conversation

dlinsley
Copy link
Contributor

@dlinsley dlinsley commented Jun 4, 2024

implements #492

  • Only download releases if determining the SHA1 remotely was not possible.
  • Updates artifactory GetMatchedRelease to include remote SHA1 of matched release from remote
  • Updates bosh.io GetMatchedRelease to include remote SHA1 of matched release from remote
  • Other release sources do not appear to support determining the remote SHA1.

@cf-gitbot
Copy link
Member

We have created an issue in Pivotal Tracker to manage this. Unfortunately, the Pivotal Tracker project is private so you may be unable to view the contents of the story.

The labels on this github issue will be updated when the story is started.

@dlinsley dlinsley force-pushed the feat/update-stemcell-without-download branch from db5007c to 81a933d Compare June 5, 2024 18:27
@dlinsley dlinsley changed the title add --without-download to update-stemcell for update-stemcell, only download releases if necessary Jul 1, 2024
@dlinsley dlinsley marked this pull request as ready for review July 1, 2024 17:31
@dlinsley dlinsley requested a review from crhntr July 2, 2024 17:06
@dlinsley dlinsley added ready-for-review tas-slingshots Created by https://github.com/orgs/pivotal-cf/teams/tas-strategic-initiatives-slingshot enhancement and removed unscheduled labels Aug 9, 2024
@dlinsley dlinsley force-pushed the feat/update-stemcell-without-download branch from f694c91 to 10df70e Compare August 21, 2024 20:40
@dlinsley dlinsley force-pushed the feat/update-stemcell-without-download branch 2 times, most recently from 06e88ed to 2d44f25 Compare October 7, 2024 22:38
@dlinsley dlinsley force-pushed the feat/update-stemcell-without-download branch from 2d44f25 to baceadb Compare November 7, 2024 18:12
@dlinsley dlinsley force-pushed the feat/update-stemcell-without-download branch from baceadb to 2c3d769 Compare November 25, 2024 21:35
@dlinsley dlinsley force-pushed the feat/update-stemcell-without-download branch from 2c3d769 to e13a06d Compare December 5, 2024 16:58
@dlinsley dlinsley force-pushed the feat/update-stemcell-without-download branch from e13a06d to bc50af4 Compare December 5, 2024 17:01
Copy link
Member

@drich10 drich10 left a comment

Choose a reason for hiding this comment

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

Change looks good and I agree that defaulting this behavior rather than requiring a flag is correct.

Afaict there isn't a test that verifies the behavior change in update_stemcell.go itself. If I'm right, would you mind adding one?

lock.RemotePath = remote.RemotePath
lock.RemoteSource = remote.RemoteSource
lock.SHA1 = remote.SHA1
if remote.SHA1 == "" || remote.SHA1 == "not-calculated" {
Copy link
Contributor

@crhntr crhntr Dec 5, 2024

Choose a reason for hiding this comment

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

Where is "not-calculated" from? Maybe pull this out into a const and add a note on what emits this value. If there was a test, that would also solve this question.

(It was cool to see the PR review request. I miss y'all. Hope you're all well.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The s3 and github sources can set this as not-calculated particularly when no-download specified.

Copy link
Contributor

@crhntr crhntr left a comment

Choose a reason for hiding this comment

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

I added a comment. I don't recall anything that would break from this change.

This issue from 2021 is kinda related. We only calculate the SHA1 because we used to have a huge s3 bucket that did not have object checksums enabled and adding it would have been super computationally expensive. Funnily, if we had enabled that feature we would have saved thousands of release downloads.

#297

@dlinsley dlinsley force-pushed the feat/update-stemcell-without-download branch from 4e35f80 to f8cd1fc Compare December 5, 2024 22:14
@dlinsley dlinsley requested a review from drich10 December 5, 2024 22:16
@dlinsley
Copy link
Contributor Author

dlinsley commented Dec 9, 2024

Change looks good and I agree that defaulting this behavior rather than requiring a flag is correct.

Afaict there isn't a test that verifies the behavior change in update_stemcell.go itself. If I'm right, would you mind adding one?

The updated tests add a third release to the tile under test that provides sufficient metadata to the update-stemcell method to not downloaded the release. Updated the returned metadata of the existing releases in the tile to explicitly return either empty string or not-calculated to trigger a calls to download the releases.

Copy link
Member

@drich10 drich10 left a comment

Choose a reason for hiding this comment

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

Appreciate the updates and work! Approving and merging 🙏

@drich10 drich10 merged commit 05449cb into main Dec 9, 2024
3 checks passed
@drich10 drich10 deleted the feat/update-stemcell-without-download branch December 9, 2024 20:59
@rizwanreza
Copy link
Member

This broke our pipelines. It is not downloading the releases in our compilation manager.

I am going to revert this PR and re-release kiln.

@rizwanreza rizwanreza restored the feat/update-stemcell-without-download branch January 9, 2025 20:10
@dlinsley
Copy link
Contributor Author

dlinsley commented Jan 9, 2025

Sorry about that, didn't realize the download was desired for this command, may put this behind a --no-download flag instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ready-for-review tas-slingshots Created by https://github.com/orgs/pivotal-cf/teams/tas-strategic-initiatives-slingshot
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants