Skip to content

Conversation

@douglasjacobsen
Copy link
Collaborator

This merge enables support for when conditions on all variable types (modifier_variable,package_manager_variable, workflow_manager_variable, and workload_variable). Additionally, it introduces a new shared_language directive called variable that can define generic variables for each object type.

The variable definitions using the object specific interface for modifiers, package managers, and workflow managers simply wraps the generic variable directive. Workload variables are handled a little differently, as they still need to be connected nicely to workload groups.

There are additional variants defined for application_name and workload_name.

This commit allows directives in objects to define the init value used
when adding attributes to the base objects.
This commit allows the modifier_variable directive to accept a `when`
clause.

Additionally, a base `variable` directive is added, which generically
can define variables on any object type.
This commit enables the `package_manager_variable` directive to support
the `when` clause.
This commit adds support to the `workflow_manager_variable` directive
for the `when` clause.
This commit updates the non-application variable directives to have a
common interface, but also call down into the shared language variable
directive instead of replicating that logic.
This commit updates non-application objects to have a standard interface
for extracting variables based on variant criteria.

This is in preparation for addign the same logic to the application
class.
This commit allows workload variables to be controlled with `when`
clauses. `when` cannot be used to filter by workload with these
definitions though.
This commit enables support for having workload variables redefined with
different when clauses.

This also fixes the tests that break as a result of making this change.
This commit adds a test that exercises the `variable` directive with a
when condition using `workload_name`.
This commit fixes the construction of the `application_name` variant to
include application names from base classes.
@douglasjacobsen douglasjacobsen added the enhancement New feature or request label May 16, 2025
Copy link
Collaborator

@dapomeroy dapomeroy left a comment

Choose a reason for hiding this comment

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

LGTM aside from nits

@rfbgo rfbgo merged commit f61b60d into GoogleCloudPlatform:develop May 21, 2025
15 checks passed
@douglasjacobsen douglasjacobsen deleted the when-variables branch July 21, 2025 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants