-
Notifications
You must be signed in to change notification settings - Fork 0
feat: renovate, aqua, tf-docs, TF workspaces #10
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (2)
.trunk/trunk.yaml (1)
23-31
: Version skew with OpenTofu binary remains unresolved
[email protected]
is still one minor ahead of theopentofu
runtime pinned inaqua.yaml
(v1.9.x). The mismatch can surface parsing errors on newer HCL constructs. Align both to the same minor stream (either bump the runtime or pin the linter down).README.md (1)
1-5
: Consolidate to a single H1 headingThe file still has three top-level headings, which violates MD025 and makes anchor links unpredictable. Keep only the canonical repository name as
# …
and demote the alternates.-# infra-monorepo-template - -# iac-monorepo-template - -# terraform-monorepo-template +# terraform-monorepo-template + +<!-- Alternate names historically used: +infra-monorepo-template, iac-monorepo-template -->
🧹 Nitpick comments (6)
aqua.yaml (1)
13-15
: Add a Renovate hint for the new terraform-docs packageEvery other pinned dependency in this file carries a
# renovate:
comment so Renovate can bump versions automatically. Replicating that for terraform-docs keeps the file consistent and prevents manual updates.- name: terraform-docs/[email protected] + # renovate: depName=terraform-docs/terraform-docsroot-modules/template-root-module/variables.tf (1)
11-15
: Add basic validation forprefix
An empty string (or all-whitespace) silently passes today and will later surface in resource names. A minimal validation guard is cheap insurance.variable "prefix" { description = "The prefix to prepend to the generated name" type = string default = "random" + validation { + condition = length(trimspace(var.prefix)) > 0 + error_message = "prefix must be a non-empty string." + } }.github/renovate.json5 (1)
12-15
: Trailing comma may confuse non-JSON5 parsers
While JSON5 tolerates trailing commas, some downstream tooling (e.g., GitHub’s code owners viewer or UI linters) still parses files with a strict JSON engine. If you hit parsing errors, just drop the comma after"components/**"
.root-modules/template-root-module/README.md (1)
5-16
: Clarify CLI examples & keep them tool-agnosticThe docs jump straight to
tofu workspace …
while many users will still invoketerraform
.
To avoid copy-paste errors, consider presenting both commands or a short note such as “replacetofu
withterraform
if you’re not using OpenTofu”.-# Set up a new workspace for `dev` -- only needs to be done once -tofu workspace new dev -# Select the workspace, this is how TF knows where the state file is stored -tofu workspace select dev -# Apply the configuration with the corresponding tfvars file -tofu apply --var-file tfvars/dev.tfvars +# Set up a new workspace for `dev` (run once) +terraform workspace new dev # or: tofu workspace new dev +# Select the workspace so TF knows where the state file is stored +terraform workspace select dev +# Apply the configuration with the corresponding tfvars file +terraform apply -var-file=tfvars/dev.tfvarsMinor, but improves portability and avoids support questions.
root-modules/template-root-module/tfvars/dev.tfvars (1)
1-1
: Environment-specific tfvars looks fine, but consider committing only “*.tfvars.example” templatesCommitting concrete values (even benign ones) makes cloning users think these are canonical. A common pattern is to version
dev.tfvars.example
/prod.tfvars.example
with placeholder values and let pipelines or local copies provide the real files (often ignored via.gitignore
). This avoids accidental drift between repo defaults and live deployments.If you keep the concrete files under VCS, document clearly in the README how they’re used with workspaces (
terraform workspace select dev && terraform apply -var-file=tfvars/dev.tfvars
, etc.) so newcomers don’t mis-apply the wrong environment.root-modules/template-root-module/tfvars/prod.tfvars (1)
1-1
: Same remark as fordev.tfvars
—consider shipping this as a.example
or documenting its usageNothing technically wrong here; just repeating the suggestion to avoid committing live environment defaults unless that’s intentional.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (12)
.github/renovate.json5
(1 hunks).terraform-docs.yaml
(1 hunks).trunk/trunk.yaml
(1 hunks)README.md
(5 hunks)aqua.yaml
(1 hunks)root-modules/template-root-module/README.md
(2 hunks)root-modules/template-root-module/main.tf
(1 hunks)root-modules/template-root-module/outputs.tf
(1 hunks)root-modules/template-root-module/tfvars/dev.tfvars
(1 hunks)root-modules/template-root-module/tfvars/prod.tfvars
(1 hunks)root-modules/template-root-module/variables.tf
(1 hunks)root-modules/template-root-module/versions.tf
(1 hunks)
🧰 Additional context used
🧠 Learnings (9)
📓 Common learnings
Learnt from: gberenice
PR: masterpointio/client-tf-templates#1
File: root-module/main.tf:25-31
Timestamp: 2024-12-11T17:35:43.671Z
Learning: In the `client-tf-templates` repository, the module `masterpointio/random/pet` used in `root-module/main.tf` is a dummy example and may not exist in the Terraform Registry. This is intentional and should not be flagged as an error in future reviews.
root-modules/template-root-module/tfvars/dev.tfvars (1)
Learnt from: gberenice
PR: masterpointio/client-tf-templates#1
File: root-module/main.tf:25-31
Timestamp: 2024-12-11T17:35:43.671Z
Learning: In the `client-tf-templates` repository, the module `masterpointio/random/pet` used in `root-module/main.tf` is a dummy example and may not exist in the Terraform Registry. This is intentional and should not be flagged as an error in future reviews.
root-modules/template-root-module/outputs.tf (1)
Learnt from: gberenice
PR: masterpointio/client-tf-templates#1
File: root-module/main.tf:25-31
Timestamp: 2024-12-11T17:35:43.671Z
Learning: In the `client-tf-templates` repository, the module `masterpointio/random/pet` used in `root-module/main.tf` is a dummy example and may not exist in the Terraform Registry. This is intentional and should not be flagged as an error in future reviews.
root-modules/template-root-module/versions.tf (1)
Learnt from: gberenice
PR: masterpointio/client-tf-templates#1
File: root-module/main.tf:25-31
Timestamp: 2024-12-11T17:35:43.671Z
Learning: In the `client-tf-templates` repository, the module `masterpointio/random/pet` used in `root-module/main.tf` is a dummy example and may not exist in the Terraform Registry. This is intentional and should not be flagged as an error in future reviews.
root-modules/template-root-module/variables.tf (1)
Learnt from: gberenice
PR: masterpointio/client-tf-templates#1
File: root-module/main.tf:25-31
Timestamp: 2024-12-11T17:35:43.671Z
Learning: In the `client-tf-templates` repository, the module `masterpointio/random/pet` used in `root-module/main.tf` is a dummy example and may not exist in the Terraform Registry. This is intentional and should not be flagged as an error in future reviews.
root-modules/template-root-module/tfvars/prod.tfvars (1)
Learnt from: gberenice
PR: masterpointio/client-tf-templates#1
File: root-module/main.tf:25-31
Timestamp: 2024-12-11T17:35:43.671Z
Learning: In the `client-tf-templates` repository, the module `masterpointio/random/pet` used in `root-module/main.tf` is a dummy example and may not exist in the Terraform Registry. This is intentional and should not be flagged as an error in future reviews.
root-modules/template-root-module/main.tf (1)
Learnt from: gberenice
PR: masterpointio/client-tf-templates#1
File: root-module/main.tf:25-31
Timestamp: 2024-12-11T17:35:43.671Z
Learning: In the `client-tf-templates` repository, the module `masterpointio/random/pet` used in `root-module/main.tf` is a dummy example and may not exist in the Terraform Registry. This is intentional and should not be flagged as an error in future reviews.
root-modules/template-root-module/README.md (1)
Learnt from: gberenice
PR: masterpointio/client-tf-templates#1
File: root-module/main.tf:25-31
Timestamp: 2024-12-11T17:35:43.671Z
Learning: In the `client-tf-templates` repository, the module `masterpointio/random/pet` used in `root-module/main.tf` is a dummy example and may not exist in the Terraform Registry. This is intentional and should not be flagged as an error in future reviews.
README.md (1)
Learnt from: gberenice
PR: masterpointio/client-tf-templates#1
File: root-module/main.tf:25-31
Timestamp: 2024-12-11T17:35:43.671Z
Learning: In the `client-tf-templates` repository, the module `masterpointio/random/pet` used in `root-module/main.tf` is a dummy example and may not exist in the Terraform Registry. This is intentional and should not be flagged as an error in future reviews.
🪛 GitHub Check: Trunk Check
README.md
[notice] 5-5: markdownlint(MD025)
[new] Multiple top-level headings in the same document
[notice] 3-3: markdownlint(MD025)
[new] Multiple top-level headings in the same document
🔇 Additional comments (4)
.terraform-docs.yaml (1)
1-19
: Configuration looks correct — good job integrating terraform-docsThe YAML is well-formed, options match the v0.20.x schema, and the inject template markers align with the pre-commit hook convention.
No action needed.root-modules/template-root-module/outputs.tf (1)
1-4
: Confirm that the sub-module actually exportsrandom_pet_name
This output forwards
module.random_pet.random_pet_name
. Compilation will fail if the child module lacks a matchingoutput "random_pet_name"
block.Please verify (or add) the output in
modules/random_pet
:output "random_pet_name" { value = random_pet.this.id }root-modules/template-root-module/versions.tf (1)
2-8
: LGTM – version bumps look sensible
No breaking-change flags detected for Terraform 1.10.x or random 3.7.x.root-modules/template-root-module/main.tf (1)
11-13
: Verify local module path correctness
The relative path../../child-modules/random-pet
assumes this root module is invoked fromroot-modules/template-root-module
. Double-check that consumers (e.g., Terraform Cloud workspaces or CI pipelines) executeterraform
from the expected directory; otherwise the path will break.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, looks great @oycyc
Let's rename the repo via the mp-infra config once we've got this shipped 👍
WalkthroughThis update introduces new configuration files for Renovate and terraform-docs, updates linter versions, and expands documentation throughout the repository. The root module template receives new variables, outputs, and tfvars files for environment-specific configuration. Module and provider versions are updated, and documentation is improved for clarity and automation guidance. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Renovate Bot
participant GitHub Repo
User->>GitHub Repo: Pushes code/config changes
Renovate Bot->>GitHub Repo: Runs on schedule (Mon before 5AM)
Renovate Bot->>GitHub Repo: Opens PRs for Terraform dependency updates (excluding context.tf & components/)
GitHub Repo->>User: Notifies of PRs with "auto-upgrade" label
User->>GitHub Repo: Reviews and merges PRs
sequenceDiagram
participant User
participant Terraform
participant tfvars File
User->>Terraform: Selects workspace (e.g., dev/prod)
User->>tfvars File: Provides environment-specific variables
Terraform->>Terraform: Applies configuration with selected tfvars
Terraform->>User: Outputs environment-specific resources and outputs
Estimated code review effort2 (~15 minutes) Poem
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
If I'm not mistaken, we're referencing this repo in the audit docs and possibly elsewhere. @oycyc did you if we need to update the link/name? |
Ah this is good point. I just checked, looks like in GDrive, the only place it's been mentioned is in a previous audit reports, but not our audit boilerplate template. Also all good on Notion as well. (redacted screenshot since this is a public repo) |
@gberenice / @Gowiem can I get a final review on this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
terraform-docs
along with corresponding toolsAlso let's come up with the new name for this template repo, and I'll adjust accordingly in the other dependent repos.
Summary by CodeRabbit
New Features
Improvements
Updates