Skip to content

Conversation

@akocbek
Copy link
Contributor

@akocbek akocbek commented Jun 3, 2025

Description

TestDeployCEProjectDA test refactoring:
- replaced terraform.OutputAllE and terraform.Output with own method getTerraformOutput to prevent print sensitive outputs

  • added writeTfvarsFile function to create tfvars file and added to temp testing folder to use it instead of CLI vars (prevent print sensitive inputs and solving the Error: Can't change variable when applying a saved plan issue)
  • using terratest wrapper for existing resources as well

New implementation:

  • added support to run builds
  • added support to create container image namespace

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.

@akocbek akocbek requested a review from shemau as a code owner June 3, 2025 16:23
@akocbek
Copy link
Contributor Author

akocbek commented Jun 3, 2025

/run pipeline

6 similar comments
@akocbek
Copy link
Contributor Author

akocbek commented Jun 5, 2025

/run pipeline

@akocbek
Copy link
Contributor Author

akocbek commented Jun 5, 2025

/run pipeline

@akocbek
Copy link
Contributor Author

akocbek commented Jun 5, 2025

/run pipeline

@akocbek
Copy link
Contributor Author

akocbek commented Jun 5, 2025

/run pipeline

@akocbek
Copy link
Contributor Author

akocbek commented Jun 5, 2025

/run pipeline

@akocbek
Copy link
Contributor Author

akocbek commented Jun 6, 2025

/run pipeline

@akocbek akocbek requested a review from toddgiguere June 6, 2025 07:27
@akocbek
Copy link
Contributor Author

akocbek commented Jun 9, 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.

Thoughts about the architecture of the solution:

app DA only sets up one application.
project DA sets up multiple complex resources.

Architecturally is it better to align with the app approach and introduce an app-from-source (name negotiable) DA that contains a single build.

Both applications from binary and applications from source are similar. Both require a project.

The 'project' DA could exclude builds, or add applications to be balanced.

description = "A map of code engine builds to be created.[Learn more](https://github.com/terraform-ibm-modules/terraform-ibm-code-engine/blob/main/solutions/project/DA-inputs.md#builds)"
type = map(object({
output_image = string
output_image = optional(string)
Copy link
Contributor

Choose a reason for hiding this comment

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

This should imply a change to the documentation in the link in the description. The DA now has a more complex interaction between this input and container_resgistry_namespace.

@akocbek
Copy link
Contributor Author

akocbek commented Jun 17, 2025

/run pipeline

@akocbek
Copy link
Contributor Author

akocbek commented Jun 17, 2025

/run pipeline

toddgiguere
toddgiguere previously approved these changes Jun 23, 2025
@akocbek
Copy link
Contributor Author

akocbek commented Jun 23, 2025

/run pipeline

Comment on lines 143 to 145
password = coalesce(secret.data.password, var.ibmcloud_api_key),
username = coalesce(secret.data.username, "iamapikey"),
server = coalesce(secret.data.server, local.container_registry)
Copy link
Member

@Ak-sky Ak-sky Jun 24, 2025

Choose a reason for hiding this comment

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

when passing secrets value as-

default = {
  my-registry = {
    format = "registry"
    data = {}
  }
}

it is throwing error

│   on main.tf line 143, in locals:
│  143:             password = coalesce(secret.data.password, var.ibmcloud_api_key),
│     ├────────────────
│     │ secret.data is empty map of string
│ 
│ This map does not have an element with the key "password".
╵
╷
│ Error: Missing map element
│ 
│   on main.tf line 144, in locals:
│  144:             username = coalesce(secret.data.username, "iamapikey"),
│     ├────────────────
│     │ secret.data is empty map of string
│ 
│ This map does not have an element with the key "username".
╵
╷
│ Error: Missing map element
│ 
│   on main.tf line 145, in locals:
│  145:             server   = coalesce(secret.data.server, local.container_registry)
│     ├────────────────
│     │ secret.data is empty map of string
│ 
│ This map does not have an element with the key "server".

as coalesce is looking for the map to exist. Instead we can use lookup to assign the default values.

Suggested change
password = coalesce(secret.data.password, var.ibmcloud_api_key),
username = coalesce(secret.data.username, "iamapikey"),
server = coalesce(secret.data.server, local.container_registry)
password = lookup(secret.data, "password", var.ibmcloud_api_key),
username = lookup(secret.data, "username", "iamapikey"),
server = lookup(secret.data, "server", local.container_registry)

@akocbek
Copy link
Contributor Author

akocbek commented Jun 24, 2025

/run pipeline

Ak-sky
Ak-sky previously approved these changes Jun 24, 2025
@akocbek
Copy link
Contributor Author

akocbek commented Jun 24, 2025

/run pipeline

@akocbek akocbek merged commit 4994d03 into main Jun 24, 2025
2 checks passed
@akocbek akocbek deleted the run_build branch June 24, 2025 12:12
@terraform-ibm-modules-ops
Copy link
Contributor

🎉 This PR is included in version 4.3.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.

6 participants