Skip to content

feat(spaces): adds spaces + consolidates with the template #62

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

gberenice
Copy link
Member

@gberenice gberenice commented Apr 25, 2025

what

  • This adds Spacelift Spaces and tests for them
  • Introduces a bunch of fixes and improvements from template module.

why

  • Keeping our automation modules in order.

references

Summary by CodeRabbit

  • New Features
    • Added support for managing multiple Spacelift Spaces dynamically via a new input variable.
    • Introduced a new resource for Spacelift Spaces with configurable attributes.
  • Documentation
    • Enhanced README with branding, organizational info, contribution guidelines, and updated Terraform provider constraints.
    • Added and updated configuration files for automated documentation generation.
  • Chores
    • Updated code owners and improved various configuration files for review, linting, and automation tools.
    • Upgraded tool and action versions across workflows and dependency management.
  • Tests
    • Added and updated tests to verify correct creation and configuration of Spacelift Spaces.

@gberenice gberenice requested a review from a team as a code owner April 25, 2025 16:16
@gberenice gberenice requested a review from a team April 25, 2025 16:16
Copy link
Contributor

coderabbitai bot commented Apr 25, 2025

Walkthrough

This set of changes introduces several updates across configuration, documentation, and Terraform code. The README.md is extensively restructured with new branding, organizational information, and expanded contribution guidelines. A new input variable, spaces, is added to variables.tf, allowing users to define multiple Spacelift Spaces with configurable attributes. Correspondingly, main.tf introduces a spacelift_space resource block that dynamically creates resources based on the spaces map. Test coverage is enhanced with a new test verifying correct creation of default spaces. Multiple configuration files are updated: .coderabbit.yaml refines review behavior and output verbosity, .github/renovate.json5 adjusts scheduling and automerge rules, and .trunk/trunk.yaml upgrades linter/plugin versions. The .terraform-docs.yaml file is added, replacing .terraform-docs.yml, to update documentation generation settings. Other minor changes include updates to workflow permissions, .gitignore, and tool versions in aqua.yaml.

Possibly related PRs

Suggested reviewers

  • Gowiem

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
aqua.yaml (1)

13-19: Consider enabling checksum verification.

To improve security and integrity of downloaded binaries, you may want to configure checksum.enabled = true and provide expected checksums for key packages (e.g., terraform, spacectl).

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0fa4144 and cd6acad.

📒 Files selected for processing (16)
  • .coderabbit.yaml (2 hunks)
  • .github/CODEOWNERS (1 hunks)
  • .github/configs/.prettierignore (0 hunks)
  • .github/renovate.json5 (1 hunks)
  • .github/workflows/release-please.yaml (1 hunks)
  • .github/workflows/test.yaml (2 hunks)
  • .gitignore (1 hunks)
  • .terraform-docs.yaml (1 hunks)
  • .terraform-docs.yml (0 hunks)
  • .trunk/configs/.markdownlint.yaml (1 hunks)
  • .trunk/trunk.yaml (2 hunks)
  • README.md (6 hunks)
  • aqua.yaml (1 hunks)
  • main.tf (1 hunks)
  • tests/main.tftest.hcl (3 hunks)
  • variables.tf (1 hunks)
💤 Files with no reviewable changes (2)
  • .github/configs/.prettierignore
  • .terraform-docs.yml
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.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.or...

**/*.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.

  • main.tf
  • variables.tf
🔇 Additional comments (33)
.gitignore (1)

33-33: Good addition to the ignore list!

Adding backend.tf.json to the gitignore is a best practice for Terraform/OpenTofu projects, as these files often contain environment-specific configurations that shouldn't be committed to version control.

.trunk/configs/.markdownlint.yaml (1)

15-18: Good configuration adjustment for markdown linting

Disabling the line length rule (MD013) is appropriate for documentation that might contain long code examples, tables, or URLs that are impractical to break up. The clear comment explaining the rule's purpose improves maintainability.

.terraform-docs.yaml (1)

1-16: Well-structured terraform-docs configuration

This configuration follows best practices for the terraform-docs tool:

  • Pinning to a specific version (0.20.0) prevents unexpected changes
  • The markdown table format is readable and widely compatible
  • Injection mode with HTML comment markers is the standard approach for integrating generated docs into README.md

The configuration will help maintain consistent and up-to-date documentation for the Terraform module.

.trunk/trunk.yaml (3)

5-5: Good update to the Trunk CLI version

Keeping the CLI version up-to-date ensures you have the latest features and bug fixes.


25-32: Appropriate linter version updates

Updating linter versions is good maintenance practice to get the latest security patches, bug fixes, and improvements. This change updates multiple linters to their newer versions.


37-40: Improved CHANGELOG ignore configuration

This change makes the ignore rules more comprehensive by:

  1. Ignoring all linters for CHANGELOG.md files (not just specific ones)
  2. Using a glob pattern to catch CHANGELOG.md files in any directory
  3. Adding a clear comment explaining that release-please manages these files

This prevents linting tools from conflicting with the auto-generated content.

.github/renovate.json5 (6)

3-4: Good adoption of Renovate best practices

Extending from "config:best-practices" and upgrading the aqua-renovate-config version follows recommended configurations for Renovate. This will ensure your dependency management follows current best practices.


6-8: Sensible scheduling update

Running Renovate "after 9am on the first day of the month" is a good approach as it:

  • Runs during working hours when team members can address any issues
  • Reduces noise by batching updates monthly while still keeping dependencies current

9-13: Good automation improvements

Using assigneesFromCodeOwners: true ensures PRs are assigned to the right people, and changing to addLabels follows newer Renovate syntax while ensuring existing labels are preserved.


14-16: Explicit Terraform management

Explicitly enabling the Terraform manager is a good practice to ensure Terraform dependencies are properly managed.


19-19: Helpful comment addition

Adding the comment explaining the purpose of ignoring context.tf improves code maintainability by documenting the reasoning.


22-36: More conservative automerge configuration

Restricting automerge to only apply to optionalDependencies and excluding major version updates is a safer approach than broader automerge rules. This reduces the risk of breaking changes being automatically merged.

.github/workflows/release-please.yaml (1)

11-11: Appropriate permission addition for issue creation.

Granting issues: write aligns with workflows that create or manage issues via release-please.

.github/CODEOWNERS (1)

7-7: Update default code owners for open source.

Switching to @masterpointio/masterpoint-open-source correctly aligns with the repository’s open-source onboarding. Ensure this team has appropriate review rights.

aqua.yaml (1)

11-11: Upgrade standard registry version.

Bumping aqua-registry to v4.353.0 is consistent with other tooling updates in this PR. Version constraint seems safe.

tests/main.tftest.hcl (3)

591-595: Approve dynamic depends-on label.
Switching to depends-on:spacelift-automation-${terraform.workspace} makes the test resilient across workspaces by avoiding hardcoded defaults. Nice improvement!


662-667: Approve default space resolution test.
Verifying that local.resolved_space_ids[...] == "root" aligns with the new default-space behavior. Test accurately captures the intended resolution.


684-692: Approve new space creation test.
The test_spaces_are_created_correctly assertion for spacelift_space.default.id == "root" properly covers the new Terraform resource. Well added!

.coderabbit.yaml (4)

10-10: Approve conciseness instruction.
Adding “Be concise and only comment on significant issues.” refines the review tone as intended.


31-33: Approve disabling incremental review.
Explicitly setting auto_incremental_review: false and clarifying ignore-title-keywords behavior aligns with the updated review workflow.


41-43: Approve enhanced Terraform path instructions.
The added context under path_instructions guides the reviewer to leverage Terraform expertise and ecosystem best practices—well scoped.


44-48: Approve output verbosity flags.
Disabling changed_files_summary, poem, review_status, and sequence_diagrams correctly streamlines feedback per the PR objectives.

.github/workflows/test.yaml (5)

23-23: Approve job name emoji addition.
Prefixing the test job name with an emoji is a harmless, user-friendly touch that doesn’t affect functionality.


29-29: Approve checkout action pinning.
Locking actions/checkout to a specific commit hash improves reproducibility and security.


32-33: Approve cache action pinning.
Updating actions/cache to v4.2.3 via commit hash ensures a known, stable version.


41-42: Approve Aqua installer action bump.
Upgrading aquaproj/aqua-installer to v3.2.1 via commit pin is a best practice for CI consistency.


43-44: Approve Aqua version bump.
Bumping aqua_version to v2.48.1 aligns with updated tooling in aqua.yaml—great coordination.

README.md (6)

1-7: Great branding and engagement.
Introducing a banner image, clear title, and styled release badge elevates the README’s first impression and aligns with project branding.


13-13: Trivial formatting change.
The “### Overview” heading helps structure the doc but is purely cosmetic. No action required.


247-248: Update provider version constraints.
Relaxing the jsonschema and spacelift provider constraints to >= versions enhances compatibility while ensuring minimum requirements.


263-263: Document new resource.
Adding [spacelift_space.default] to the resources list accurately reflects the new Terraform functionality for spaces.


316-316: Document new input variable.
Introducing the spaces map input in the inputs table matches the module’s capability to define multiple Spacelift Spaces.


331-341: Acknowledge contributor section.
The new “Built By” and contribution guidelines foster community engagement and clarify how others can help.

Comment on lines +876 to +877
# Test that spaces are created with all required attributes
run "test_spaces_are_created_with_required_attributes" {
Copy link
Member

Choose a reason for hiding this comment

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

These are thorough tests 🙌

Copy link
Member

@Gowiem Gowiem left a comment

Choose a reason for hiding this comment

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

Good stuff @gberenice! :shipit:

@gberenice
Copy link
Member Author

Crap, everything failed. Working on fixes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants