atmos
atmos copied to clipboard
Set custom user agent for Terraform providers
what
- Atmos command should now set TF_APPEND_USER_AGENT environment variable which terraform will use when interacting with AWS provider.
why
- Customer user agent is missing for Terraform, it will helps differentiate atmos driven actions from others, with this change users should be able to identify and monitor operations initiated by atmos.
testing listing s3 buckets and log output in cloudtrial
references
#DEV-2337
Summary by CodeRabbit
-
New Features
- Introduced a new
AppendUserAgentfield in Terraform configurations, allowing users to specify a user agent string for enhanced metadata. - Updated the logic for the
terraform deploycommand to improve command handling and environment variable management.
- Introduced a new
-
Bug Fixes
- Enhanced handling of the
auto-approveflag based on user input and configuration settings.
- Enhanced handling of the
[!WARNING]
Rate limit exceeded
@aknysh has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 13 minutes and 51 seconds before requesting another review.
β How to resolve this issue?
After the wait time has elapsed, a review can be triggered using the
@coderabbitai reviewcommand as a PR comment. Alternatively, push new commits to this PR.We recommend that you space out your commits to avoid hitting the rate limit.
π¦ How do rate limits work?
CodeRabbit enforces hourly rate limits for each developer per organization.
Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.
Please see our FAQ for further information.
π₯ Commits
Files that changed from the base of the PR and between 455f9d8d08a8bb3ef0b16a8921ea3a1b1ed3a9de and 2bf45dcdaf417d111785dcbf60214f3f7fd922bd.
π Walkthrough
π Walkthrough
π Walkthrough
π Walkthrough
π Walkthrough
Walkthrough
The changes in this pull request primarily focus on enhancing the handling of user agent strings within the Atmos CLI, specifically for Terraform commands. Modifications include the introduction of new fields and flags for user agent management, updates to configuration files, and documentation enhancements to clarify these new features. The changes also involve a shift in how version information is managed across various files, reflecting a restructuring of the codebase.
Changes
| File | Change Summary |
|---|---|
| internal/exec/terraform.go | Modified ExecuteTerraform to manage TF_APPEND_USER_AGENT, updated handling for terraform deploy. |
| pkg/schema/schema.go | Added AppendUserAgent field to Terraform and ArgsAndFlagsInfo structs. |
| pkg/config/config.go | Added AppendUserAgent field to defaultCliConfig, updated InitCliConfig for user agent initialization. |
| pkg/config/utils.go | Introduced handling for ATMOS_COMPONENTS_TERRAFORM_APPEND_USER_AGENT environment variable. |
| .goreleaser.yml | Updated ldflags to change version flag import path. |
| Makefile | Updated ldflags in the build target to change version variable path. |
| build.sh | Modified go build command to update version variable path. |
| cmd/version.go | Removed hardcoded version variable, replaced with dynamic import from version package. |
| internal/exec/utils.go | Added cfg.AppendUserAgentFlag for command-line flag processing, updated info.AppendUserAgent. |
| pkg/config/const.go | Added constant AppendUserAgentFlag for command-line usage. |
| pkg/version/version.go | Introduced new version package with a dynamic Version variable. |
| website/docs/quick-start/install-atmos.mdx | Updated installation instructions to reflect new version variable path. |
| internal/exec/help.go | Added help message for the --append-user-agent flag. |
| website/src/components/Screengrabs/atmos-terraform--help.html | Updated help documentation for atmos command with new flag details. |
| website/docs/cli/commands/terraform/usage.mdx | Updated atmos terraform command documentation with new flags and features. |
| website/docs/core-concepts/projects/configuration/terraform.mdx | Added append_user_agent configuration option to Terraform settings in YAML. |
Possibly related PRs
- #549: The changes in this PR enhance the installation instructions, which may indirectly relate to the user experience improvements from the main PR's updates to the
ExecuteTerraformfunction and environment variable handling. - #720: This PR adds a guide for installing Atmos using
aqua, which is relevant as it provides users with additional methods to set up the environment that could utilize the new features introduced in the main PR. - #724: This PR modifies the help command behavior, which is directly related to the user experience improvements in the main PR, particularly regarding how commands are processed and displayed to users.
Suggested labels
minor
Suggested reviewers
- osterman
- aknysh
- hans-d
- joe-niland
Poem
In the garden of code, a new flag does bloom,
--append-user-agent, dispelling the gloom.
With user agents now set, our requests take flight,
In the world of Terraform, everything feels right.
So hop along, friends, letβs build and deploy,
With Atmos in hand, weβll code with great joy! πβ¨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
πͺ§ 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
@coderabbitaiin 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
@coderabbitaiin 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 pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository.@coderabbitai full reviewto do a full review from scratch and review all the files again.@coderabbitai summaryto regenerate the summary of the PR.@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai configurationto show the current CodeRabbit configuration for the repository.@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
CodeRabbit Configuration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile 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.
I guess we should move the static version to dynamic using AppendUserAgent: fmt.Sprintf("Cloud Posse Atmos %s (https://atmos.tools)", AtmosVersion),
@Cerebrovinny thanks for the screenshot. Looks like we're not following the general UA convention.
Let's change to: Atmos/1.181 (Cloud Posse; +https://atmos.tools)
For reference, see: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent
These changes were released in v1.96.0.