Skip to content

Conversation

@vkuma17
Copy link
Contributor

@vkuma17 vkuma17 commented Feb 20, 2025

Description

Validation using cross-reference between input variables.

Release required?

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

Validation using cross-reference between input variables.

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.

@vkuma17
Copy link
Contributor Author

vkuma17 commented Feb 20, 2025

/run pipeline

@shemau
Copy link
Contributor

shemau commented Feb 20, 2025

/run pipeline

Copy link
Contributor

@shemau shemau left a comment

Choose a reason for hiding this comment

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

This is insufficient to upgrade to 1.9. When changing versions, it should be in all examples, modules and solutions.

@vkuma17
Copy link
Contributor Author

vkuma17 commented Feb 21, 2025

@shemau i have updated the terraform version in examples.. please take a look again.. I need suggestion on which approach to take for variable validation to be consistent across all ICD's
Aditya already raised a PR in mysql ICD for cross referencing and he took a different approach
terraform-ibm-modules/terraform-ibm-icd-mysql#212

@vkuma17
Copy link
Contributor Author

vkuma17 commented Feb 24, 2025

/run pipeline

@shemau
Copy link
Contributor

shemau commented Feb 26, 2025

A few points here, review mysql as well.

These commits change the main module, so they are going to require a release with a release note stating that required terraform version is being updated. Otherwise it is impossible to track the release notes for the next release to make sure that this information is shared.

The ICD modules are 80% similar, whilst they could be 95% similar. The closer to 95% we can get, the easier it is to cherry pick commits from one instance to the other seven. There are some minor differences, configuration on some but not others, default/minimum spec on rabbitmq messaging is higher. But generally most of the new features could be cherry picked, or copy and pasted from one repo to the other. So, almost all changes that look to fix issues or add features that reduces the similarity should be avoided.

(var.use_ibm_owned_encryption_key || var.backup_encryption_key_crn != null) || (var.use_default_backup_encryption_key || var.use_same_kms_key_for_backups),
(var.use_ibm_owned_encryption_key || var.backup_encryption_key_crn == null) || (!var.use_same_kms_key_for_backups)
])
error_message = "If IBM owned encryption is used then 'kms_key_crn' and 'backup_encryption_key_crn' should be null. If not, 'kms_key_crn' should be provided and if 'backup_encryption_key_crn' is not provided 'use_same_kms_key_for_backups' or 'use_default_backup_encryption_key' should be true.If 'backup_encryption_key_crn' is provided then 'use_same_kms_key_for_backups' should be set to false"
Copy link
Contributor

Choose a reason for hiding this comment

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

This is definitely not as readable as the mysql solution.

From a consumability perspective this is confusing, there are four different tests, some of them do not even reference use_default_backup_encryption_key. Having four validations, with four specific error messages is more helpful to the consumer. Also having all validation on one of the variables in the validation is more helpful from an on going maintenance perspective.

I am not entirely getting the implications of the alltrue block. I do not think there is any difference to having 4 conditions, they must inherently all be true, because any one that was false would trigger a more specific error message.

@vkuma17
Copy link
Contributor Author

vkuma17 commented Apr 1, 2025

I am closing this PR. This will not be merged. It would be better if all ICD's are taken care by a single person.

@vkuma17 vkuma17 closed this Apr 1, 2025
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.

3 participants