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

Preload official+verified providers on release #341

Merged
merged 11 commits into from
Jan 6, 2021

Conversation

appilon
Copy link
Contributor

@appilon appilon commented Dec 18, 2020

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

@appilon appilon requested a review from a team December 18, 2020 04:34
@appilon appilon changed the title Preload verified providers Preload verified providers on release Dec 18, 2020
@appilon appilon changed the title Preload verified providers on release Preload official+verified providers on release Dec 18, 2020
Copy link
Member

@radeksimko radeksimko left a 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
Copy link
Member

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.

Copy link
Member

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)

Verified

This commit was signed with the committer’s verified signature.
vbudhram Vijay Budhram
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
@appilon appilon force-pushed the preload-verified-providers branch from 986e9ae to bbee25d Compare January 6, 2021 00:14
@appilon appilon requested a review from radeksimko January 6, 2021 02:08
-
name: Snapshot build (cross-platform)
uses: goreleaser/goreleaser-action@v1
uses: goreleaser/goreleaser-action@v2
Copy link
Member

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
Copy link
Member

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

@@ -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
Copy link
Member

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. 🤷🏻‍♂️

Copy link
Contributor Author

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!

@appilon appilon merged commit 2e1199e into main Jan 6, 2021
@appilon appilon deleted the preload-verified-providers branch January 6, 2021 15:58
@ghost
Copy link

ghost commented Feb 5, 2021

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.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the context necessary to investigate further.

@ghost ghost locked as resolved and limited conversation to collaborators Feb 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Include "Verified" provider schemas in the LS builds.
2 participants