Skip to content
This repository was archived by the owner on Mar 19, 2025. It is now read-only.

refactor: best input practices for da #250

Merged
merged 25 commits into from
Mar 4, 2025
Merged

refactor: best input practices for da #250

merged 25 commits into from
Mar 4, 2025

Conversation

Vipin654
Copy link
Contributor

@Vipin654 Vipin654 commented Feb 20, 2025

Description

Review DA inputs to align with best practices.

Release required?

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

Review DA inputs to align with best practices.
Following input variables were renamed for better consumer experience

  • cbr_rules --> scc_instance_cbr_rules
  • existing_en_crn --> existing_event_notifications_crn
  • en_source_name --> event_notifications_source_name
  • en_source_description --> event_notifications_source_description
  • scc_en_from_email --> scc_event_notifications_from_email
  • scc_en_reply_to_email --> scc_event_notifications_reply_to_email
  • scc_en_email_list --> scc_event_notifications_email_list
  • skip_cos_kms_auth_policy --> skip_cos_kms_iam_auth_policy
  • skip_scc_cos_auth_policy --> skip_scc_cos_iam_auth_policy
  • skip_scc_workload_protection_auth_policy --> skip_scc_workload_protection_iam_auth_policy

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.

@Vipin654
Copy link
Contributor Author

/run pipeline

@Vipin654 Vipin654 marked this pull request as draft February 20, 2025 11:09
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.

scc_region should be marked as required (just like region is in secrets manager PR)

Please review the sorting / grouping. All related inputs needs to be together. Some things I noticed:

  • SCC instance inputs should be at the top (after provider_visibility) of the optional inputs. They are all over the place now (scc_instance_name, scc_service_plan, existing_scc_instance_crn, scc_instance_tags)
  • The event notifications inputs are not grouped together
  • ibmcloud_kms_api_key needs to live with other KMS inputs
  • existing_activity_tracker_crn and existing_monitoring_crn should exist with the COS inputs
  • skip_scc_workload_protection_auth_policy should exist with other workload protection inputs.

@Vipin654 Vipin654 marked this pull request as ready for review February 26, 2025 04:33
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.

just 1 comment

@Vipin654 Vipin654 requested a review from ocofaigh February 26, 2025 11:45
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.

see latest comments

@Vipin654
Copy link
Contributor Author

/run pipeline

@Vipin654 Vipin654 requested a review from ocofaigh February 26, 2025 15:16
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.

Perhaps change the default value of scc_instance_name to just scc (aligning with what we did in secrets manager PR)

@ocofaigh
Copy link
Contributor

ocofaigh commented Feb 26, 2025

Oh and also change default value of cos_instance_name to scc-cos
and scc_cos_bucket_name to scc-cos-bucket
and scc_workload_protection_instance_name to scc-workload_protection

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.

ibm_catalog.json Outdated
{
"key": "existing_kms_instance_crn",
"required": true
"key": "existing_scc_instance_crn"
Copy link
Contributor

Choose a reason for hiding this comment

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

I would priortise putting inputs that are related to new instance creation first (since that is the default). So suggest to place this further down

ibm_catalog.json Outdated
},
{
"displayname": "France (eu-fr2)",
"value": "eu-fr2"
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 an allowlisted region. I don't think we should expose it

@ocofaigh
Copy link
Contributor

ocofaigh commented Mar 4, 2025

/run pipeline

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.

@Vipin654 You need to update the test with new variable name:

TestRunExistingResourcesInstances 2025-03-04T09:07:25Z retry.go:99: Returning due to fatal error: FatalError{Underlying: error while running command: exit status 1; ╷
│ Error: Value for undeclared variable
│ 
│ A variable named "cos_region" was assigned on the command line, but the
│ root module does not declare a variable of that name. To use this value,
│ add a "variable" block to the configuration.
╵}

Vipin Kumar added 2 commits March 4, 2025 15:13
@Vipin654
Copy link
Contributor Author

Vipin654 commented Mar 4, 2025

/run pipeline

@Vipin654
Copy link
Contributor Author

Vipin654 commented Mar 4, 2025

/run pipeline

@Vipin654
Copy link
Contributor Author

Vipin654 commented Mar 4, 2025

@ocofaigh test has been fixed. Please approve again

@Vipin654 Vipin654 requested a review from ocofaigh March 4, 2025 10:38
@ocofaigh ocofaigh merged commit c828039 into main Mar 4, 2025
2 checks passed
@ocofaigh ocofaigh deleted the da_best_practices branch March 4, 2025 23:33
@terraform-ibm-modules-ops
Copy link
Contributor

🎉 This PR is included in version 1.27.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

3 participants