-
Notifications
You must be signed in to change notification settings - Fork 3
fix: pass github_enterprise.id to stacks #14
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
WalkthroughThe pull request modifies the Terraform configuration for Spacelift stacks, focusing on two primary enhancements. First, a new Changes
Sequence DiagramsequenceDiagram
participant Terraform
participant SpaceliftStack
participant GitHubEnterprise
Terraform->>SpaceliftStack: Create Stack
SpaceliftStack-->>Terraform: Validate .tfvars
Terraform->>GitHubEnterprise: Retrieve Enterprise ID
GitHubEnterprise-->>SpaceliftStack: Return Enterprise ID
SpaceliftStack->>Terraform: Stack Creation Confirmed
Possibly Related PRs
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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
Documentation and Community
|
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: 0
🧹 Nitpick comments (1)
main.tf (1)
272-277: Consider updating documentation for github_enterprise configurationWhile the implementation is correct, it would be helpful to add a comment block above the github_enterprise dynamic block explaining the expected structure of the var.github_enterprise variable and its usage.
Add documentation like this:
+ # GitHub Enterprise configuration + # Expects a map with 'namespace' and 'id' keys to configure GitHub Enterprise integration + # Example: + # github_enterprise = { + # namespace = "my-org" + # id = "12345" + # } dynamic "github_enterprise" { for_each = var.github_enterprise != null ? [var.github_enterprise] : [] content { namespace = github_enterprise.value["namespace"] id = github_enterprise.value["id"] } }
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
main.tf(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
main.tf (1)
Pattern **/*.tf: You're a Terraform expert who has thoroughly studied all the documentation from Hashicorp https://developer.hashicorp.com/terraform/docs and OpenTofu https://opentofu.org/docs/.
You have a strong grasp of Terraform syntax and prioritize providing accurate and insightful code suggestions.
As a fan of the Cloud Posse / SweetOps ecosystem, you incorporate many of their best practices https://docs.cloudposse.com/best-practices/terraform/ while balancing them with general Terraform guidelines.
🔇 Additional comments (1)
main.tf (1)
275-275: LGTM! Addition of github_enterprise.id aligns with requirements
The implementation correctly adds the id attribute to the github_enterprise block, enabling consumers to specify both namespace and id for GitHub Enterprise configuration.
Let's verify the variable definition and any potential usage:
✅ Verification successful
✅ Variable definition and usage are properly aligned
The verification confirms:
- The
github_enterprisevariable is correctly defined with an optionalidfield in both the module and example - The dynamic block implementation properly references the variable fields
- Usage in the example demonstrates correct variable passing
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify github_enterprise variable definition and usage
# Check for variable definition
rg -A 5 'variable "github_enterprise"'
# Check for any other references to github_enterprise
rg 'github_enterprise' --type tf
Length of output: 1319
gberenice
left a comment
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.
Doh!
🤖 I have created a release *beep* *boop* --- ## [0.3.1](v0.3.0...v0.3.1) (2024-12-19) ### Bug Fixes * check if tfvars file exists only if when it's expected ([#16](#16)) ([72c5a77](72c5a77)) * include stack specific `before_init` even if tfvars disabled + adds initial tests 🎉 ([#13](#13)) ([9eb3cd4](9eb3cd4)) * pass github_enterprise.id to stacks ([#14](#14)) ([f4c6c1b](f4c6c1b)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
what
github_enterprise.idvalue to thegithub_enterpriseblockwhy
namespaceandidfor thegithub_enterpriseconfigreferences
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
deactivatedattribute in thespacelift_stack_destructorresource to prevent unintended toggling.