fix(schema): allow http as a valid terraform backend_type - #2920
fix(schema): allow http as a valid terraform backend_type#2920Rémy Macherel (MacherelR) wants to merge 2 commits into
Conversation
The atmos-manifest JSON Schema's backend_type/remote_state_backend_type enum and backend_manifest properties hardcoded 8 backend types (local, s3, remote, vault, static, azurerm, gcs, cloud) and rejected Terraform/ OpenTofu's generic `http` backend, used e.g. for GitLab-managed Terraform state. Since schema validation of imported/mixin files was recently fixed to actually run, any manifest using `backend_type: http` now fails `atmos describe stacks` (and anything that calls it, e.g. `terraform plan/apply`) outright, even though backend generation itself (generateComponentBackendConfig) has always handled arbitrary backend types generically. Add "http" to both enums and to backend_manifest.properties, mirroring the existing entries. Also update the test fixture copy of the schema to keep it in sync, document the HTTP backend in the backend-config docs partial, and add a regression test proving backend_type: http now passes validation with the default embedded schema. closes cloudposse#2919
|
Tip Atmos Pro
No affected stacks workflow was detected for this pull request. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe manifest schemas now accept HTTP Terraform and remote-state backends. Validation tests cover HTTP backend configurations. Documentation describes endpoints, locking, authentication, and generated JSON. ChangesHTTP backend support
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@internal/exec/validate_stacks_test.go`:
- Around line 251-260: The manifest test case around the existing HTTP backend
configuration only covers components. Add a table-driven scenario that
configures and validates remote-state HTTP settings using
remote_state_backend_type: http and remote_state_backend.http, including
representative address and lock/unlock fields, while preserving the existing
backend case and expected validation behavior.
In `@website/docs/stacks/_partials/_backend-config.mdx`:
- Around line 295-308: Update the Generated File example in the backend
configuration documentation to explicitly warn that backend.tf.json contains
credentials, including the expanded CI_JOB_TOKEN password, and must not be
committed, logged, or uploaded as an artifact.
- Around line 291-292: Update the backend configuration credentials to read
CI_JOB_TOKEN from the process environment using the supported env lookup syntax,
or first map it through the component env section with !env and reference that
mapping. Preserve the existing GitLab username and password configuration.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 071d042f-f31c-4f4f-95ec-b8daf2ed3537
📒 Files selected for processing (4)
internal/exec/validate_stacks_test.gopkg/datafetcher/schema/atmos/manifest/1.0.jsontests/fixtures/schemas/atmos/atmos-manifest/1.0/atmos-manifest.jsonwebsite/docs/stacks/_partials/_backend-config.mdx
|
Thanks for the PR! Rémy Macherel (@MacherelR) please address the coderabbit review comments. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2920 +/- ##
==========================================
- Coverage 82.83% 82.82% -0.02%
==========================================
Files 1866 1866
Lines 181277 181277
==========================================
- Hits 150160 150135 -25
- Misses 23313 23327 +14
- Partials 7804 7815 +11
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
The atmos-manifest JSON Schema's backend_type/remote_state_backend_type enum and backend_manifest properties hardcoded 8 backend types (local, s3, remote, vault, static, azurerm, gcs, cloud) and rejected Terraform/ OpenTofu's generic
httpbackend, used e.g. for GitLab-managed Terraform state. Since schema validation of imported/mixin files was recently fixed to actually run, any manifest usingbackend_type: httpnow failsatmos describe stacks(and anything that calls it, e.g.terraform plan/apply) outright, even though backend generation itself (generateComponentBackendConfig) has always handled arbitrary backend types generically.Add "http" to both enums and to backend_manifest.properties, mirroring the existing entries. Also update the test fixture copy of the schema to keep it in sync, document the HTTP backend in the backend-config docs partial, and add a regression test proving backend_type: http now passes validation with the default embedded schema.
closes #2919
Summary by CodeRabbit
New Features
Documentation