Skip to content

Conversation

@iamar7
Copy link
Member

@iamar7 iamar7 commented Sep 5, 2025

Description

This PR resolves the case when a user want to have a single alphabet as a prefix. It also updates the description of the prefix variable as mentioned here.

Release required?

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

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.

@iamar7
Copy link
Member Author

iamar7 commented Sep 5, 2025

Screenshot 2025-09-05 at 7 30 37 PM

type = string
nullable = true
description = "The prefix to be added to all resources created by this solution. To skip using a prefix, set this value to null or an empty string. The prefix must begin with a lowercase letter and may contain only lowercase letters, digits, and hyphens '-'. It should not exceed 16 characters, must not end with a hyphen('-'), and can not contain consecutive hyphens ('--'). Example: prod-0405-ocp. [Learn more](https://terraform-ibm-modules.github.io/documentation/#/prefix.md)."
description = "The prefix to add to all resources that this solution creates (e.g `prod`, `test`, `dev`). To not use any prefix value, you can enter the string `__NULL__`. [Learn more](https://terraform-ibm-modules.github.io/documentation/#/prefix.md)."
Copy link
Contributor

Choose a reason for hiding this comment

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

We should not be saying anything about using the string __NULL__ - To set null, consumers would use the UI option:
image

Copy link
Contributor

@ocofaigh ocofaigh Sep 6, 2025

Choose a reason for hiding this comment

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

Infact this is the terraform variable description - the description that is displayed in the projects UI is directly in the catalog JSON. For terraform description you can say null

variable "prefix" {
type = string
description = "The prefix to be added to all resources created by this solution. To skip using a prefix, set this value to null or an empty string. The prefix must begin with a lowercase letter and may contain only lowercase letters, digits, and hyphens '-'. It should not exceed 16 characters, must not end with a hyphen('-'), and cannot contain consecutive hyphens ('--'). Example: `prod-0205-ocpqs`. [Learn more](https://terraform-ibm-modules.github.io/documentation/#/prefix.md)."
description = "The prefix to add to all resources that this solution creates (e.g `prod`, `test`, `dev`). To not use any prefix value, you can enter the string `__NULL__`. [Learn more](https://terraform-ibm-modules.github.io/documentation/#/prefix.md)."
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

@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.

@iamar7 Can you add some info into the PR description. What is this PR addressing? Was there a bug in current regex?

@iamar7
Copy link
Member Author

iamar7 commented Sep 8, 2025

@iamar7 Can you add some info into the PR description. What is this PR addressing? Was there a bug in current regex?

I've updated the description with the information related to the changes, the PR is addressing the comments which are given here.

Yes, the current regex does not allow a single alphabet as a prefix which I am resolving in this PR.

@iamar7
Copy link
Member Author

iamar7 commented Sep 8, 2025

/run pipeline

variable "prefix" {
type = string
description = "The prefix to be added to all resources created by this solution. To skip using a prefix, set this value to null or an empty string. The prefix must begin with a lowercase letter and may contain only lowercase letters, digits, and hyphens '-'. It should not exceed 16 characters, must not end with a hyphen('-'), and cannot contain consecutive hyphens ('--'). Example: `prod-0205-ocpqs`. [Learn more](https://terraform-ibm-modules.github.io/documentation/#/prefix.md)."
description = "The prefix to add to all resources that this solution creates (e.g `prod`, `test`, `dev`). To not use any prefix value, you can set to `null`. [Learn more](https://terraform-ibm-modules.github.io/documentation/#/prefix.md)."
Copy link
Contributor

Choose a reason for hiding this comment

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

why did you remove the text that says: "To skip using a prefix, set this value to null or an empty string"? I don't know why this text is changing at all to be honest? Why would we not want to include the details of the regex pattern it needs to comply with?

Copy link
Member Author

Choose a reason for hiding this comment

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

I've re-added the text "To skip using a prefix, set this value to null or an empty string". The details of the regex pattern will be shown in error message. Apart from removing the regex pattern details there's not much change in the description.

Copy link
Member Author

Choose a reason for hiding this comment

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

Screenshot 2025-09-09 at 2 03 41 PM

Copy link
Member Author

Choose a reason for hiding this comment

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

In the UI, if the user insert a prefix with wrong pattern then the error shows the expected pattern as shown -

Screenshot 2025-09-09 at 2 17 28 PM

Copy link
Member Author

Choose a reason for hiding this comment

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

The new variable description will look like this:

Screenshot 2025-09-09 at 2 19 04 PM

Earlier variable description was too long and looks like this:

Screenshot 2025-09-09 at 2 22 39 PM

@iamar7
Copy link
Member Author

iamar7 commented Sep 9, 2025

/run pipeline

@ocofaigh ocofaigh merged commit 6ecdf21 into main Sep 9, 2025
2 checks passed
@ocofaigh ocofaigh deleted the ar-patch branch September 9, 2025 16:08
@terraform-ibm-modules-ops
Copy link
Contributor

🎉 This PR is included in version 3.57.1 🎉

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.

3 participants