Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: Adding explicit test for missing dependency #3915

Conversation

yhakbar
Copy link
Collaborator

@yhakbar yhakbar commented Feb 21, 2025

Description

#3910 made me think this was a bug, but it's actually working as intended.

Adding this scenario to the disabled fixture proves that it works in the future.

TODOs

Read the Gruntwork contribution guidelines.

  • Update the docs.
  • Run the relevant tests successfully, including pre-commit checks.
  • Ensure any 3rd party code adheres with our license policy or delete this line if its not applicable.
  • Include release notes. If this PR is backward incompatible, include a migration guide.

Release Notes (draft)

Updated disabled fixture.

Summary by CodeRabbit

  • New Features

    • Introduced an additional dependency configuration to enhance modular control.
  • Refactor

    • Renamed and updated existing dependency settings to consistently reflect enabled and disabled states.
    • Updated system validations to align with the refined dependency structure and naming conventions.

Copy link

vercel bot commented Feb 21, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
terragrunt-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 21, 2025 1:58pm

Copy link
Contributor

coderabbitai bot commented Feb 21, 2025

Walkthrough

This pull request updates the dependency declarations in the Terragrunt configuration file and adjusts the integration test to reflect the new naming conventions. Three existing dependencies are renamed with updated configuration paths and enabled states, and one new dependency is added. The test now asserts outputs based on the newly defined unit names, keeping the overall structure and logic intact.

Changes

File Change Summary
test/.../terragrunt.hcl Renamed dependencies: "m1" ➔ "unit_without_enabled", "m2" ➔ "unit_disabled" (enabled false), "m3" ➔ "unit_enabled" (enabled true); added dependency "unit_missing" (enabled false) with updated config_path values.
test/integration_test.go Updated TestTerragruntDisabledDependency to assert output paths with new unit names: "unit-without-enabled", "unit-disabled", and "unit-enabled".

Sequence Diagram(s)

Possibly related PRs

Suggested reviewers

  • levkohimins
  • denis256

Poem

In the code’s quiet symphony, names are reborn,
Paths align at the crisp break of dawn.
Dependencies twist in a brand-new dance,
Tests keep time in their steady advance.
Here's to clean code and a fresh, bright start—
A merry module waltz from the heart!


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4ea5d08 and 462e409.

📒 Files selected for processing (2)
  • test/fixtures/disabled/app/terragrunt.hcl (1 hunks)
  • test/integration_test.go (1 hunks)
🔇 Additional comments (5)
test/integration_test.go (1)

3650-3651: Improved test path naming for better clarity

The renaming of test paths from generic names (m1, m2, m3) to descriptive names (unit-without-enabled, unit-disabled, unit-enabled) makes the test's purpose much clearer. This helps developers understand the test scenarios without having to dig into the implementation.

Also applies to: 3659-3659

test/fixtures/disabled/app/terragrunt.hcl (4)

1-2: Updated dependency "unit_without_enabled" configuration looks great!
The dependency block now clearly reflects the updated naming and path. The configuration is concise and matches our naming conventions, so everything’s in order here.


8-10: Dependency "unit_disabled" updated successfully.
The config path and the enabled = false attribute have been correctly set, ensuring that this dependency is intentionally disabled as expected. Nice and clear!


17-19: Good job on updating "unit_enabled".
The block now reflects the proper name, correct config_path, and is clearly marked as enabled. This update nicely aligns with the new naming conventions described in the PR objectives.


26-29: New dependency "unit_missing" added appropriately.
This block is a succinct addition meant to simulate a missing dependency scenario. The absence of mock_outputs appears intentional for testing purposes, and the settings (config_path and enabled = false) are spot on. If needed, consider adding a comment to clarify that the lack of outputs is intended for the test.

✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

🪧 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. (Beta)
  • @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.

@yhakbar yhakbar marked this pull request as ready for review February 21, 2025 14:51
@yhakbar yhakbar merged commit fb4b493 into main Feb 21, 2025
9 checks passed
@yhakbar yhakbar deleted the yousif/tg-1000-error-returned-when-dependency-path-does-not-exist-and branch February 21, 2025 16:40
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants