Skip to content

BL-255 | Add tofu command to cli #305

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 17 commits into
base: master
Choose a base branch
from

Conversation

angelofenoglio
Copy link
Contributor

@angelofenoglio angelofenoglio commented Apr 29, 2025

What?

  • Add support to use OpenTofu via the tofu command
  • Make tf be the shorthand for tofu instead of terraform

Why?

  • Start pivoting from Terraform into the opensource alternative OpenTofu

References

Summary by CodeRabbit

  • New Features

    • Introduced a new "tofu" command group for running OpenTofu commands, with enhanced cloud provider MFA handling.
    • Both "terraform" and "tofu" command groups now share the same set of subcommands and improved authentication support.
  • Refactor

    • Unified container logic under a single TFContainer class, supporting both Terraform and OpenTofu commands.
    • Updated command registration and imports to reflect the new container and command group structure.
    • Environment variables for Docker image configuration updated to prioritize TF_IMAGE and TF_IMAGE_TAG.
    • Renamed TerraformContainer to TFContainer with enhanced entrypoint flexibility for Terraform or OpenTofu.
    • Adjusted version validation logic to handle OpenTofu-specific versioning.
    • Updated related container inheritance and command imports across modules.
  • Tests

    • Added new unit tests for TFContainer.
    • Enhanced and refactored tests to support both Terraform and OpenTofu workflows.
    • Parameterized version validation tests to cover OpenTofu version scenarios.

Copy link
Contributor

coderabbitai bot commented Apr 29, 2025

"""

Walkthrough

The changes introduce support for both Terraform and OpenTofu by refactoring the container logic and command-line interface. The main container class is renamed and updated to select the appropriate binary based on a new parameter. Command groups for both Terraform and OpenTofu are established, sharing the same subcommands and logic. Imports and references across modules and tests are updated to use the new container class. Version validation logic is adjusted to handle OpenTofu-specific version tags. New and updated tests ensure correct behavior for both Terraform and OpenTofu workflows.

Changes

File(s) Change Summary
leverage/container.py, leverage/containers/kubectl.py, leverage/modules/project.py, leverage/modules/shell.py Renamed TerraformContainer to TFContainer, updated class inheritance, imports, and references. Added logic to select between Terraform and OpenTofu binaries based on a parameter.
leverage/modules/tf.py Added a new tofu command group mirroring the existing terraform group. Updated all subcommands to work with TFContainer. Registered subcommands with both groups. Refactored imports and type hints.
leverage/leverage.py Updated imports and version validation logic to handle OpenTofu. Adjusted command/alias registration for Terraform and Tofu.
leverage/modules/init.py Changed import to include both tofu and terraform from the .tf module.
leverage/modules/credentials.py Updated environment variable keys from TERRAFORM_IMAGE_TAG to TF_IMAGE_TAG for consistency.
tests/test_containers/test_terraform.py, tests/test_containers/test_tf.py Migrated tests from TerraformContainer to TFContainer. Added new tests for TFContainer covering environment, authentication, and credential refresh logic.
tests/test_conf.py Parameterized version validation test to cover both Terraform and OpenTofu version tag scenarios.
tests/test_modules/test_tf.py Updated imports to reference new module path for Terraform/Tofu logic.

Sequence Diagram(s)

sequenceDiagram
    participant CLI
    participant TFContainer
    participant Terraform
    participant OpenTofu

    CLI->>TFContainer: Initialize (terraform=True/False)
    alt terraform=True
        TFContainer->>Terraform: Set entrypoint to /bin/terraform
        CLI->>Terraform: Execute command
    else terraform=False
        TFContainer->>OpenTofu: Set entrypoint to /bin/tofu
        CLI->>OpenTofu: Execute command
    end
Loading
sequenceDiagram
    participant User
    participant CLI
    participant tofu_cmd_group
    participant terraform_cmd_group

    User->>CLI: Run 'tofu <subcommand>' or 'terraform <subcommand>'
    CLI->>tofu_cmd_group: If 'tofu', dispatch subcommand
    CLI->>terraform_cmd_group: If 'terraform', dispatch subcommand
    tofu_cmd_group->>TFContainer: Initialize (terraform=False)
    terraform_cmd_group->>TFContainer: Initialize (terraform=True)
    TFContainer->>AppropriateBinary: Run subcommand
Loading

Assessment against linked issues

Objective Addressed Explanation
Migration from Terraform to OpenTofu support, including refactoring containers and CLI (#255)
Update version validation logic to distinguish between Terraform and OpenTofu (#255)
Update tests and command registration for both Terraform and OpenTofu workflows (#255)

Poem

A rabbit hopped with joy anew,
For Tofu joined the Terraform crew!
Now both commands, side by side,
Can dig and build, and never hide.
With tests and code all fresh and bright,
The garden’s ready—deployments take flight!
🥕✨
"""

Note

⚡️ AI Code Reviews for VS Code, Cursor, Windsurf

CodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback.
Learn more here.


Note

⚡️ Faster reviews with caching

CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.
Enjoy the performance boost—your workflow just got faster.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 5462e08 and d025300.

📒 Files selected for processing (1)
  • leverage/containers/kubectl.py (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • leverage/containers/kubectl.py
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: integration_tests_cli_refarch (3.9.15, 1.5.0-0.2.0)
✨ Finishing Touches
  • 📝 Generate Docstrings

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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need 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)

  • @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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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)
tests/test_containers/test_terraform.py (1)

50-55: Hard-coded path couples test to container user

/home/leverage/… may change if CONTAINER_USER is altered. Derive the expected value from the class to keep the test resilient:

-assert tf_container.auth_method() == "/home/leverage/scripts/aws-mfa/aws-mfa-entrypoint.sh -- "
+expected = f"/home/{TFContainer.CONTAINER_USER}/scripts/aws-mfa/aws-mfa-entrypoint.sh -- "
+assert tf_container.auth_method() == expected
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2b9a201 and 7152554.

📒 Files selected for processing (8)
  • leverage/container.py (3 hunks)
  • leverage/containers/kubectl.py (3 hunks)
  • leverage/leverage.py (2 hunks)
  • leverage/modules/__init__.py (1 hunks)
  • leverage/modules/project.py (2 hunks)
  • leverage/modules/shell.py (2 hunks)
  • leverage/modules/terraform.py (12 hunks)
  • tests/test_containers/test_terraform.py (2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (5)
leverage/modules/__init__.py (1)
leverage/modules/terraform.py (2)
  • terraform (44-55)
  • tofu (27-38)
leverage/leverage.py (1)
leverage/modules/terraform.py (2)
  • tofu (27-38)
  • terraform (44-55)
leverage/containers/kubectl.py (1)
leverage/container.py (4)
  • TFContainer (436-687)
  • _start_with_output (267-279)
  • entrypoint (115-116)
  • entrypoint (119-120)
leverage/container.py (1)
leverage/modules/terraform.py (1)
  • terraform (44-55)
tests/test_containers/test_terraform.py (4)
leverage/container.py (5)
  • TFContainer (436-687)
  • start_shell (626-632)
  • enable_sso (547-549)
  • refresh_credentials (597-600)
  • auth_method (506-528)
tests/test_containers/__init__.py (1)
  • container_fixture_factory (12-22)
tests/conftest.py (1)
  • muted_click_context (48-50)
leverage/modules/terraform.py (1)
  • refresh_credentials (207-211)
🪛 Ruff (0.8.2)
leverage/modules/__init__.py

3-3: .terraform.tofu imported but unused; consider removing, adding to __all__, or using a redundant alias

(F401)


3-3: .terraform.terraform imported but unused; consider removing, adding to __all__, or using a redundant alias

(F401)

🪛 GitHub Actions: Tests | Lint w/ Black
leverage/container.py

[error] 1-1: Prettier formatting check failed. File would be reformatted.

leverage/modules/terraform.py

[error] 1-1: Prettier formatting check failed. File would be reformatted.

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: integration_tests_cli_refarch (3.9.15, 1.5.0-0.2.0)
🔇 Additional comments (13)
leverage/container.py (5)

436-439: Good rename for improved clarity

Renaming from TerraformContainer to TFContainer accurately reflects the container's new dual functionality supporting both Terraform and OpenTofu.


440-442: Well-defined constants for binary paths

The addition of TERRAFORM_BINARY and TOFU_BINARY constants provides clear references to the respective binaries and follows good programming practices by avoiding hardcoded string literals.


446-446: Good default choice for OpenTofu

The terraform parameter defaulting to False aligns well with the PR objective of transitioning from Terraform to OpenTofu, making OpenTofu the default choice.


479-479: Clean ternary implementation for binary selection

The conditional entrypoint setting is concise and effective, properly implementing the binary selection logic.


690-690: Consistent class inheritance update

The TFautomvContainer class now correctly inherits from the renamed TFContainer class, maintaining proper inheritance hierarchy.

leverage/modules/project.py (2)

24-24: Updated import to use new container class name

The import statement has been properly updated to reference the renamed TFContainer class.


329-329: Updated container instantiation

The code now correctly instantiates the renamed TFContainer class.

leverage/modules/__init__.py (1)

3-3:

✅ Verification successful

Added import for new tofu command

The import statement now includes both tofu and terraform, supporting the new CLI command structure. However, static analysis indicates these imports may be unused.

Let's verify that these imports are actually being used elsewhere in the codebase:


🏁 Script executed:

#!/bin/bash
# Check if these imports are used in the main CLI registration code
rg -A 5 -B 5 "from .modules import .*tofu" --type py

Length of output: 54


🏁 Script executed:

#!/bin/bash
# Search for any references to "tofu" across all Python files
rg -n "tofu" --type py

Length of output: 847


🏁 Script executed:

#!/bin/bash
# Search specifically for calls or registrations (e.g., tofu()) in the CLI
rg -n "tofu\(" --type py

Length of output: 92


Imports Confirmed in CLI Registration

The tofu and terraform imports in leverage/modules/__init__.py are actively used for CLI command setup:

• leverage/leverage.py:14 – imports tofu, terraform
• leverage/leverage.py:53–54 – registers tofu as a CLI command (with alias “tf”)

No changes required.

🧰 Tools
🪛 Ruff (0.8.2)

3-3: .terraform.tofu imported but unused; consider removing, adding to __all__, or using a redundant alias

(F401)


3-3: .terraform.terraform imported but unused; consider removing, adding to __all__, or using a redundant alias

(F401)

leverage/modules/shell.py (2)

4-4: Updated import to use new container class name

The import statement has been properly updated to reference the renamed TFContainer class.


31-33: Updated comment and container instantiation

Both the TODO comment and container instantiation have been properly updated to reference the renamed TFContainer class.

leverage/leverage.py (1)

53-55: Alias change may confuse existing users of the tf shorthand

tf used to point to the Terraform command but now maps to OpenTofu. Anyone relying on leverage tf … semantics will silently start using OpenTofu without noticing.

Consider at least one of the following:

  1. Emit a deprecation warning the first time the alias is invoked, explaining the switch.
  2. Keep the old alias for Terraform (tf-terraform or similar) during a grace period.
  3. Update all user-facing docs and completion scripts as part of this PR.

This will minimise surprises in automation and CI pipelines.

leverage/containers/kubectl.py (1)

27-32: Inheritance change looks good

Switching from TerraformContainer to TFContainer keeps the class aligned with the new unified container abstraction and removes redundant code.
No issues spotted here.

leverage/modules/terraform.py (1)

23-39: Good reuse pattern

Creating a separate tofu group that re-uses all existing sub-commands keeps the code DRY and makes future maintenance easier. Nice refactor!

@angelofenoglio angelofenoglio force-pushed the feat/add-opentofu-command branch from 7152554 to 8a74269 Compare May 5, 2025 16:12
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: 0

🧹 Nitpick comments (1)
leverage/modules/__init__.py (1)

3-3: Export new tofu command group alongside terraform.

Importing both tofu and terraform is necessary for the CLI’s dynamic command registration. To prevent F401 lint errors for unused imports in this module, explicitly declare them as public exports or suppress the warning:

Option A: Define __all__ to list public members:

 from .run import run
 from .project import project
-from .terraform import tofu, terraform
+from .terraform import tofu, terraform
+
+__all__ = [
+    "run",
+    "project",
+    "tofu",
+    "terraform",
+    "tfautomv",
+    "kubectl",
+    "shell",
+]

Option B: Add a noqa comment to silence the unused-import warning:

-from .terraform import tofu, terraform
+# noqa: F401
+from .terraform import tofu, terraform  # noqa: F401
🧰 Tools
🪛 Ruff (0.8.2)

3-3: .terraform.tofu imported but unused; consider removing, adding to __all__, or using a redundant alias

(F401)


3-3: .terraform.terraform imported but unused; consider removing, adding to __all__, or using a redundant alias

(F401)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7152554 and 8a74269.

📒 Files selected for processing (8)
  • leverage/container.py (3 hunks)
  • leverage/containers/kubectl.py (3 hunks)
  • leverage/leverage.py (2 hunks)
  • leverage/modules/__init__.py (1 hunks)
  • leverage/modules/project.py (2 hunks)
  • leverage/modules/shell.py (2 hunks)
  • leverage/modules/terraform.py (12 hunks)
  • tests/test_containers/test_terraform.py (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (7)
  • leverage/modules/project.py
  • leverage/modules/shell.py
  • leverage/leverage.py
  • leverage/containers/kubectl.py
  • tests/test_containers/test_terraform.py
  • leverage/container.py
  • leverage/modules/terraform.py
🧰 Additional context used
🧬 Code Graph Analysis (1)
leverage/modules/__init__.py (1)
leverage/modules/terraform.py (2)
  • terraform (44-55)
  • tofu (27-38)
🪛 Ruff (0.8.2)
leverage/modules/__init__.py

3-3: .terraform.tofu imported but unused; consider removing, adding to __all__, or using a redundant alias

(F401)


3-3: .terraform.terraform imported but unused; consider removing, adding to __all__, or using a redundant alias

(F401)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: integration_tests_cli_refarch (3.9.15, 1.5.0-0.2.0)

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: 0

🧹 Nitpick comments (1)
tests/test_conf.py (1)

66-68: Update test docstring to reflect OpenTofu support.

The docstring should be updated to mention the dual support for Terraform and OpenTofu, as the test now validates both scenarios.

    """
-   Test that we get a warning if we are working with a version lower than the required by the project.
+   Test that we get a warning if we are working with a version lower than the required by the project.
+   For OpenTofu configurations (with 'tofu' in the image tag), the Terraform version check is skipped.
    """
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cbbb861 and f1aadfe.

📒 Files selected for processing (2)
  • leverage/leverage.py (3 hunks)
  • tests/test_conf.py (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • leverage/leverage.py
🧰 Additional context used
🪛 GitHub Actions: Tests | Lint w/ Black
tests/test_conf.py

[error] 1-1: Prettier formatting check failed. Run 'black --write' to fix code style issues in this file.

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: integration_tests_cli_refarch (3.9.15, 1.5.0-0.2.0)
🔇 Additional comments (4)
tests/test_conf.py (4)

59-64: Parameterized test now appropriately handles both Terraform and OpenTofu scenarios.

The test has been updated to run with two different configurations: one for OpenTofu and one for Terraform. This approach ensures proper validation of version strings in both contexts.


71-71: Simplification of mock configuration.

The mock configuration has been updated to use the parameterized values, which makes the test more maintainable.


76-79: Conditional version warning assertion based on OpenTofu presence.

The test now conditionally checks for Terraform version warnings only when not using OpenTofu, which aligns with the expected behavior changes in the main code.


59-83:

❓ Verification inconclusive

Fix code formatting issues.

The pipeline failure indicates that the file has formatting issues. Please run Black formatter to resolve these issues.


🏁 Script executed:

#!/bin/bash
# Run black to check formatting issues
black --check tests/test_conf.py

Length of output: 130


Formatting check inconclusive – please verify Black is installed and formatting

It looks like the black command isn’t available in the sandbox, so we can’t confirm formatting automatically. To ensure pipeline success:

  • Install Black (e.g. pip install black) or add it to your CI environment.
  • Run black --check tests/test_conf.py locally to confirm there are no formatting issues.
  • Commit any changes Black suggests to keep code style consistent.

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

🔭 Outside diff range comments (1)
leverage/modules/tf.py (1)

347-351: ⚠️ Potential issue

List-comprehension bug – letter indexing instead of list indexing

arg[index - 1] indexes a character of the current argument string; you meant the previous argument in the list (args[index-1]).
This causes wrong filtering when stripping -backend-config pairs and will break for one-character arguments (IndexError).

-    args = [
-        arg
-        for index, arg in enumerate(args)
-        if not arg.startswith("-backend-config") or not arg[index - 1] == "-backend-config"
-    ]
+    args = [
+        arg
+        for index, arg in enumerate(args)
+        # Skip the value that immediately follows a -backend-config flag
+        if not arg.startswith("-backend-config") or (index == 0 or args[index - 1] != "-backend-config")
+    ]
🧰 Tools
🪛 Ruff (0.8.2)

350-350: Use arg[index - 1] != "-backend-config" instead of not arg[index - 1] == "-backend-config"

Replace with != operator

(SIM201)

🧹 Nitpick comments (2)
leverage/modules/__init__.py (1)

3-3: Unused imports reported by Ruff – expose them via __all__ or remove

tofu and terraform are imported for their side-effects but never referenced in this module, triggering F401.
If the intent is to make them part of the public API, explicitly list them in __all__; otherwise drop the import to silence the warning.

 from .tf import tofu, terraform
+
+# Public re-exports
+__all__ = [
+    "run",
+    "project",
+    "tofu",
+    "terraform",
+    "tfautomv",
+    "kubectl",
+    "shell",
+]
🧰 Tools
🪛 Ruff (0.8.2)

3-3: .tf.tofu imported but unused; consider removing, adding to __all__, or using a redundant alias

(F401)


3-3: .tf.terraform imported but unused; consider removing, adding to __all__, or using a redundant alias

(F401)

leverage/modules/tf.py (1)

221-236: Keep registration list and command set in sync

Manually maintaining the tuple of subcommands is error-prone (e.g., version already slipped through).
Consider collecting commands dynamically:

for _cmd in globals().values():
    if isinstance(_cmd, click.core.Command) and _cmd.name not in ("tofu", "terraform"):
        tofu.add_command(_cmd)
        terraform.add_command(_cmd)

This guarantees new commands are automatically exposed.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f1aadfe and a152691.

📒 Files selected for processing (4)
  • leverage/modules/__init__.py (1 hunks)
  • leverage/modules/tf.py (13 hunks)
  • tests/test_containers/test_tf.py (1 hunks)
  • tests/test_modules/test_tf.py (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • tests/test_modules/test_tf.py
🧰 Additional context used
🧬 Code Graph Analysis (2)
tests/test_containers/test_tf.py (3)
leverage/container.py (3)
  • TFContainer (436-686)
  • enable_sso (546-548)
  • auth_method (505-527)
tests/test_containers/__init__.py (1)
  • container_fixture_factory (12-22)
tests/conftest.py (1)
  • muted_click_context (48-50)
leverage/modules/__init__.py (1)
leverage/modules/tf.py (2)
  • tofu (28-39)
  • terraform (46-57)
🪛 Ruff (0.8.2)
leverage/modules/__init__.py

3-3: .tf.tofu imported but unused; consider removing, adding to __all__, or using a redundant alias

(F401)


3-3: .tf.terraform imported but unused; consider removing, adding to __all__, or using a redundant alias

(F401)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: integration_tests_cli_refarch (3.9.15, 1.5.0-0.2.0)

@coveralls
Copy link
Collaborator

coveralls commented May 5, 2025

Pull Request Test Coverage Report for Build 15054008083

Details

  • 48 of 57 (84.21%) changed or added relevant lines in 8 files are covered.
  • 41 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.2%) to 61.138%

Changes Missing Coverage Covered Lines Changed/Added Lines %
leverage/modules/project.py 1 2 50.0%
leverage/modules/shell.py 1 2 50.0%
leverage/modules/credentials.py 0 2 0.0%
leverage/modules/tf.py 23 28 82.14%
Files with Coverage Reduction New Missed Lines %
containers/kubectl.py 3 91.3%
container.py 38 61.9%
Totals Coverage Status
Change from base Build 14840926876: 0.2%
Covered Lines: 2606
Relevant Lines: 4130

💛 - Coveralls

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

Successfully merging this pull request may close these issues.

Feature | Starting with tf version 1.7 support and migrate from Terraform to OpenTofu
3 participants