Skip to content

fix: al2 uploads need to have function name in SHA #509

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

Merged
merged 3 commits into from
Oct 30, 2023

Conversation

Skn0tt
Copy link
Contributor

@Skn0tt Skn0tt commented Oct 27, 2023

There's a detailed writeup of why this is necessary in https://linear.app/netlify/issue/COM-95/bug-what-happens-when-we-upload-two-functions-with-the-exact-identical.

In short: Netlify requires two different functions to have separate hashsums. Before, this was the case because every ZIP contained the function name as the entrypoint filename. With the changes in #505, this will now always be bootstrap, so it doesn't effect the hashsum anymore. By adding the filename as a comment, we get back this behaviour.

@Skn0tt Skn0tt requested a review from JGAntunes October 27, 2023 08:37
@Skn0tt Skn0tt self-assigned this Oct 27, 2023
@Skn0tt Skn0tt requested a review from a team as a code owner October 27, 2023 08:37
@netlify
Copy link

netlify bot commented Oct 27, 2023

Deploy Preview for open-api ready!

Name Link
🔨 Latest commit 418eb97
🔍 Latest deploy log https://app.netlify.com/sites/open-api/deploys/653f9623a4633200083f70cb
😎 Deploy Preview https://deploy-preview-509--open-api.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

kitop
kitop previously approved these changes Oct 27, 2023
Copy link
Contributor

@kitop kitop left a comment

Choose a reason for hiding this comment

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

Nice one!

@@ -979,6 +979,7 @@ func createHeader(archive *zip.Writer, i os.FileInfo, runtime string) (io.Writer
return archive.CreateHeader(&zip.FileHeader{
CreatorVersion: 3 << 8, // indicates Unix
ExternalAttrs: 0777 << 16, // -rwxrwxrwx file permissions
Comment: i.Name(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Tiny one, but could we add a comment here so that future us are not 🤯 trying to figure out why?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes! done in 22d8ab9

@Skn0tt Skn0tt enabled auto-merge October 30, 2023 11:40
@Skn0tt Skn0tt merged commit 071f0cf into master Oct 30, 2023
@Skn0tt Skn0tt deleted the al2-uploads-need-different-shas branch October 30, 2023 11:40
Skn0tt added a commit that referenced this pull request Oct 30, 2023
Skn0tt added a commit that referenced this pull request Oct 30, 2023
Skn0tt added a commit that referenced this pull request Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants