Feature(Organization rules resource/data source): Implemented both a resource and data source (buildkiite_organization_rule) for interaction with Rules. As of typing, both types (TRIGGER_BUIILD and ARTIFACTS_READ) are supported - and IDed lookups for both's read takes in the respective node query found in node.graphql, where said Fragment is within organization_rule.graphql.
For creation of buildkiite_organization_rules, both types support optional conditions (see the Conditions heading from those docs) within the rule's JSON document, along with an optional description field at the rule level.
Test Coverage
Test variations implement the successful cases for creating, deleting and importing both rule types via the buildkite_organization_rule resources (all tests invoke a deletion)
Creating a buildkite_organization_rule (TRIGGER_BUIILD action) with required attributes
Creating a buildkite_organization_rule (TRIGGER_BUIILD action) with all attributes
Creating a buildkite_organization_rule (ARTIFACTS_READ action) with required attributes
Creating a buildkite_organization_rule (ARTIFACTS_READ action) with all attributes
Importing a buildkite_organization_rule (TRIGGER_BUIILD action) with required/all attributes
Importing a buildkite_organization_rule (ARTIFACTS_READ action) with required/all attributes
For data sources through data.buildkite_organization_rule:
Loading a buildkite_organization_rule (TRIGGER_BUIILD action) that has required attributes set into state
Loading a buildkite_organization_rule (TRIGGER_BUIILD action) that has all attributes set into state
Loading a buildkite_organization_rule (ARTIFACTS_READ action) that has required attributes set into state
Loading a buildkite_organization_rule (ARTIFACTS_READ action) with has all attributes into state
Additionally various corner-cases that can occur when definining a rule's JSON value document:
Invalid action specified in the buildkite_organization_rule's type attribute.
When an invalid conditional is specified in a buildkite_organization_rule's value JSON document, specifically in the conditions optional array.
When no source_pipeline_uuid attribute is specified in a buildkite_organization_rule resource's value JSON document, and a target_pipeline_uuid attribute is.
When no target_pipeline_uuid attribute is specified in a buildkite_organization_rule resource's value JSON document, and a source_pipeline_uuid attribute is.
When the source_pipeline_uuid attribute is excluded from a buildkite_organization_rule resource's value JSON document.
When the target_pipeline_uuid attribute is excluded from a buildkite_organization_rule resource's value JSON document.
When the uuid specified in the source_pipeline_uuid attribute doesn't exist in the organization.
When the uuid specified in the target_pipeline_uuid attribute doesn't exist in the organization.
PR checklist:
[x] docs/ updated (These docs for rules are templated with a warning message on opting-in for using Rules before using both Organization rule resources/data sources.)
[x] tests added
[x] an example added to examples/ (useful to demo new field/resource)
[x] CHANGELOG.md updated with pending release information
Feature(Organization rules resource/data source): Implemented both a resource and data source (
buildkiite_organization_rule
) for interaction with Rules. As of typing, both types (TRIGGER_BUIILD
andARTIFACTS_READ
) are supported - and IDed lookups for both's read takes in the respective node query found innode.graphql
, where said Fragment is withinorganization_rule.graphql
.For creation of
buildkiite_organization_rule
s, both types support optional conditions (see theConditions
heading from those docs) within the rule's JSON document, along with an optionaldescription
field at the rule level.Test Coverage
Test variations implement the successful cases for creating, deleting and importing both rule types via the
buildkite_organization_rule
resources (all tests invoke a deletion)buildkite_organization_rule
(TRIGGER_BUIILD
action) with required attributesbuildkite_organization_rule
(TRIGGER_BUIILD
action) with all attributesbuildkite_organization_rule
(ARTIFACTS_READ
action) with required attributesbuildkite_organization_rule
(ARTIFACTS_READ
action) with all attributesbuildkite_organization_rule
(TRIGGER_BUIILD
action) with required/all attributesbuildkite_organization_rule
(ARTIFACTS_READ
action) with required/all attributesFor data sources through
data.buildkite_organization_rule
:buildkite_organization_rule
(TRIGGER_BUIILD
action) that has required attributes set into statebuildkite_organization_rule
(TRIGGER_BUIILD
action) that has all attributes set into statebuildkite_organization_rule
(ARTIFACTS_READ
action) that has required attributes set into statebuildkite_organization_rule
(ARTIFACTS_READ
action) with has all attributes into stateAdditionally various corner-cases that can occur when definining a rule's JSON
value
document:buildkite_organization_rule
'stype
attribute.buildkite_organization_rule
'svalue
JSON document, specifically in theconditions
optional array.source_pipeline_uuid
attribute is specified in abuildkite_organization_rule
resource'svalue
JSON document, and atarget_pipeline_uuid
attribute is.target_pipeline_uuid
attribute is specified in abuildkite_organization_rule
resource'svalue
JSON document, and asource_pipeline_uuid
attribute is.source_pipeline_uuid
attribute is excluded from abuildkite_organization_rule
resource'svalue
JSON document.target_pipeline_uuid
attribute is excluded from abuildkite_organization_rule
resource'svalue
JSON document.uuid
specified in thesource_pipeline_uuid
attribute doesn't exist in the organization.uuid
specified in thetarget_pipeline_uuid
attribute doesn't exist in the organization.PR checklist:
docs/
updated (These docs for rules are templated with a warning message on opting-in for using Rules before using both Organization rule resources/data sources.)examples/
(useful to demo new field/resource)CHANGELOG.md
updated with pending release information