-
Notifications
You must be signed in to change notification settings - Fork 137
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
Preload official+verified providers on release #341
Conversation
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.
The build is currently failing, so I reckon that needs fixing, but otherwise the change looks good. I left you some more comments inline.
@@ -31,6 +31,9 @@ jobs: | |||
# TODO: Replace with go-version-from-file when it is supported | |||
# https://github.com/actions/setup-go/pull/62 | |||
go-version: ${{ steps.go-version.outputs.content }} | |||
- | |||
name: Generate provider schemas | |||
run: go generate ./internal/schemas |
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 makes me realize that users installing LS via go install/get
will be missing these schemas.
This would likely also affect the community-maintained Homebrew formula https://formulae.brew.sh/formula/terraform-ls
Even if we (re)introduce make build
target, which was removed as part of #98 the remaining problem is that we have no way of communicating there is any makefile and that it may need to run. This was one of the reasons I initially actively prevented go get
installations as per #88 (comment) Also I would rather avoid adding a makefile target which isn't being actively used/tested in our CI.
I think the best way forward would be to keep encouraging people to just use our builds and make sure we can more easily identify unofficial builds as per #127 if people experience bugs in those. Then builders of unofficial builds will either keep following changes in our CI configs and add go generate
on their side, or produce builds with missing schema, which may be just fine? 🤷🏻♂️
We started baking the schemas in based on the feedback from VS Code extension users, all/most of which have our builds of LS installed automatically - so it shouldn't affect that critical majority.
Longer term this may not be an issue though once we stop compiling schemas into the binary and start pulling them from the Registry.
All in all I would just add a note about this into the Changelog once merging it, to give folks a chance to spot it and adapt their build configs.
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.
cc @chenrui333 ^ (I noticed you contributed some recent updates to the Homebrew formula)
Schema preloading refactored to support empty func for development. release build tag uses previous implementation. This avoids git churn, but sacrifices reproducibility.
Add generated file to gitignore
Remove problematic verified providers from preload
986e9ae
to
bbee25d
Compare
- | ||
name: Snapshot build (cross-platform) | ||
uses: goreleaser/goreleaser-action@v1 | ||
uses: goreleaser/goreleaser-action@v2 |
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.
Good catch! I completely forgot about this other action reference when updating the release job. 😅
.goreleaser.yml
Outdated
@@ -36,6 +37,7 @@ builds: | |||
mod_timestamp: '{{ .CommitTimestamp }}' | |||
flags: | |||
- -trimpath | |||
- -tags=preload |
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.
Nitpick: I would call it preloadschema
.github/workflows/ci.yml
Outdated
@@ -36,9 +36,12 @@ jobs: | |||
# TODO: Replace with go-version-from-file when it is supported | |||
# https://github.com/actions/setup-go/pull/62 | |||
go-version: ${{ steps.go-version.outputs.content }} | |||
- # since release builds specify the preload tag, we must run the generator |
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.
I would say it's good to run this for each PR anyway as it's a way of testing the generator logic. 🤷🏻♂️
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.
Okay, it just adds a few minutes to the build but if it's useful then great!
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Refactor codebase to remove binary data from git, and have provider schemas generate during release process. Preloaded schemas will be nil during development. Verified partner providers now included on release (as well as official).
Closes #321