Skip to content

feat: read the workspace restrictApplyToConfiguredBranch setting - #101

Open
jakegroves wants to merge 1 commit into
mainfrom
feat/workspace-restrict-apply-to-branch
Open

jakegroves wants to merge 1 commit into
mainfrom
feat/workspace-restrict-apply-to-branch

Conversation

@jakegroves

Copy link
Copy Markdown
Member

What changed and why?

Terrakube 2.34.0 adds an opt-in workspace setting, restrictApplyToConfiguredBranch, that only allows apply and destroy from the workspace branch (terrakube-io/terrakube#3816). This adds it to WorkspaceAttributes so the client reads it.

A Terrakube that does not send it reads as false, which is its behaviour. The client only reads workspaces, so there is nothing to send.

Testing

Ran:
- mvn test: 45 tests in terrakube-client, 1 in the sample, 0 failures
- Added: the attribute is read when present, and reads as false from a Terrakube that does not send it

Checked:
- an older client (without this change) ignores the new attribute: the Feign Jackson decoder does not fail on unknown properties

Terrakube 2.34.0 adds an opt-in workspace setting that limits apply and destroy
to the workspace branch. Add it to WorkspaceAttributes so the client reads it.
A Terrakube that does not send it reads as false, which is its behaviour.

Refs terrakube-io/terrakube#3816
@sonarqubecloud

Copy link
Copy Markdown

@Macbet Macbet left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked the change end to end: the new restrictApplyToConfiguredBranch field against the API's Workspace entity (same name, non-null boolean, readable), whether WorkspaceAttributes is ever serialized into a request (it is not, so the primitive default cannot be sent), and the WireMock tests against the production Feign/Jackson decoder setup. No blocking issues found.

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