Skip to content

feat: add beta label to CLI output#324

Open
konstantinoscs wants to merge 1 commit into
developfrom
feature/tow-2343-add-beta-label-to-cli
Open

feat: add beta label to CLI output#324
konstantinoscs wants to merge 1 commit into
developfrom
feature/tow-2343-add-beta-label-to-cli

Conversation

@konstantinoscs

@konstantinoscs konstantinoscs commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Adding a resuable "beta feature" component that prints a beta label/warning when a beta feature is used.
Also, using the above mechanism for the Storage product commands ahead of the Preview/Beta launch.

e.g.
image

Summary by CodeRabbit

  • New Features

    • Added beta labeling and one-time notifications for Storage catalog functionality.
    • Storage-related CLI help now clearly identifies beta status and may include documentation links.
    • Beta notices appear only in suitable interactive terminal contexts and are shown once per feature.
  • Bug Fixes

    • Prevented duplicate beta notices, including during concurrent CLI usage.
  • Tests

    • Added coverage for notice formatting, validation, concurrency, persistence errors, and CLI help output.

@konstantinoscs konstantinoscs changed the base branch from main to develop July 11, 2026 16:07
@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds atomic filesystem-backed notice claiming in the config crate and introduces Storage beta messaging in catalog command help and runtime operations.

Changes

Storage beta notice

Layer / File(s) Summary
Atomic notice persistence
crates/config/Cargo.toml, crates/config/src/{lib.rs,session.rs}
Adds validated, atomic per-notice claims using sentinel files, with tests for repeated, concurrent, independent, invalid, and failing claims.
Beta notice definition and emission
crates/tower-cmd/src/{beta.rs,output.rs,lib.rs}
Defines Storage beta metadata, formats notices, gates emission to interactive normal output, persists claims, and writes first-time notices to stderr.
Catalog command integration
crates/tower-cmd/src/catalogs.rs
Adds Storage beta markers to help text and triggers one-time notices for applicable list, credentials, and show operations, with CLI coverage.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CatalogCommand
  participant BetaNotice
  participant ConfigSession
  participant Stderr
  CatalogCommand->>BetaNotice: notify_once(STORAGE)
  BetaNotice->>BetaNotice: check output mode and terminals
  BetaNotice->>ConfigSession: claim_notice("storage")
  ConfigSession-->>BetaNotice: claimed or already claimed
  BetaNotice->>Stderr: write first-time beta notice
Loading

Possibly related PRs

  • tower/tower-cli#241: Introduced the catalog command flows that this change extends with Storage beta notifications.

Suggested reviewers: sammuti, jo-sm, socksy

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding beta labeling to CLI output.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/tow-2343-add-beta-label-to-cli

Comment @coderabbitai help to get the list of available commands.

@tower tower deleted a comment from github-actions Bot Jul 11, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/tower-cmd/src/beta.rs`:
- Around line 28-34: Update the expected string in the
notice_omits_docs_sentence_without_a_url test to include the full
STORAGE.qualification text, including “its API contract and”, while preserving
the existing notice prefix and no-docs-sentence behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d746f76d-f870-4b16-965d-fe75c3757993

📥 Commits

Reviewing files that changed from the base of the PR and between 8dd7b04 and e04b9d2.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (7)
  • crates/config/Cargo.toml
  • crates/config/src/lib.rs
  • crates/config/src/session.rs
  • crates/tower-cmd/src/beta.rs
  • crates/tower-cmd/src/catalogs.rs
  • crates/tower-cmd/src/lib.rs
  • crates/tower-cmd/src/output.rs

Comment on lines +28 to +34
pub(crate) const STORAGE: BetaFeature = BetaFeature {
id: "storage-beta-v1",
name: "Tower Storage",
qualification:
"Core functionality is stable, but its API contract and CLI interface may evolve before general availability.",
docs_url: None,
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Test assertion doesn't match the STORAGE.qualification text.

STORAGE.qualification reads "Core functionality is stable, but its API contract and CLI interface may evolve before general availability." (lines 31-32), but notice_omits_docs_sentence_without_a_url asserts the resulting notice equals a string that omits "API contract and " (line 79). notice() will actually produce "Tower Storage is in beta. Core functionality is stable, but its API contract and CLI interface may evolve before general availability.", so this assert_eq! will fail.

Align one side with the other:

🐛 Proposed fix (update the test to match the constant)
         assert_eq!(
             notice,
-            "Tower Storage is in beta. Core functionality is stable, but its CLI interface may evolve before general availability."
+            "Tower Storage is in beta. Core functionality is stable, but its API contract and CLI interface may evolve before general availability."
         );

Also applies to: 74-82

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/tower-cmd/src/beta.rs` around lines 28 - 34, Update the expected
string in the notice_omits_docs_sentence_without_a_url test to include the full
STORAGE.qualification text, including “its API contract and”, while preserving
the existing notice prefix and no-docs-sentence behavior.

@konstantinoscs konstantinoscs force-pushed the feature/tow-2343-add-beta-label-to-cli branch from e04b9d2 to eb1144d Compare July 11, 2026 16:25
@konstantinoscs konstantinoscs force-pushed the feature/tow-2343-add-beta-label-to-cli branch from eb1144d to fb8a0bd Compare July 11, 2026 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant