-
Notifications
You must be signed in to change notification settings - Fork 426
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
feat: Mark V1 ready preview resources #3218
Conversation
pkg/datasources/current_account.go
Outdated
@@ -41,6 +42,10 @@ func CurrentAccount() *schema.Resource { | |||
// ReadCurrentAccount read the current snowflake account information. | |||
func ReadCurrentAccount(d *schema.ResourceData, meta interface{}) error { | |||
client := meta.(*provider.Context).Client | |||
enabled := meta.(*provider.Context).EnabledFeatures |
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.
Let's do a few things:
- Extract
previewfeatures
pkg insideprovider
. - Move the list of preview features there.
- Make the list closed (the same way as for
resources.Resource
) - Make EnabledFeatures type list of the type above instead of string.
- Print all available features in the docs.
- To the extracted package add func
EnsurePreviewFeatureEnabled(previewfeatures.CurrentAccount, meta.(*provider.Context).EnabledFeatures)
that encapsulates the logic and return error and here just diag.FromErr(err) - (question) why not set in tf config?
- Add validation to check if provided values are only the possible values.
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.
LGTM, but we already have a validation on the provider level. Do you have something else in mind?
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 agree + I think my wrapper function could come in clutch here, because instead of going through all the resources and data sources you can just add the check in the common function. (let's discuss this on Monday)
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.
If we extract them as this fancy closed list then we need conversion from string to this new type, preferably inside this new pkg, so this validation in provider changes, sorry for not being precise
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.
Done. Ad.7 - it's supposed to be Set, I was just playing around with it.
pkg/datasources/current_account.go
Outdated
@@ -41,6 +42,10 @@ func CurrentAccount() *schema.Resource { | |||
// ReadCurrentAccount read the current snowflake account information. | |||
func ReadCurrentAccount(d *schema.ResourceData, meta interface{}) error { | |||
client := meta.(*provider.Context).Client | |||
enabled := meta.(*provider.Context).EnabledFeatures |
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 agree + I think my wrapper function could come in clutch here, because instead of going through all the resources and data sources you can just add the check in the common function. (let's discuss this on Monday)
Integration tests failure for 0c97cb97b09ac78111b2bf4351682f39fb462b33 |
@@ -8,7 +8,7 @@ import ( | |||
) | |||
|
|||
const ( | |||
ProviderVersion string = "v0.99.0" // TODO(SNOW-1814934): Currently hardcoded, make it computed | |||
ProviderVersion string = "v1.0.0-rc.1" // TODO(SNOW-1814934): Currently hardcoded, make it computed |
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.
make it v1.0.0-rc1
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 initially did, but realized that in semantic versioning they use .
here: https://semver.org/
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.
A pre-release version MAY be denoted by appending a hyphen and a series of dot separated identifiers immediately following the patch version.
(https://semver.org/#spec-item-9) - so in our case I would say that rc1
is and identifier (not two identifiers rc
and 1
), so I agree with @sfc-gh-jcieslak
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'll change this in the next pr.
Integration tests failure for f6bdff938ce4f205b577fdf6920453521ed3104e |
f6bdff9
to
f9920d7
Compare
Integration tests failure for f9920d77eb6b207583a8380240c2f31b0df678e8 |
Test Plan
References