-
Notifications
You must be signed in to change notification settings - Fork 160
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
Use the stages attribute for the Workspace Run Task resource #1459
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
glennsarti
changed the title
Gs/fix ws run task stages
Use the stages attribute for the Workspace Run Task resource
Sep 3, 2024
glennsarti
force-pushed
the
gs/fix-ws-run-task-stages
branch
3 times, most recently
from
September 3, 2024 06:24
994f63c
to
3330197
Compare
cam-stitt
requested changes
Sep 3, 2024
cam-stitt
approved these changes
Sep 3, 2024
Uk1288
approved these changes
Sep 3, 2024
This commit adds a resolver interface which will be used within the codebase to determine what the capabilities of the remote service are (e.g. Is is Enterprise, if so what version). Note this is an interface, not a struct to make testing easier. Later commits will use this resolver.
Previously the schema for workspace run tasks was updated for the new stages property however it wasn't actually used. This commit updates the Workspace Run Task resource to aware of the stages attributes. In particular; * Attempts to detect if the remote service supports the stages property. Stages is available in HCP Terraform and TFE v202404-1 onwards. * Munges the Stages and Stage attribtue depending on the remote capability. * Emits a warning about the remove server capability. * Adds some automated tests. Unfortunately we can't test older TFE versions, to ensure the munging is correct, however manual testing was performed in a local development enivronment to confirm the behaviour. * Removes the default value for the Stage property in the Schema. This will not cause issues with existing state and allows the provider to determine if the attribute was passed in via configuration as opposed to defaulting.
Removing the pointer reference as it's not required.
Previously the test subject for the stagesSupport unit tests would reuse the subject and resolver however this led to timing issues when parallel tests were run. This commit changes the test to create new objects per test.
glennsarti
force-pushed
the
gs/fix-ws-run-task-stages
branch
from
September 4, 2024 23:46
692eb6b
to
83fd786
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #1456
Description
Previously the schema for workspace run tasks was updated for the new stages
property however it wasn't actually used. This commit updates the Workspace
Run Task resource to aware of the stages attributes. In particular;
Attempts to detect if the remote service supports the stages property. Stages
is available in HCP Terraform and TFE v202404-1 onwards.
Munges the Stages and Stage attribtue depending on the remote capability.
Emits a warning about the remove server capability.
Adds some automated tests. Unfortunately we can't test older TFE versions,
to ensure the munging is correct, however manual testing was performed in
a local development enivronment to confirm the behaviour.
Removes the default value for the Stage property in the Schema. This will
not cause issues with existing state and allows the provider to determine
if the attribute was passed in via configuration as opposed to defaulting.
Testing plan
Apart from CI
stages
property with multiple valuesExternal links
Output from acceptance tests
Tests can be run in CI