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

Updates Metric Router validation condition #611

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Updates Metric Router validation condition #611

wants to merge 10 commits into from

Conversation

iamar7
Copy link
Member

@iamar7 iamar7 commented Dec 3, 2024

Description

Added validation for permitted_target_regions & length of inclusion_filters in the metrics_router_routes variable. Also added validation to ensure the user inputs the target id when the action is send.

Additionally updated these variables: target_region, action, permitted_target_regions, primary_metadata_region, backup_metadata_region, private_api_endpoint_only input to optional.

Release required?

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

The PR makes it optional to input the target_region to metric router target as well as action is made as optional input with send being set as default. It also updates the permitted_target_regions, primary_metadata_region, backup_metadata_region, private_api_endpoint_only input as optional.

It also adds validation for permitted_target_regions & restrict the length of inclusion_filters in the metrics_router_routes variable. Also ensure the user inputs the target id when the action is send.

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 iamar7 requested a review from shemau as a code owner December 3, 2024 11:27
@iamar7
Copy link
Member Author

iamar7 commented Dec 3, 2024

/run pipeline

@iamar7 iamar7 self-assigned this Dec 3, 2024
@iamar7
Copy link
Member Author

iamar7 commented Dec 6, 2024

/run pipeline

@iamar7
Copy link
Member Author

iamar7 commented Dec 9, 2024

/run pipeline

@iamar7
Copy link
Member Author

iamar7 commented Dec 11, 2024

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

Additional information is needed in the PR description and release notes contents.

The code makes a previously optional object required. So it is possible that previously running code will require a code change. A reference in the PR comments helps users identity what changed.

Comment on lines 17 to 18
targets = list(object({
id = string
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this right?

targets are required for all actions, whilst the new validation implies that targets are only required for send, thus optional for any other action.

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 only reason why I have removed the optional from target is because in terraform registry it is required but at the same time the target is only required when the action is send. If a user wants to drop the metrics then they don't need a target. The example in the terraform registry shows that.

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 other way I could think of is to keep the target as optional but remove the empty list as default and since there is validation then it makes sure that whenever the action is send the user has to input targets.

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 have made the target as optional & since there is validation for when the target is mandatory it makes sure the user inputs the target when required.

@iamar7 iamar7 changed the title Update validation condition Updates Metric Router validation condition Dec 12, 2024
@iamar7
Copy link
Member Author

iamar7 commented Dec 12, 2024

Additional information is needed in the PR description and release notes contents.

The code makes a previously optional object required. So it is possible that previously running code will require a code change. A reference in the PR comments helps users identity what changed.

I have updated the PR description and release notes.

@iamar7
Copy link
Member Author

iamar7 commented Dec 12, 2024

/run pipeline

@iamar7
Copy link
Member Author

iamar7 commented Dec 12, 2024

Need to remove the number of routes validation from the metrics routing submodule as per the discussion in playback.

@iamar7
Copy link
Member Author

iamar7 commented Dec 13, 2024

/run pipeline

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.

2 participants