Skip to content
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

Add schema global compatibility rule #342

Merged
merged 5 commits into from
Nov 20, 2024

Conversation

kccox
Copy link
Contributor

@kccox kccox commented Nov 19, 2024

Description

https://github.com/IBM-Cloud/terraform-provider-ibm release v1.71.0 adds the "ibm_event_streams_schema_global_rule" resource. This adds the global rule to the modules.

Release required?

  • No release
  • Patch release (x.x.X)
  • Minor release (x.X.x)
  • Major release (X.x.x)
Release notes content

An instance of "ibm_event_streams_schema_global_rule" sets the global compatibility rule for the Event Streams instance. This feature is only available for the Enterprise plan. The rule defines how the Event Streams schema registry will validate changes to a schema definition.

Run the pipeline

If the CI pipeline doesn't run when you create the PR, the PR requires a user with GitHub collaborators access to run the pipeline.

Run the CI pipeline when the PR is ready for review and you expect tests to pass. Add a comment to the PR with the following text:

/run pipeline

Checklist for reviewers

  • If relevant, a test for the change is included or updated with this PR.
  • If relevant, documentation for the change is included or updated with this PR.

For mergers

  • Use a conventional commit message to set the release level. Follow the guidelines.
  • Include information that users need to know about the PR in the commit message. The commit message becomes part of the GitHub release notes.
  • Use the Squash and merge option.

@kccox kccox requested review from Ak-sky and akocbek as code owners November 19, 2024 16:16
@kccox
Copy link
Contributor Author

kccox commented Nov 19, 2024

Additional review notes:

  • This is only available in Enterprise plan, so added validation for that in main.tf
  • Added example rule to examples/fscloud since it uses Enterprise plan
  • This also requires a version bump to 1.71 as in Add quotas #337 - that will cause merge issues

@kccox kccox force-pushed the add-schema-global-rule branch from 415d358 to bb4e622 Compare November 19, 2024 16:47
@kccox
Copy link
Contributor Author

kccox commented Nov 19, 2024

/run pipeline

main.tf Outdated Show resolved Hide resolved
@kccox kccox mentioned this pull request Nov 19, 2024
6 tasks
variables.tf Outdated
variable "schema_global_rule" {
type = string
description = "Schema global compatibility rule. Only allowed for enterprise plan, must be '' for other plans. Allowed values are 'NONE', 'FULL', 'FULL_TRANSITIVE', 'FORWARD', 'FORWARD_TRANSITIVE', 'BACKWARD', 'BACKWARD_TRANSITIVE'."
default = ""
Copy link
Member

Choose a reason for hiding this comment

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

its better practise to default to null instead of empty string

main.tf Outdated
@@ -26,6 +26,8 @@ locals {
) : null
# tflint-ignore: terraform_unused_declarations
validate_metrics = var.plan != "enterprise-3nodes-2tb" && length(var.metrics) > 0 ? tobool("metrics are only supported for enterprise plan") : true
# tflint-ignore: terraform_unused_declarations
validate_schema_global_rule = var.plan != "enterprise-3nodes-2tb" && var.schema_global_rule != "" ? tobool("schema global rule is only supported for enterprise plan") : true
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

@ocofaigh ocofaigh left a comment

Choose a reason for hiding this comment

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

see comments

@kccox kccox force-pushed the add-schema-global-rule branch from 03468c8 to 712bd36 Compare November 19, 2024 20:40
@kccox
Copy link
Contributor Author

kccox commented Nov 19, 2024

@ocofaigh Updated to use null as default value. I had to rewrite the validation check condition as

var.schema_global_rule == null || contains(["NONE", "FULL", "FULL_TRANSITIVE", "FORWARD", "FORWARD_TRANSITIVE", "BACKWARD", "BACKWARD_TRANSITIVE"], coalesce(var.schema_global_rule, "NONE"))

otherwise terraform complained that contains had a null argument. Is there a better way of doing this?

ocofaigh
ocofaigh previously approved these changes Nov 20, 2024
@ocofaigh
Copy link
Member

/run pipeline

@Ak-sky
Copy link
Member

Ak-sky commented Nov 20, 2024

/run pipeline

variables.tf Outdated Show resolved Hide resolved
Copy link
Member

@ocofaigh ocofaigh left a comment

Choose a reason for hiding this comment

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

sorry just spotted 2 other required changes

@ocofaigh
Copy link
Member

/run pipeline

@ocofaigh ocofaigh merged commit ffa36e7 into terraform-ibm-modules:main Nov 20, 2024
2 checks passed
@terraform-ibm-modules-ops
Copy link
Contributor

🎉 This PR is included in version 2.10.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants