buildkite / terraform-provider-buildkite

Terraform provider for Buildkite
https://registry.terraform.io/providers/buildkite/buildkite/latest
MIT License
56 stars 35 forks source link

SUP-2506: Organization rule resource and data source implementation #562

Closed james2791 closed 1 month ago

james2791 commented 2 months ago

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)

For data sources through data.buildkite_organization_rule:

Additionally various corner-cases that can occur when definining a rule's JSON value document:

PR checklist: