Skip to content

feat(plugin): Calculate SHA256 if it does not exist #2935

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 2 commits into from
Nov 2, 2023

Conversation

kyleconroy
Copy link
Collaborator

@kyleconroy kyleconroy commented Nov 1, 2023

When developing or using a plugin locally, having to update the configuration file every time to pull in a SHA256 can be very annoying. When fetching a plugin for the first time via HTTP, you may not know the SHA256 of the file you're fetching.

I've changed the plugin fetching behavior to calculate the SHA256 if it's not present. This results in extra network requests or filesystem reads, so it's still advised to set the SHA256, especially if it's not changing.

Before release, we'll add some logging to make it clear the extra requests are happening.

2023/11/02 10:10:49 WARN fetching WASM binary to calculate sha256. Set this value in sqlc.yaml to prevent unneeded work sha256=c8c759e80b7d66c728cf9d37674f8f5c9cc33774afa789dbceee0e3446773458

@kyleconroy kyleconroy marked this pull request as ready for review November 2, 2023 17:05
@kyleconroy kyleconroy merged commit f80cee1 into main Nov 2, 2023
@kyleconroy kyleconroy deleted the kyle/plugin-wasm-file-sha branch November 2, 2023 17:52
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.

2 participants