Skip to content

Conversation

@RoseSecurity
Copy link
Contributor

@RoseSecurity RoseSecurity commented Mar 17, 2025

what

This pull request includes a small change to the src/main.tf file. The change modifies the way name_suffix and name values are accessed within the locals block.

  • src/main.tf: Updated the access method for name_suffix and name values to use direct key access instead of the lookup function.

why

  • lookup(map, key) was useful in older Terraform versions when maps were sometimes nullable. Direct indexing (map["key"]) is now preferred because it is more readable, Terraform explicitly fails if the key doesn’t exist, and it aligns with standard programming practices

references

Summary by CodeRabbit

  • Chores
    • Updated Datadog configuration to use a specific remote module source and version.
    • Improved variable access method for name suffix in CloudWatch forwarder log groups.

lookup(map, key) was useful in older Terraform versions when maps were sometimes nullable. Direct indexing (map["key"]) is now preferred because it is more readable, Terraform explicitly fails if the key doesn’t exist, and it aligns with standard programming practices
@RoseSecurity RoseSecurity requested review from a team as code owners March 17, 2025 12:35
@coderabbitai
Copy link

coderabbitai bot commented Mar 17, 2025

Walkthrough

The pull request modifies the Terraform configuration in src/main.tf by changing how the name_suffix is accessed within the cloudwatch_forwarder_log_groups map. Instead of using the lookup function with a default value of null, the code now directly accesses v["name_suffix"]. The conditional logic that formats the name based on the presence of a name_suffix remains unchanged. Additionally, in src/provider-datadog.tf, the source attribute for the module "datadog_configuration" has been updated from a relative path to a GitHub URL with a version reference. There are no changes to any exported or public entities.

Changes

File Change Summary
src/main.tf Changed access of name_suffix in cloudwatch_forwarder_log_groups from lookup with default to direct v["name_suffix"] access.
src/provider-datadog.tf Updated module "datadog_configuration" source attribute from relative path to GitHub URL with version reference.

Poem

I'm a cheerful rabbit, hopping amidst the code,
Swapping lookup magic for a direct access mode.
In Terraform fields where logic brightly blooms,
I celebrate the changes in these configuration rooms.
With whiskers twitching and paws all aglow, 🐰
I dance in delight as the cleaner method now shows!


📜 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 2b9d69b and 616d99f.

📒 Files selected for processing (1)
  • src/provider-datadog.tf (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/provider-datadog.tf
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Summary

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

@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)
src/main.tf (1)

15-16: Direct Indexing for name_suffix Updated
The change replaces the use of the lookup function with direct key access (v["name_suffix"]), which improves readability and ensures Terraform explicitly fails if the key is missing. However, note that the conditional check on line 10 still uses lookup(v, "name_suffix", null) != null. For consistency and clearer intent, consider updating this condition to use direct indexing as well (e.g., v["name_suffix"] != null).

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 1265f13 and 1ce96ca.

📒 Files selected for processing (1)
  • src/main.tf (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Mergify Merge Protections
  • GitHub Check: Mergify Merge Protections
  • GitHub Check: Summary

@Gowiem Gowiem added the patch A minor, backward compatible change label Mar 17, 2025
Gowiem
Gowiem previously approved these changes Mar 17, 2025
Copy link
Contributor

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

:shipit: !

@Gowiem
Copy link
Contributor

Gowiem commented Mar 17, 2025

@RoseSecurity linting is unhappy, mind digging in?


│ Error: Unreadable module directory
│ 
│ Unable to evaluate directory symlink: lstat ../datadog-configuration: no
│ such file or directory
╵
╷
│ Error: Unreadable module directory
│ 
│ The directory  could not be read for module "datadog_configuration" at
│ provider-datadog.tf:1.

@RoseSecurity
Copy link
Contributor Author

@RoseSecurity linting is unhappy, mind digging in?


│ Error: Unreadable module directory
│ 
│ Unable to evaluate directory symlink: lstat ../datadog-configuration: no
│ such file or directory
╵
╷
│ Error: Unreadable module directory
│ 
│ The directory  could not be read for module "datadog_configuration" at
│ provider-datadog.tf:1.

Ah, good catch. This might take some reworking

@mergify mergify bot added the needs-test Needs testing label Mar 18, 2025
@mergify
Copy link

mergify bot commented Apr 10, 2025

Heads up! This pull request looks stale. It will be closed soon, if there are no new commits. ⏳

@mergify mergify bot added stale This PR has gone stale and removed stale This PR has gone stale labels Apr 10, 2025
@mergify
Copy link

mergify bot commented Apr 20, 2025

Heads up! This pull request looks stale. It will be closed soon, if there are no new commits. ⏳

@mergify mergify bot added stale This PR has gone stale and removed stale This PR has gone stale labels Apr 20, 2025
@mergify
Copy link

mergify bot commented Apr 27, 2025

Heads up! This pull request looks stale. It will be closed soon, if there are no new commits. ⏳

@mergify mergify bot added stale This PR has gone stale and removed stale This PR has gone stale labels Apr 27, 2025
@mergify
Copy link

mergify bot commented May 4, 2025

Heads up! This pull request looks stale. It will be closed soon, if there are no new commits. ⏳

@mergify mergify bot added stale This PR has gone stale and removed stale This PR has gone stale labels May 4, 2025
@RoseSecurity
Copy link
Contributor Author

These components are an interesting case because we don't have a test account to run the Terratests in

@RoseSecurity
Copy link
Contributor Author

/terratest

@mergify
Copy link

mergify bot commented May 19, 2025

Heads up! This pull request looks stale. It will be closed soon, if there are no new commits. ⏳

@mergify mergify bot added stale This PR has gone stale and removed stale This PR has gone stale labels May 19, 2025
@mergify
Copy link

mergify bot commented May 26, 2025

Heads up! This pull request looks stale. It will be closed soon, if there are no new commits. ⏳

@mergify mergify bot added stale This PR has gone stale and removed stale This PR has gone stale labels May 26, 2025
@mergify mergify bot requested a review from a team May 30, 2025 13:26
cloudpossebot
cloudpossebot previously approved these changes Jun 2, 2025
@goruha goruha requested a review from cloudpossebot June 3, 2025 13:08
Copy link

@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: 1

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between b8c3462 and b99db20.

📒 Files selected for processing (1)
  • src/provider-datadog.tf (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Summary

@goruha goruha enabled auto-merge June 3, 2025 21:41
@goruha goruha requested a review from Gowiem June 3, 2025 21:46
@goruha goruha added this pull request to the merge queue Jun 3, 2025
@mergify mergify bot requested a review from a team June 3, 2025 21:49
Merged via the queue into main with commit 63ef5c5 Jun 3, 2025
24 of 26 checks passed
@goruha goruha deleted the fix-deprecated-lookup-function branch June 3, 2025 21:51
@github-actions
Copy link

github-actions bot commented Jun 3, 2025

These changes were released in v1.535.1.

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

Labels

needs-test Needs testing patch A minor, backward compatible change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants