Skip to content
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

Implement Atmos Version Check Configuration #844

Merged
merged 19 commits into from
Dec 15, 2024
Merged

Implement Atmos Version Check Configuration #844

merged 19 commits into from
Dec 15, 2024

Conversation

Listener430
Copy link
Collaborator

@Listener430 Listener430 commented Dec 11, 2024

what

This PR contains

  1. the fix of unintended upgrade box display for some commands (see before screenshot below)
  2. Cache mechanism for setting upgrade message box display frequency
  3. updates to the docs/website (both help and version)

Here are some comments/illustrations

before for non --help command the update box untintendently appear

terraform_apply_before_fix
after the fix
terraform_apply_after_fix

additionally added config in atmos.yaml
atmosyaml
with defualt config deined as
default_config
and env variable to disable everuthing if user does not want this feature displayed at all except version in config/utils.go

	versionEnabled := os.Getenv("ATMOS_VERSION_CHECK_ENABLED")
	if len(versionEnabled) > 0 {
		u.LogTrace(*cliConfig, fmt.Sprintf("Found ENV var ATMOS_VERSION_CHECK_ENABLED=%s", versionEnabled))
		enabled, err := strconv.ParseBool(versionEnabled)
		if err != nil {
			u.LogWarning(*cliConfig, fmt.Sprintf("Invalid boolean value '%s' for ATMOS_VERSION_CHECK_ENABLED; using default.", versionEnabled))
		} else {
			cliConfig.Version.Check.Enabled = enabled
		}
		cliConfig.Version.Check.Enabled = enabled
	}

after the first --help run on any command box appears: example terrraform

upgrade_box_upper
upgradebox_down_part
then atmos/cache.yaml is generated with time stamp

cache_yaml

and the box disspaers until the time interval exceed specidifed in config
atmos_secondtime_running_help_no_box

why

  • Remove unnecessary upgrade box for some commands
  • Introduce config mechanism to turn on/off the update notifications or their frequency

references

Link to the ticket - https://linear.app/cloudposse/issue/DEV-2815/atmos-version-check-configuration

Summary by CodeRabbit

Release Notes

  • New Features

    • Added version checking capabilities, allowing users to configure checks in atmos.yaml.
    • Introduced a --check flag for the version command to force update checks.
  • Bug Fixes

    • Enhanced error handling for CLI configuration initialization.
  • Documentation

    • Updated help command documentation to include information about periodic version checks.
    • Expanded version command documentation with details on configurable update check frequency and usage examples.
    • Enhanced documentation for the CLI configuration, detailing the structure and loading hierarchy of atmos.yaml.
    • Updated Atlantis integration documentation to clarify configuration methods and examples.
  • Chores

    • Added a new dependency for file locking in cache management.
    • Updated Dockerfile to specify the latest version of the Atmos tool.
    • Added a new entry to .gitignore for .atmos/cache.yaml.

@Listener430 Listener430 added enhancement New feature or request bugfix Change that restores intended behavior labels Dec 11, 2024
@Listener430 Listener430 self-assigned this Dec 11, 2024
pkg/config/cache.go Outdated Show resolved Hide resolved
@osterman
Copy link
Member

osterman commented Dec 11, 2024

Update documentation here: https://atmos.tools/cli/

Also, here: https://atmos.tools/cli/commands/version

@osterman osterman changed the title DEV-2815 Implement Atmos Version Check Configuration Dec 11, 2024
@Listener430 Listener430 marked this pull request as ready for review December 11, 2024 18:25
@Listener430 Listener430 requested review from a team as code owners December 11, 2024 18:25
Copy link
Contributor

coderabbitai bot commented Dec 11, 2024

Caution

Review failed

The pull request is closed.

📝 Walkthrough
📝 Walkthrough

Walkthrough

The pull request introduces a comprehensive version checking mechanism for the Atmos CLI. A new configuration section in atmos.yaml allows users to control version checks, with options to enable/disable checks, set timeout duration, and specify check frequency. The implementation includes a caching system using file locking, environment variable support, and conditional update checks across various CLI commands. The changes provide more granular control over version update notifications while addressing performance concerns.

Changes

File Change Summary
atmos.yaml Added version.check configuration with enabled, timeout, and frequency properties
cmd/... Refactored version check logic across multiple command files (helmfile.go, terraform.go, version.go, root.go, cmd_utils.go)
pkg/config/... Added cache management, version check configuration, and environment variable processing
pkg/schema/schema.go Introduced new types for version checking configuration
go.mod Added github.com/gofrs/flock dependency
website/docs/... Updated documentation for version command and help command

Assessment against linked issues

Objective Addressed Explanation
Version check only on version command or --help
Configurable version check settings
Introduce cache file for metadata
Configurable timeout

Possibly related PRs

  • Implement Atmos Version Check Configuration #844: The main PR introduces a new section for version checking in atmos.yaml, which is related to the updates in the JSON schema for Atmos manifests that include a new enabled property in the metadata definition.
  • add support for terraform version #846: The main PR's focus on versioning is connected to the changes made in this PR, which adds support for the version subcommand in Terraform commands, enhancing the overall version management capabilities.
  • feat: add pagination and searching to atmos docs command #848: The main PR's improvements to the help command can be related to the enhancements made in this PR, which adds pagination and searching functionalities to the atmos docs command, improving user experience.
  • Add support for helmfile version command #854: The main PR's introduction of the helmfile version command is directly related to this PR, which adds support for the version subcommand in the helmfile command execution.

Suggested Reviewers

  • Gowiem
  • osterman

Tip

CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command @coderabbitai generate docstrings to have CodeRabbit automatically generate docstrings for your pull request. This feature will be included in our Pro Plan when released.


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 6947afd and 61402ae.

📒 Files selected for processing (4)
  • atmos.yaml (1 hunks)
  • pkg/config/cache.go (1 hunks)
  • website/docs/cli/commands/version.mdx (1 hunks)
  • website/docs/cli/configuration/configuration.mdx (1 hunks)

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?

❤️ 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. (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 or @auto-summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @auto-title 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: 6

🧹 Outside diff range and nitpick comments (3)
pkg/config/cache.go (1)

66-80: Consolidate SaveCache functions for clarity

There are two functions, SaveCache2 and SaveCache, performing similar tasks. Merging them or renaming for clarity could improve maintainability.

Also applies to: 82-94

cmd/root.go (1)

21-21: Consider scoping the configuration more tightly

While this follows the existing pattern, consider passing the configuration as a parameter to functions that need it, rather than relying on a global variable. This would improve testability and make dependencies more explicit.

pkg/config/config.go (1)

85-91: Document the version check configuration parameters

The version check configuration looks good, but please add comments explaining:

  • The units for the timeout value (milliseconds?)
  • Valid values for the frequency field
  • The implications of these settings
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between b144ba2 and fe80497.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (10)
  • atmos.yaml (1 hunks)
  • cmd/cmd_utils.go (2 hunks)
  • cmd/helmfile.go (1 hunks)
  • cmd/root.go (2 hunks)
  • cmd/terraform.go (1 hunks)
  • go.mod (1 hunks)
  • pkg/config/cache.go (1 hunks)
  • pkg/config/config.go (1 hunks)
  • pkg/config/utils.go (1 hunks)
  • pkg/schema/schema.go (2 hunks)
🧰 Additional context used
🪛 golangci-lint (1.62.2)
pkg/config/cache.go

39-39: Error return value of lock.Unlock is not checked

(errcheck)

🔇 Additional comments (5)
pkg/config/cache.go (1)

96-108: 🛠️ Refactor suggestion

Add a warning for unsupported frequency values

We should inform users when an unsupported frequency is provided, and we're defaulting to 'daily'.

You might add a warning like:

     default:
         interval = 86400 // default daily
+        fmt.Printf("Warning: Unsupported frequency '%s', defaulting to 'daily'\n", frequency)
cmd/root.go (1)

89-95: LGTM! Error handling improvements look solid.

The separation of error handling for version commands vs. other commands is well implemented. The code properly handles the case where configuration is not found but version information is still needed.

Let's verify all version-related command handlers are consistent:

✅ Verification successful

Version command handling is properly implemented and consistent

The verification confirms that:

  • isVersionCommand() correctly checks for the "version" argument
  • Version command is properly registered with cobra framework
  • Error handling in root.go appropriately uses isVersionCommand() to handle configuration errors differently for version commands

The implementation maintains consistency across all version-related functionality.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for version command handlers to ensure consistent error handling
rg -p "isVersionCommand|version command" cmd/

Length of output: 179


Script:

#!/bin/bash
# Let's check the implementation of isVersionCommand and its usage context
ast-grep --pattern 'func isVersionCommand() bool {
  $$$
}'

# Also check the version command registration
rg -p "version.*Command" cmd/ -A 5

Length of output: 492

go.mod (1)

19-19: LGTM! Good choice for file locking.

The gofrs/flock library is a solid choice for implementing file locking in the cache mechanism. It's well-maintained and widely used.

atmos.yaml (1)

319-323: LGTM! Well-structured version check configuration.

The configuration follows best practices with sensible defaults:

  • Version check enabled by default
  • 1-second timeout is reasonable
  • Daily frequency strikes a good balance
pkg/schema/schema.go (1)

29-29: LGTM! Well-designed schema for version configuration.

The schema changes are clean and follow Go best practices:

  • Proper struct tags for serialization
  • Optional fields marked with omitempty
  • Clear separation of concerns between Version and VersionCheck types

Also applies to: 131-139

pkg/config/cache.go Show resolved Hide resolved
cmd/cmd_utils.go Outdated Show resolved Hide resolved
cmd/cmd_utils.go Show resolved Hide resolved
cmd/helmfile.go Show resolved Hide resolved
cmd/terraform.go Show resolved Hide resolved
pkg/config/utils.go Outdated Show resolved Hide resolved
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: 1

🧹 Outside diff range and nitpick comments (3)
pkg/config/cache.go (1)

96-108: Enhance update frequency validation

The function should provide better feedback for unsupported intervals.

 func ShouldCheckForUpdates(lastChecked int64, frequency string) bool {
 	now := time.Now().Unix()
 	var interval int64
 	switch frequency {
 	case "daily":
 		interval = 86400
 	case "weekly":
 		interval = 604800
 	default:
+		u.LogWarning(schema.CliConfiguration{}, fmt.Sprintf("Unsupported update frequency '%s', defaulting to daily", frequency))
 		interval = 86400 // default daily
 	}
 	return now-lastChecked >= interval
 }
cmd/root.go (2)

89-96: Improve error handling specificity

The error handling could be more specific about the type of configuration error encountered.

 	var initErr error
 	cliConfig, initErr = cfg.InitCliConfig(schema.ConfigAndStacksInfo{}, false)
 	if initErr != nil && !errors.Is(initErr, cfg.NotFound) {
 		if isVersionCommand() {
-			u.LogTrace(schema.CliConfiguration{}, fmt.Sprintf("warning: CLI configuration 'atmos.yaml' file not found. Error: %s", initErr))
+			u.LogTrace(schema.CliConfiguration{}, fmt.Sprintf("warning: Failed to initialize CLI configuration. Error: %s", initErr))
 		} else {
 			u.LogErrorAndExit(schema.CliConfiguration{}, initErr)
 		}

99-106: Consider deferring help function setup

The help function setup could be deferred until after all initialization is complete to ensure proper configuration state.

Consider moving the help function setup after the custom commands processing to ensure all configuration is properly loaded.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between fe80497 and 0f79d1c.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (10)
  • atmos.yaml (1 hunks)
  • cmd/cmd_utils.go (2 hunks)
  • cmd/helmfile.go (1 hunks)
  • cmd/root.go (2 hunks)
  • cmd/terraform.go (1 hunks)
  • go.mod (1 hunks)
  • pkg/config/cache.go (1 hunks)
  • pkg/config/config.go (1 hunks)
  • pkg/config/utils.go (1 hunks)
  • pkg/schema/schema.go (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (6)
  • go.mod
  • pkg/config/config.go
  • atmos.yaml
  • cmd/helmfile.go
  • pkg/config/utils.go
  • pkg/schema/schema.go
🧰 Additional context used
🪛 golangci-lint (1.62.2)
pkg/config/cache.go

39-39: Error return value of lock.Unlock is not checked

(errcheck)

🔇 Additional comments (7)
cmd/terraform.go (1)

39-39: Verify cliConfig initialization before use

The usage of cliConfig here could lead to runtime issues if not properly initialized.

#!/bin/bash
# Check if cliConfig is properly initialized before use
ast-grep --pattern 'cliConfig = $_'
pkg/config/cache.go (1)

33-41: ⚠️ Potential issue

Handle lock.Unlock() errors

The deferred unlock operation should handle potential errors.

-	defer lock.Unlock()
+	defer func() {
+		if unlockErr := lock.Unlock(); unlockErr != nil {
+			err = errors.Wrap(unlockErr, "failed to release lock")
+		}
+	}()

Likely invalid or redundant comment.

🧰 Tools
🪛 golangci-lint (1.62.2)

39-39: Error return value of lock.Unlock is not checked

(errcheck)

cmd/cmd_utils.go (5)

10-10: LGTM! Import addition is appropriate.

The time package import is necessary for handling cache timestamps.


436-439: LGTM! Configuration check is well-implemented.

Early return if version checking is disabled provides clean control flow.


482-485: LGTM! Clean implementation of help message function.

Good separation of concerns by delegating version check to the new function.


470-479: ⚠️ Potential issue

Use semantic versioning for version comparison.

String comparison of versions can lead to incorrect results. For example, "10.0.0" would be considered less than "9.0.0".

Previous suggestion still applies:

+import "github.com/hashicorp/go-version"

+latestVer, err := version.NewVersion(latestVersion)
+if err != nil {
+    u.LogTrace(cliConfig, fmt.Sprintf("Failed to parse latest version: %s", err))
+    return
+}
+currentVer, err := version.NewVersion(currentVersion)
+if err != nil {
+    u.LogTrace(cliConfig, fmt.Sprintf("Failed to parse current version: %s", err))
+    return
+}
-if latestVersion != currentVersion {
+if latestVer.GreaterThan(currentVer) {

474-478: ⚠️ Potential issue

Update cache timestamp regardless of version comparison.

The cache timestamp should be updated after every check, not just when versions differ, to properly respect the frequency settings.

Move the cache update outside the version comparison:

 if latestVersion != currentVersion {
     u.PrintMessageToUpgradeToAtmosLatestRelease(latestVersion)
 }

+// Update the cache to mark the current timestamp
+cacheCfg.LastChecked = time.Now().Unix()
+if saveErr := cfg.SaveCache(cacheCfg); saveErr != nil {
+    u.LogWarning(cliConfig, fmt.Sprintf("Unable to save cache: %s", saveErr))
+}

pkg/config/cache.go Show resolved Hide resolved
@osterman
Copy link
Member

On the version command, I think we should add a --check argument so the user can force the behavior to check for the latest version, even if the cache has a recent check.

@Listener430
Copy link
Collaborator Author

On the version command, I think we should add a --check argument so the user can force the behavior to check for the latest version, even if the cache has a recent check.

@osterman the version command is the only one that is not checking for cache right now , nor updates it, and displays the box all the time. So it should check for cache too and use --check to still display the box?

@osterman
Copy link
Member

Does the version command respect the version check config settings? We want to make sure that it does.

@Listener430
Copy link
Collaborator Author

Does the version command respect the version check config settings? We want to make sure that it does.

@osterman thanks, sure, thank you so much for the clarifications. Have pushed the changes as requested.
verson_check_respects_configs

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

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 0f79d1c and ea7fc1b.

📒 Files selected for processing (3)
  • cmd/cmd_utils.go (2 hunks)
  • cmd/version.go (2 hunks)
  • pkg/config/utils.go (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • pkg/config/utils.go
🔇 Additional comments (3)
cmd/cmd_utils.go (3)

470-471: Use semantic versioning for version comparison

The current string comparison of versions could lead to incorrect results.


475-480: LGTM: Cache timestamp update implementation

Great implementation of updating the cache timestamp regardless of whether an update is found. This ensures proper frequency control of version checks.


432-481: LGTM: Well-structured version check implementation

The implementation is thorough and handles all edge cases:

  • Respects configuration settings
  • Handles cache loading errors gracefully
  • Implements proper frequency control
  • Updates cache timestamp appropriately

cmd/version.go Outdated Show resolved Hide resolved
@osterman
Copy link
Member

Does the atmos version check for updates, respecting the atmos.yml configuration?

image

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

🧹 Outside diff range and nitpick comments (3)
website/docs/cli/commands/version.mdx (2)

23-28: WARRIOR! Let's polish this documentation for clarity!

The text needs some refinement to maintain our high standards:

-This will show the CLI version. The frequency with which the update box message in version is shown is configured in atmos.yaml.
-There are two options daily and weekly. The default value is set to daily. 
-It is also possible to turn it off in atmos.yaml file by switching enable to false. 
-Or set an env variable ATMOS_VERSION_CHECK_ENABLED to false, 
-this overriders the config's settting. 
+This will show the CLI version. The frequency of the update box message is configured in the atmos.yaml file.
+There are two options: daily and weekly. The default value is set to daily.
+You can disable this feature in the atmos.yaml file by setting `enable: false`,
+or by setting the environment variable `ATMOS_VERSION_CHECK_ENABLED=false`,
+which overrides the config's setting.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~25-~25: Possible missing comma found.
Context: ...configured in atmos.yaml. There are two options daily and weekly. The default value is ...

(AI_HYDRA_LEO_MISSING_COMMA)


[grammar] ~27-~27: The singular determiner ‘this’ may not agree with the plural noun ‘overriders’. Did you mean “these”?
Context: ... ATMOS_VERSION_CHECK_ENABLED to false, this overriders the config's settting. ```...

(THIS_NNS)


30-35: STAND STRONG! Let's enhance the --check flag documentation!

The explanation could be more precise:

-The version command supports --check flag. 
-It will show the update box message irrespectively of the config settings.  
+The version command supports the `--check` flag, which forces the display of the update box message
+regardless of your configuration settings.
website/docs/cli/commands/help.mdx (1)

Line range hint 23-28: STRENGTHEN OUR DOCUMENTATION WITH A CONFIGURATION EXAMPLE!

Both documentation files would benefit from showing an actual configuration example:

Consider adding this configuration example to both files:

settings:
  version:
    enabled: true      # Enable/disable version check
    frequency: daily   # Options: daily, weekly
    timeout: 1000      # Timeout in milliseconds

This will help warriors understand exactly how to configure these settings in their atmos.yaml file!

Also applies to: 15-20

🧰 Tools
🪛 LanguageTool

[uncategorized] ~17-~17: A comma might be missing here.
Context: ...configured in atmos.yaml. There are two options daily and weekly. The default value is ...

(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)


[uncategorized] ~18-~18: You might be missing the article “the” here.
Context: ... It is also possible to turn it off in atmos.yaml file by switching enable to false. Or ...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)


[grammar] ~19-~19: The singular determiner ‘this’ may not agree with the plural noun ‘overriders’. Did you mean “these”?
Context: ... ATMOS_VERSION_CHECK_ENABLED to false, this overriders the config's settting. ``...

(THIS_NNS)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between ea7fc1b and e3a2e5e.

📒 Files selected for processing (2)
  • website/docs/cli/commands/help.mdx (1 hunks)
  • website/docs/cli/commands/version.mdx (1 hunks)
🧰 Additional context used
🪛 LanguageTool
website/docs/cli/commands/help.mdx

[uncategorized] ~17-~17: A comma might be missing here.
Context: ...configured in atmos.yaml. There are two options daily and weekly. The default value is ...

(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)


[uncategorized] ~18-~18: You might be missing the article “the” here.
Context: ... It is also possible to turn it off in atmos.yaml file by switching enable to false. Or ...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)


[grammar] ~19-~19: The singular determiner ‘this’ may not agree with the plural noun ‘overriders’. Did you mean “these”?
Context: ... ATMOS_VERSION_CHECK_ENABLED to false, this overriders the config's settting. ``...

(THIS_NNS)

website/docs/cli/commands/version.mdx

[uncategorized] ~25-~25: Possible missing comma found.
Context: ...configured in atmos.yaml. There are two options daily and weekly. The default value is ...

(AI_HYDRA_LEO_MISSING_COMMA)


[grammar] ~27-~27: The singular determiner ‘this’ may not agree with the plural noun ‘overriders’. Did you mean “these”?
Context: ... ATMOS_VERSION_CHECK_ENABLED to false, this overriders the config's settting. ```...

(THIS_NNS)

website/docs/cli/commands/help.mdx Outdated Show resolved Hide resolved
@Listener430
Copy link
Collaborator Author

Does the atmos version check for updates, respecting the atmos.yml configuration?

@osterman, thanks yes, it does, its just does not show the box because the timestamp is already there and time has not elapsed. atmos version --check does not intefere with the cache at all though (does not update timstamp either, if that ok?)

@osterman
Copy link
Member

Sounds like the right implementation.

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 (4)
website/docs/cli/commands/version.mdx (4)

23-24: Consider enhancing the command description.

The description could be more informative by mentioning that it displays both the current version and checks for updates when configured.

-This will show the CLI version. 
+This command displays the current Atmos CLI version and, when configured, checks for available updates.
🧰 Tools
🪛 LanguageTool

[style] ~24-~24: Consider using an alternative to avoid wordiness and strengthen your wording.
Context: ... ``` This will show the CLI version. From time to time, Atmos will check for updates. The freq...

(FROM_TIME_TO_TIME)


29-32: Improve formatting consistency in the numbered list.

The list formatting could be more consistent, and the default value statement should be separated.

 1. As an integer: Specify the number of seconds between checks (for example, 3600 for hourly checks).
 2. As a duration with a suffix: Use a time suffix to indicate the interval (for example, `1m` for one minute, `5h` for five hours, or `2d` for two days).
 3. As one of the predefined keywords: Choose from the following options: minute, hourly, daily, weekly, monthly, and yearly. The default is daily.
-The default is to check `daily`, and if any unsupported values are passed this default will be used.
+
+If any unsupported values are provided, Atmos will default to checking `daily`.
🧰 Tools
🪛 LanguageTool

[style] ~31-~31: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...r five hours, or 2d for two days). 3. As one of the predefined keywords: Choose ...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


34-36: Improve readability of configuration options.

The line wrapping makes this section harder to read. Consider restructuring for better clarity.

-It is also possible to turn off version checks in `atmos.yaml` by switching `enable` to `false`,
-or by setting the `ATMOS_VERSION_CHECK_ENABLED` environment variable to `false`, which overrides
-the config's settings. 
+Version checks can be disabled in two ways:
+
+1. Set `enable: false` in the `atmos.yaml` configuration file
+2. Set the environment variable `ATMOS_VERSION_CHECK_ENABLED=false` (overrides the configuration file setting)

38-43: Consolidate the --check flag documentation.

The flag documentation is split across multiple lines and could be more concise.

 ```shell
 atmos version --check

-The version command supports a --check flag.
-This will force Atmos to check for a new version, irrespective of the configuration settings.
+Use the --check flag to force an immediate version check, bypassing all configuration settings.


</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

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

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 595b08ff20cf9e086bd95f6812bdb0a1d7ec9bc6 and da2d692b132a4eeda3d94538c1d89c8ab00f1d99.

</details>

<details>
<summary>📒 Files selected for processing (2)</summary>

* `website/docs/cli/commands/help.mdx` (1 hunks)
* `website/docs/cli/commands/version.mdx` (1 hunks)

</details>

<details>
<summary>🚧 Files skipped from review as they are similar to previous changes (1)</summary>

* website/docs/cli/commands/help.mdx

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🪛 LanguageTool</summary>

<details>
<summary>website/docs/cli/commands/version.mdx</summary>

[style] ~24-~24: Consider using an alternative to avoid wordiness and strengthen your wording.
Context: ... ```  This will show the CLI version.   From time to time, Atmos will check for updates. The freq...

(FROM_TIME_TO_TIME)

---

[style] ~31-~31: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...r five hours, or `2d` for two days). 3. As one of the predefined keywords: Choose ...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)

</details>

</details>

</details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

coderabbitai[bot]
coderabbitai bot previously approved these changes Dec 15, 2024
coderabbitai[bot]
coderabbitai bot previously approved these changes Dec 15, 2024
Copy link
Member

@aknysh aknysh left a comment

Choose a reason for hiding this comment

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

thanks @Listener430

@aknysh aknysh added minor New features that do not break anything and removed enhancement New feature or request bugfix Change that restores intended behavior labels Dec 15, 2024
@aknysh aknysh merged commit b205a0d into main Dec 15, 2024
31 checks passed
@aknysh aknysh deleted the DEV-2815 branch December 15, 2024 17:19
Copy link

These changes were released in v1.127.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor New features that do not break anything
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants