-
Notifications
You must be signed in to change notification settings - Fork 3
feat: enable integration with ADO #93
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
WalkthroughIntroduces optional Azure DevOps integration to the module:
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
✨ Finishing touches🧪 Generate unit tests
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. 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. Comment Pre-merge checks✅ Passed checks (3 passed)
|
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
🧹 Nitpick comments (6)
examples/azure-devops/versions.tf (1)
2-10: Pin provider for self‑hosted; keep SaaS flexible.For Spacelift Self‑Hosted, it’s safer to pin an exact spacelift provider version known to be compatible; the docs recommend version pinning for SH deployments. For SaaS, your current ">= 1.14" is fine. Consider adding a note or pinning in this example if targeting SH users. (docs.spacelift.io)
terraform { required_version = ">= 1.9" required_providers { spacelift = { source = "spacelift-io/spacelift" - version = ">= 1.14" + # For Self-Hosted, pin a known-good version (example): + # version = "1.23.0" + version = ">= 1.14" } } }variables.tf (1)
39-46: Guard against configuring multiple VCS providers simultaneously.If both github_enterprise and azure_devops are set, the spacelift_stack resource will try to render both nested blocks and likely error. Add a validation/check enforcing mutual exclusivity.
# Add alongside existing `check` blocks: check "vcs_integration_mutual_exclusivity" { assert { condition = (var.github_enterprise == null) || (var.azure_devops == null) error_message = "Provide only one of github_enterprise or azure_devops." } }Optional: align the description to mirror GitHub’s (“The Azure DevOps VCS settings”) for consistency.
examples/azure-devops/README.md (1)
20-22: Clarify VCS choice and when to setid.Add a short note that azure_devops and github_enterprise are mutually exclusive, and that azure_devops.id is only required when using a non‑default ADO integration in Spacelift.
README.md (1)
350-350: Doc tweak: call out mutual exclusivity.Consider updating this input’s description (via variables.tf so terraform-docs regenerates it) to note it’s mutually exclusive with github_enterprise and that id is optional for non‑default integrations.
main.tf (1)
472-478: Dynamic ADO block looks good; add safety check for exclusivity.Pattern matches your GitHub block. Add a module‑level
checkto prevent both VCS blocks being set at once (see variables.tf comment) to avoid plan errors.examples/azure-devops/main.tf (1)
4-16: Example values: add hint aboutidusage.Consider a comment that
idis optional and only needed when selecting a non‑default ADO integration in Spacelift.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
README.md(1 hunks)examples/azure-devops/README.md(1 hunks)examples/azure-devops/main.tf(1 hunks)examples/azure-devops/versions.tf(1 hunks)main.tf(2 hunks)variables.tf(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.tf
⚙️ CodeRabbit configuration file
**/*.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.
Files:
variables.tfexamples/azure-devops/versions.tfexamples/azure-devops/main.tfmain.tf
🧠 Learnings (8)
📓 Common learnings
Learnt from: Gowiem
PR: masterpointio/terraform-spacelift-automation#3
File: modules/spacelift-automation/main.tf:221-227
Timestamp: 2024-10-29T00:06:05.693Z
Learning: In the Terraform module `modules/spacelift-automation/main.tf`, when `var.aws_integration_id` is a required variable, avoid suggesting to make the `spacelift_aws_integration_attachment` resource conditional based on whether `aws_integration_id` is provided.
📚 Learning: 2024-10-30T16:38:33.362Z
Learnt from: gberenice
PR: masterpointio/terraform-spacelift-automation#3
File: modules/spacelift-automation/variables.tf:0-0
Timestamp: 2024-10-30T16:38:33.362Z
Learning: Spacelift requires a specific Terraform version number; it does not support version constraints like "~> 1.7.0".
Applied to files:
examples/azure-devops/versions.tf
📚 Learning: 2025-09-09T13:21:15.616Z
Learnt from: oycyc
PR: masterpointio/terraform-spacelift-automation#92
File: data.tf:1-4
Timestamp: 2025-09-09T13:21:15.616Z
Learning: The spacelift_aws_integrations data source exists and is available in the Spacelift Terraform provider for looking up AWS integrations, contrary to previous incorrect analysis.
Applied to files:
examples/azure-devops/versions.tf
📚 Learning: 2024-10-30T17:01:23.897Z
Learnt from: Gowiem
PR: masterpointio/terraform-spacelift-automation#3
File: main.tf:231-257
Timestamp: 2024-10-30T17:01:23.897Z
Learning: In `main.tf`, grouping related attributes in the `spacelift_stack` resource using locals may overcomplicate things and remove important logic elsewhere; prefer to keep attributes as is.
Applied to files:
examples/azure-devops/versions.tfmain.tf
📚 Learning: 2024-10-29T00:06:05.693Z
Learnt from: Gowiem
PR: masterpointio/terraform-spacelift-automation#3
File: modules/spacelift-automation/main.tf:221-227
Timestamp: 2024-10-29T00:06:05.693Z
Learning: In the Terraform module `modules/spacelift-automation/main.tf`, when `var.aws_integration_id` is a required variable, avoid suggesting to make the `spacelift_aws_integration_attachment` resource conditional based on whether `aws_integration_id` is provided.
Applied to files:
examples/azure-devops/main.tfmain.tf
📚 Learning: 2024-10-29T17:52:31.823Z
Learnt from: gberenice
PR: masterpointio/terraform-spacelift-automation#3
File: modules/spacelift-automation/main.tf:224-230
Timestamp: 2024-10-29T17:52:31.823Z
Learning: In the `masterpointio/terraform-spacelift-automation` repository, the `context.tf` file is a mixin file that we don't own. Do not make suggestions or comments on `context.tf` in future reviews.
Applied to files:
examples/azure-devops/main.tf
📚 Learning: 2024-10-29T00:05:59.989Z
Learnt from: Gowiem
PR: masterpointio/terraform-spacelift-automation#3
File: modules/spacelift-automation/main.tf:215-218
Timestamp: 2024-10-29T00:05:59.989Z
Learning: In the `modules/spacelift-automation/main.tf` file, it's valid to directly reference resource collections created with `for_each` in the `depends_on` attribute. For example, in the `spacelift_stack_destructor` resource, referencing `spacelift_drift_detection.this` and `spacelift_aws_integration_attachment.this` directly is acceptable and should not be flagged.
Applied to files:
examples/azure-devops/main.tfmain.tf
📚 Learning: 2024-10-28T12:47:36.579Z
Learnt from: gberenice
PR: masterpointio/terraform-spacelift-automation#3
File: modules/spacelift-automation/variables.tf:54-64
Timestamp: 2024-10-28T12:47:36.579Z
Learning: In the `spacelift-automation` module, the variable `aws_integration_attachment_write` has a default value of `true`, which matches the default value in the provider.
Applied to files:
README.md
🔇 Additional comments (1)
main.tf (1)
372-375: Minor: coalesce+try already handles nulls.Current expression is fine; no change needed. Just noting it correctly yields null when neither name nor ID is provided.
| variable "azure_devops" { | ||
| type = object({ | ||
| project = string | ||
| id = optional(string) |
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.
If the ID is left off, does anything work?
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.
If id is null, spacelift will try to use the default Azure DevOps integration.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Gowiem
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.
![]()
🤖 I have created a release *beep* *boop* --- ## [1.7.0](v1.6.0...v1.7.0) (2025-09-15) ### Features * ability to assign workerpool by name ([#89](#89)) ([7597e4d](7597e4d)) * enable integration with ADO ([#93](#93)) ([f3b0da4](f3b0da4)) --- 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: masterpointbot[bot] <177651640+masterpointbot[bot]@users.noreply.github.com>
what
azure_devops. Per the spacelift provider docs, allow users to integration with ADO.raw_git. Also setup the raw_git VCS setup.github_enterpriselogic allowingidto be null in accordance with it's variable declarationwhy
references
https://search.opentofu.org/provider/spacelift-io/spacelift/latest/docs/resources/stack#user-content-nestedblock--azure_devops
Summary by CodeRabbit