Skip to content

refactor: Remove error returns from ui.* functions#1980

Merged
aknysh merged 5 commits intomainfrom
osterman/relax-lint-errcheck
Jan 17, 2026
Merged

refactor: Remove error returns from ui.* functions#1980
aknysh merged 5 commits intomainfrom
osterman/relax-lint-errcheck

Conversation

@osterman
Copy link
Member

@osterman osterman commented Jan 16, 2026

what

  • Changed ui.Success, ui.Error, ui.Warning, ui.Info, ui.Write, ui.Markdown, and related functions to not return errors
  • Eliminated 210+ instances of the "dog sled" pattern (_ = ui.*) across the codebase
  • Functions now log write errors internally via log.Debug() instead of returning them

why

Errors from stderr writes are not meaningful for callers to handle. The io/Write API may fail for reasons beyond the caller's control (terminal buffering, redirect failures, etc.), but there's nothing actionable the caller can do. This matches the log.* pattern which already doesn't return errors.

references

Removes unnecessary error handling noise while maintaining the same output behavior.

Summary by CodeRabbit

  • Refactor

    • UI messaging made more resilient: status, warnings, and formatted output now log write failures internally instead of propagating errors, ensuring consistent user-facing messages.
  • Chores

    • Updated example build image version and underlying formatter/dependency updates.

✏️ Tip: You can customize this high-level summary in your review settings.

* feat: Add experimental feature transparency and version tracking

Add transparency about feature maturity by introducing an <Experimental />
badge component and <FirstReleased /> version component for documentation.
Create an "Experimental Features" policy page explaining what experimental
means, graduation criteria, and how to provide feedback. Mark 11 experimental
features across the documentation.

🤖 Generated with Claude Code

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* docs: Clarify experimental features may have unimplemented functionality

Update the experimental features policy to accurately reflect that:
- Features may not be fully functional yet
- Documented functionality may not yet be implemented
- Full functionality is guaranteed when experimental annotation is removed

🤖 Generated with Claude Code

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* docs: Clarify experimental features are intended to graduate to stable

Experimental features are on the path to stability, not abandonment.
Removal would only occur in extreme circumstances.

🤖 Generated with Claude Code

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* feat: Add comprehensive experimental feature visibility across surfaces

- Add ui.Experimental() toast function for CLI notifications
- Add experimental_warnings config option (default: true)
- Add experimental badge to roadmap milestones and featured cards
- Add ExperimentalFeaturesList component for /experimental page
- Add experimental tag support in changelog timeline
- Move experimental-features.mdx to /experimental with dynamic content
- Add "Experimental Features" link to roadmap page
- Mark experimental features in roadmap.js with experimental: true
- Use subtle gray color for experimental notifications

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat: Log debug message when experimental warnings disabled

When experimental_warnings is set to false, still log a debug message
indicating that an experimental feature is being used.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat: Add EXPERIMENTAL badge to CLI help output

- Add reusable ui.Badge() function for styled terminal badges
- Show EXPERIMENTAL badge at top of experimental command --help
- Show EXPERIMENTAL badge next to experimental subcommands in parent help
- Skip badge on subcommands when parent is already experimental (avoid repetition)
- Mark list affected subcommand as experimental
- Group experimental features by initiative on website
- Add "Help Us Prioritize" CTA section to experimental features page
- Add sentinel errors for experimental command handling

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: Improve Experimental badge WCAG AA accessibility

- Use darker orange shades for light theme text (#d97706, #b45309)
  to meet WCAG AA 4.5:1 contrast requirement for small text
- Add focus-visible styles for keyboard navigation accessibility
- Dark theme already meets contrast requirements

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: Mark toolchain command as experimental to match roadmap

The roadmap marks toolchain as experimental but the command provider
returned false for IsExperimental(). Now aligned with roadmap.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat: Mark terraform backend command as experimental

Per roadmap, automatic backend provisioning is experimental.
Added annotation to terraform backend subcommand.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: Address CodeRabbit review feedback

- Add color support check to Badge method for graceful degradation
- Update experimental features docs table with all experimental commands
- Fix ChangelogTimeline tagExperimental contrast for WCAG AA compliance

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat: Mark terraform workdir command as experimental

Mark the terraform workdir command as experimental to match the roadmap
configuration. Also add workdir management to the experimental features
documentation table.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* test: Regenerate snapshots for experimental setting

Update golden snapshots to include the new `experimental: warn` setting
in describe config output.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs: Add blog post and roadmap entry for experimental feature controls

Add blog post announcing the experimental feature flag (`settings.experimental`)
that provides granular control over experimental features with CLI badges,
configurable modes (warn, silence, disable, error), and environment variable
support.

Add milestone to Developer Experience roadmap tracking this feature.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* refactor: Use theme colors for experimental badge

Replace hardcoded hex colors (#FF9800, #000000) with theme-aware colors
from the color scheme. This ensures the experimental badge respects the
user's terminal theme settings.

Changes:
- Add ExperimentalBadgeBg and ExperimentalBadgeFg to ColorScheme
- Add ExperimentalBadge lipgloss.Style to StyleSet
- Update FormatExperimentalBadge() to use theme styles
- Update help_template.go to use FormatExperimentalBadge()

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: Show experimental warning for annotation-based experimental commands

The findExperimentalParent function was only checking the command registry
for experimental status, which missed subcommands marked with annotations
like "list affected", "terraform backend", and "terraform workdir".

Now also checks the cobra command's annotations for experimental status.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* refactor: Simplify experimental feature message

Change experimental warning from verbose feature-specific message to
simple "Experimental feature. Learn more <link>" with muted gray styling.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs: Update experimental feature example output

Update example output in docs to match the new simpler message format
with test tube emoji and direct link to settings documentation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: Use correct /experimental URL in experimental feature message

The experimental warning should link to /experimental (the overview page
explaining what experimental features are) not the settings documentation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs: Add link to /experimental from settings documentation

Link the settings.experimental documentation page to the main
/experimental page which explains what experimental means.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs: Add CLI configuration section to /experimental page

Add section explaining how to control experimental feature behavior
via settings.experimental in atmos.yaml or ATMOS_EXPERIMENTAL env var.
Links to detailed settings documentation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs: Move experimental features list after "What Experimental Means" section

Reorganizes the /experimental page to show the list of current experimental
features earlier, immediately after explaining what experimental means.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs: Update Slack links and add experimental docs to flag-handler agent

- Update Slack links to use /community/slack instead of external URL
- Add experimental feature handling documentation to flag-handler agent
- Add experimental-related keywords to agent auto-invoke triggers

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs: Fix stacks sidebar sorting and improve Experimental badge

Stacks sidebar:
- Remove sidebar_position from all stacks docs to enable alphabetical sorting
- Keep position 1 on stacks.mdx (Overview) to ensure it stays first
- Remove position from components and settings category JSON files

Experimental badge component:
- Replace UTF-8 emoji with RiFlaskLine from react-icons
- Remove "Learn more" link - whole badge is now clickable
- Make badge behave like a button with hover/focus states

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs: Fix toolchain label capitalization in CLI configuration

Change "Toolchain" to "toolchain" to match the lowercase convention
used by other CLI configuration sections (settings, stacks, integrations, version).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs: Fix toolchain subsection label capitalization

Change sidebar labels to lowercase to match the convention:
- Overview -> toolchain
- Registries -> registries
- Aliases -> aliases

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs: Fix Registry label capitalization in toolchain commands

Change "Registry" to "registry" to match lowercase convention.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* refactor: Reduce flag-handler agent file size to meet limit

Consolidate duplicate Resources and Relevant PRDs sections into one
compact section. Condense verbose Self-Maintenance documentation while
preserving key monitoring guidance. File reduced from 25712 to 23265
bytes (under 25000 limit).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* test: Regenerate CLI help snapshots

Update golden snapshots for atmos --help output to reflect current
command list and ordering.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* test: Regenerate snapshots for experimental settings

Update golden snapshots to include:
- settings.experimental: warn default value in describe config output
- [EXPERIMENTAL] badges on terraform backend and workdir commands

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat(website): Add automatic 'Unreleased' badge for documentation pages

Add a new doc-release-data plugin that automatically detects which
documentation pages have changes not yet included in a release. When
a doc's last-modified commit is not in any stable release tag, an
"Unreleased" badge appears in the TOC sidebar.

Changes:
- Add doc-release-data plugin that scans docs and checks git history
- Extract shared ReleaseBadge component for reuse
- Add DocReleaseBadge component that reads from plugin global data
- Extend TOC component to render badges for both blog and doc pages
- Update styles to make unreleased badges clickable (links to /changelog)

The badge only appears for unreleased docs - released docs show no badge
to keep the UI clean.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* style(website): Update Unreleased badge to match Experimental style

Change the Unreleased badge from solid gray to a subtle semi-transparent
style with border, matching the Experimental badge pattern. This provides
a more consistent visual language across badge types.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat(website): Add /unreleased page with index of unreleased documentation

Add a dedicated page at atmos.tools/unreleased that:
- Explains what "unreleased" means (content not yet in a formal release)
- Lists all documentation pages with unreleased changes
- Shows the build date so users know when the list was generated
- Links to changelog, releases, and community resources

Changes:
- Create UnreleasedDocsList component that reads from plugin global data
- Create /unreleased page with explanation and auto-generated list
- Update doc-release-data plugin to export unreleasedDocs array with
  title, path, and description for each unreleased doc
- Fix URL path computation to handle Docusaurus id/slug conventions
- Update ReleaseBadge to link to /unreleased instead of /changelog

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat(website): Add confetti celebration when all docs are released

When visiting /unreleased and all documentation is up to date with
the latest release, show a celebration state with:
- Confetti animation on first page load (using canvas-confetti)
- Celebratory message "All caught up!"
- Links to changelog and GitHub releases
- Build date showing when the check was last performed

This provides positive feedback to users who check the page and find
everything is current.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs: Add missing descriptions to terraform command docs

Add description frontmatter to docs that were missing it:
- atmos terraform clean
- atmos terraform generate files
- atmos terraform output
- Using Remote State (redirect page)

These descriptions now appear in the /unreleased page list.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(website): Address CodeRabbit review feedback for unreleased badges

- Fix React hooks violation in UnreleasedDocsList by calling usePluginData
  unconditionally and checking return value instead of using try-catch
- Fix React hooks violation in DocReleaseBadge using same pattern
- Add /roadmap to NON_DOC_PATHS to prevent showing unreleased badge on
  roadmap page (which is not a documentation page)
- Add color to transition property for smooth hover color changes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* test: Regenerate CLI help snapshots for experimental features

Update terraform command help snapshots to reflect new column widths
and [EXPERIMENTAL] badges added to backend, workdir, and source
subcommands.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs(roadmap): Add PR number to experimental feature controls milestone

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* test: Add tests to increase code coverage

Add tests for:
- cmd/toolchain/du.go: DuCommandProvider methods (GetCommand, GetName,
  GetGroup, GetFlagsBuilder, GetPositionalArgsBuilder,
  GetCompatibilityFlags, GetAliases, IsExperimental)
- pkg/ui/formatter.go: Reset, SetColorProfile, Hint, Hintf,
  Experimental, Experimentalf, Badge, FormatExperimentalBadge, ClearLine

Coverage improvements:
- pkg/ui: 73.1% → 87.8%
- cmd/toolchain/du.go: 0% → covered

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* test: Add comprehensive tests for root.go and help_template.go

Add tests to improve patch coverage:
- TestConvertToTermenvProfile: Test terminal color profile conversion
- TestFindExperimentalParent: Test experimental command detection
- TestParseUseVersionFromArgsInternal: Test --use-version parsing
- TestBuildFlagDescription: Test flag description generation
- TestRenderWrappedLines: Test wrapped line rendering
- TestSyncGlobalFlagsToViper: Test viper flag synchronization
- TestConfigureEarlyColorProfile: Test early color profile setup
- TestFindProviderName: Test command hierarchy traversal
- TestRenderCompatFlags: Test compatibility flag rendering
- TestPrintCompatibilityFlags: Test compat flags section
- TestPrintFooterWithSubcommands: Test footer display
- TestSetRendererProfileForAutoDetect: Test all color profiles
- TestCalculateCommandWidthWithExperimental: Test badge width
- TestGetExperimentalBadge: Test badge generation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* test: Add more tests to increase patch coverage

Add comprehensive tests to improve coverage from 69.5% toward 75%:

cmd/root_helpers_test.go:
- TestFormatFlagNameParts: Test flag name formatting for bool/string/int/stringSlice
- TestGetTerminalWidth: Test terminal width detection with fallback
- TestCalculateMaxFlagWidth: Test flag width calculation excluding hidden flags
- TestRenderFlags: Test flag rendering with styles
- TestRenderFlagsNilFlagSet: Test nil flag set handling

pkg/ui/formatter_test.go:
- TestConfigureColorProfileAllProfiles: Test all 4 color profiles
- TestFormatterHintMethod/Hintf/Toast/Toastf: Test formatter methods
- TestFormatterBold/Muted/Heading/Label: Test text formatting methods
- TestFormatterHintWithBackticks: Test inline markdown in hints

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* test: Add coverage tests for pkg/ui/formatter fallback and error paths

Add tests for uncovered code paths in formatter.go:
- Experimental/Experimentalf error paths when formatter not initialized
- Badge error fallback when formatter not initialized
- FormatExperimentalBadge no-color and error paths
- ClearLine terminal not initialized and color profile branches
- Formatter method tests for Experimentalf, Badge, and Experimental

Coverage improved from 89.9% to 90.5% for pkg/ui package.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* test: Add coverage for experimental command mode switch cases

Add TestExperimentalModeHandling to test all four experimental modes:
- "silence" - no output or exit
- "disable" - command disabled with exit
- "warn" - warning shown but no exit
- "error" - warning and exit

This increases test coverage for root.go lines 497-520.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(roadmap): correct experimental feature controls status to in-progress

PR #1940 is still open, so the milestone should not be marked as shipped.
Updated dx initiative progress from 92% to 88% to reflect accurate count.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* test: regenerate snapshots for experimental feature changes

Update golden snapshots to include:
- New `experimental: warn` setting in describe config output
- [EXPERIMENTAL] badges on terraform subcommands

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* test: regenerate terraform --help snapshot

Update golden snapshot for [EXPERIMENTAL] badges on subcommands.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* test: Regenerate snapshots for experimental badges

Update golden snapshots to include [EXPERIMENTAL] badges for:
- atmos toolchain
- atmos devcontainer
- atmos terraform backend
- atmos terraform workdir

The experimental feature controls PR added visual badges to help
output, requiring snapshot updates.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* - PRD environment variable fixed (ATMOS_EXPERIMENTAL)
  - PRD experimental commands list updated
  - PRD subcommand-level section updated
  - Documentation error messages match actual output
  - Experimental() function now includes feature name
  - findExperimentalParent() returns correct parent names
  - Toolchain command calls parent's PersistentPreRun

* add tests

---------

Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
Co-authored-by: Andriy Knysh <aknysh@users.noreply.github.com>
Co-authored-by: aknysh <andriy.knysh@gmail.com>
@osterman osterman requested a review from a team as a code owner January 16, 2026 19:14
@github-actions github-actions bot added the size/xl Extra large size PR label Jan 16, 2026
@mergify
Copy link

mergify bot commented Jan 16, 2026

Warning

This PR exceeds the recommended limit of 1,000 lines.

Large PRs are difficult to review and may be rejected due to their size.

Please verify that this PR does not address multiple issues.
Consider refactoring it into smaller, more focused PRs to facilitate a smoother review process.

@mergify
Copy link

mergify bot commented Jan 16, 2026

💥 This pull request now has conflicts. Could you fix it @osterman? 🙏

@mergify mergify bot added the conflict This PR has conflicts label Jan 16, 2026
@mergify
Copy link

mergify bot commented Jan 16, 2026

Important

Cloud Posse Engineering Team Review Required

This pull request modifies files that require Cloud Posse's review. Please be patient, and a core maintainer will review your changes.

To expedite this process, reach out to us on Slack in the #pr-reviews channel.

@mergify mergify bot added the needs-cloudposse Needs Cloud Posse assistance label Jan 16, 2026
Resolved conflicts in:
- cmd/root.go: Keep ui.Experimental() calls without error assignment
- pkg/ui/formatter.go: Remove duplicate Experimental/Experimentalf functions
- pkg/ui/formatter_test.go: Update ClearLine tests for no-error-return API

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 16, 2026

📝 Walkthrough

Walkthrough

The PR converts core UI output functions to void (removing error returns) and updates ~60+ call sites to stop assigning discarded return values, replacing _ = ui.X(...) with ui.X(...) or adjusting success-path returns accordingly.

Changes

Cohort / File(s) Summary
Core UI API Changes
pkg/ui/formatter.go, pkg/ui/formatter_test.go, pkg/ui/output_test.go
Changed many UI APIs (Markdown, Success, Error, Warning, Info, Toast, Hint, Write, ClearLine, etc.) from returning error to void; adjusted internal error logging and updated tests to match no-return semantics.
Command handlers & CLI
cmd/... (e.g., cmd/about/about.go, cmd/root.go, cmd/auth_*.go, cmd/list/*, cmd/theme/*, cmd/toolchain/registry/*)
Replaced _ = ui.*(...) patterns with direct ui.*(...) calls; in a few success paths functions now return nil instead of propagating prior UI errors.
Terraform & Workdir
cmd/terraform/*, pkg/terraform/* (e.g., workdir/*, clean/*, generate/*, output/spinner.go)
Updated UI callsites in generation, cleaning, spinner/output and workdir flows to new no-error UI API and adjusted returns where previously returned UI errors.
Toolchain & Installer
toolchain/*.go, toolchain/*_helpers.go, toolchain/installer/*
Converted UI call patterns across toolchain commands (add, install, get, list, clean, set, uninstall, progress) to direct calls and adjusted success return semantics where applicable.
Provisioner & Source
pkg/provisioner/*, pkg/provisioner/source/*
Removed blank-identifier discards for UI messages in provisioning and source/vendor flows; warnings/success/info now invoked with void UI functions.
Devcontainer & Containers
pkg/devcontainer/*, pkg/config/utils.go
Replaced _ = ui.* with ui.* in lifecycle, start/stop/rebuild/list routines and version-constraint warnings.
Auth & Credentials
pkg/auth/* (e.g., identities/aws/credential_prompt.go, integrations/aws/ecr.go)
Updated credential prompt and ECR flows to call void UI functions directly.
Internal exec & workflow utils
internal/exec/*
Adjusted logging/write calls to match the new UI API (removed blank-identifier assignments).
Others / Misc
pkg/flags/interactive.go, pkg/list/*, pkg/ui/spinner/*, pkg/version/reexec.go, pkg/provisioner/workdir/*, pkg/terraform/generate/*, examples/*, go.mod, NOTICE
Widespread callsite updates to reflect formatter signature changes; small module dependency bumps and Dockerfile ATMOS version bump included.

Sequence Diagram(s)

(omitted)

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

no-release

Suggested reviewers

  • osterman
🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 57.69% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: removing error returns from UI functions throughout the codebase. It's concise, specific, and clearly conveys the refactoring intent.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch osterman/relax-lint-errcheck

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

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

@mergify mergify bot removed the conflict This PR has conflicts label Jan 16, 2026
@github-actions
Copy link

github-actions bot commented Jan 16, 2026

Dependency Review

✅ No vulnerabilities or license issues found.

Scanned Files

  • go.mod

@codecov
Copy link

codecov bot commented Jan 16, 2026

Codecov Report

❌ Patch coverage is 72.13622% with 90 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.72%. Comparing base (994635c) to head (7937ce1).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pkg/ui/formatter.go 66.66% 16 Missing and 16 partials ⚠️
cmd/toolchain/registry/list.go 11.11% 8 Missing ⚠️
toolchain/uninstall.go 57.14% 6 Missing ⚠️
cmd/list/themes.go 0.00% 4 Missing ⚠️
toolchain/info.go 75.00% 4 Missing ⚠️
toolchain/install_helpers.go 33.33% 4 Missing ⚠️
cmd/list/values.go 50.00% 2 Missing ⚠️
pkg/auth/identities/aws/credential_prompt.go 60.00% 2 Missing ⚠️
pkg/flags/interactive.go 0.00% 2 Missing ⚠️
pkg/ui/spinner/spinner.go 71.42% 2 Missing ⚠️
... and 22 more
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1980      +/-   ##
==========================================
- Coverage   74.75%   74.72%   -0.03%     
==========================================
  Files         777      777              
  Lines       71176    71213      +37     
==========================================
+ Hits        53205    53216      +11     
- Misses      14511    14524      +13     
- Partials     3460     3473      +13     
Flag Coverage Δ
unittests 74.72% <72.13%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
cmd/about/about.go 72.72% <100.00%> (+1.29%) ⬆️
cmd/auth_exec.go 85.32% <100.00%> (ø)
cmd/auth_whoami.go 71.05% <100.00%> (ø)
cmd/list/settings.go 38.88% <100.00%> (ø)
cmd/root.go 68.45% <100.00%> (ø)
cmd/terraform/workdir/workdir_clean.go 36.36% <100.00%> (ø)
cmd/terraform/workdir/workdir_list.go 56.09% <100.00%> (ø)
cmd/terraform/workdir/workdir_show.go 57.37% <100.00%> (ø)
cmd/theme/list.go 86.66% <100.00%> (+11.66%) ⬆️
cmd/theme/show.go 78.18% <100.00%> (+0.40%) ⬆️
... and 55 more

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@osterman osterman added the patch A minor, backward compatible change label Jan 17, 2026
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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
pkg/terraform/clean/deleter.go (1)

27-29: Add user-facing error message for symlink rejection.

The symlink error path returns an error but doesn't notify the user via ui.Errorf, unlike the other error paths (lines 24 and 33). This creates an inconsistent experience.

🔧 Suggested fix
 	if fileInfo.Mode()&os.ModeSymlink != 0 {
+		ui.Errorf("Cannot delete %s: refusing to delete symbolic link", normalizedObjectName)
 		return fmt.Errorf("%w: %s", errUtils.ErrRefuseDeleteSymbolicLink, normalizedObjectName)
 	}

coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 17, 2026
@aknysh aknysh merged commit af850e8 into main Jan 17, 2026
57 checks passed
@aknysh aknysh deleted the osterman/relax-lint-errcheck branch January 17, 2026 17:21
@mergify mergify bot removed the needs-cloudposse Needs Cloud Posse assistance label Jan 17, 2026
osterman added a commit that referenced this pull request Jan 17, 2026
The ui.Successf function no longer returns an error after refactor
in #1980. Update executeGitHubOutput to call Successf separately
and return nil.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
osterman added a commit that referenced this pull request Jan 18, 2026
Main branch merged #1980 which removed error returns from ui.* functions.
Updated cmd/ci/status.go and cmd/terraform/planfile/*.go to match the
new API that doesn't return values.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
osterman added a commit that referenced this pull request Jan 18, 2026
Continue the ui.* function error return removal from #1980 to scaffold
commands. The ui package now returns void since output functions cannot
meaningfully fail in ways callers can handle.

Also fix blog post tags (use valid tags from tags.yml) and add PR/changelog
links to init/scaffold milestones in roadmap.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions
Copy link

These changes were released in v1.204.1-rc.2.

aknysh added a commit that referenced this pull request Jan 21, 2026
…ckage (#1985)

* feat: Add --format=github for terraform output and unified pkg/env package

This commit adds GitHub Actions integration for terraform outputs and creates
a unified environment variable formatting package to eliminate code duplication.

Key changes:

1. New `pkg/env/` package for environment variable formatting:
   - Supports env, dotenv, bash, and github formats
   - Options pattern: WithUppercase(), WithFlatten()
   - Sorted keys for deterministic output
   - Shell escaping for single-quoted literals
   - GitHub heredoc syntax for multiline values

2. New `pkg/github/actions/env/` package:
   - GetOutputPath(), GetEnvPath(), GetPathPath(), GetSummaryPath()
   - IsGitHubActions() detection

3. `atmos terraform output --format=github`:
   - Writes outputs to $GITHUB_OUTPUT or --output-file
   - Supports --uppercase and --flatten options
   - Uses heredoc syntax for multiline values

4. Refactored cmd/env and pkg/terraform/output to use pkg/env:
   - Eliminated duplicate formatting code
   - Consistent behavior across all format commands

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* refactor: Remove pkg/env/github.go wrapper, use pkg/github/actions/env directly

Eliminates unnecessary indirection by having consumers import directly from
pkg/github/actions/env instead of going through a thin wrapper in pkg/env.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* refactor: Consolidate pkg/github/actions package structure

Move GitHub Actions utilities from pkg/github/actions/env/ to pkg/github/actions/.
The nested env/ subpackage was confusing since it's unrelated to pkg/env/.

Changes:
- Create pkg/github/actions/actions.go with path helpers
- Create pkg/github/actions/format.go with GitHub formatting (heredoc)
- Create pkg/github/actions/actions_test.go with comprehensive tests
- Update pkg/env/formatters.go to delegate to ghactions.FormatValue()
- Update cmd imports to use ghactions alias
- Delete pkg/github/actions/env/ directory

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat: Add --export flag to atmos env command

Add flexible export control for bash format output:
- `atmos env --format=bash` outputs `export KEY='value'` (default)
- `atmos env --format=bash --export=false` outputs `KEY='value'`

Changes:
- Add WithExport(bool) option to pkg/env for controlling export prefix
- Add ParseFormat() function for cleaner format string conversion
- Simplify cmd/env/env.go by removing duplicate switch statements
- Add comprehensive tests for new functionality

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* [autofix.ci] apply automated fixes (attempt 3/3)

* refactor: Use shellescape.Quote for shell-safe quoting

Replace custom EscapeSingleQuotes with battle-tested shellescape library:
- shellescape.Quote handles all edge cases properly
- Only quotes values when needed (simple values stay unquoted)
- Uses `'"'"'` pattern for single quote escaping
- Remove unused EscapeSingleQuotes function

Output format changes:
- Simple values: `export FOO=bar` (was: `export FOO='bar'`)
- Quoted values: `export MSG='it'"'"'s'` (was: `export MSG='it'\''s'`)

Both formats are valid shell syntax.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* [autofix.ci] apply automated fixes

* test: Update terraform output tests for shellescape format

Update test expectations to match shellescape.Quote behavior:
- Simple values like "vpc-123", "localhost" are not quoted
- Only values requiring escaping get quotes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* [autofix.ci] apply automated fixes

* fix: Address CodeRabbit PR review feedback

- Regenerate NOTICE file with updated dependencies
- Fix heredoc delimiter collision in FormatValue by adding suffix iteration
- Add tests for delimiter collision avoidance
- Update blog post author from 'atmos' to 'osterman'

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* [autofix.ci] apply automated fixes

* fix: Update ui.Successf call after return type change

The ui.Successf function no longer returns an error after refactor
in #1980. Update executeGitHubOutput to call Successf separately
and return nil.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: Preserve empty values in GitHub Actions output format

GitHub Actions supports empty values (e.g., FOO=) per the official
specification. The previous implementation skipped empty values which
could break downstream workflows expecting variables to exist even
when empty.

This aligns with pkg/env behavior which preserves empty strings.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: Add backticks around CLI flags in error message for markdown rendering

Addresses CodeRabbit PR review feedback for proper markdown formatting.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: Address PR comments and improve CI resilience

- Honor single-output requests for --format=github by filtering outputs
  when a specific output name is provided
- Wrap FormatOutputsWithOptions and WriteToFile errors with proper
  errUtils.Build() for consistent error handling
- Add retry logic with exponential backoff to fetch-latest-release plugin
- Use fallback version in production to prevent transient network issues
  from breaking website builds

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: Default --format=github to stdout when GITHUB_OUTPUT not set

- Remove error when $GITHUB_OUTPUT is not set and --output-file not provided
- Write to stdout instead, allowing local preview of github format
- Update docs to reflect output priority: --output-file > $GITHUB_OUTPUT > stdout

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs: Improve roadmap entry for GitHub Actions terraform outputs

- Update label to be more descriptive and action-oriented
- Fuse description and benefits for clearer messaging
- Emphasize multiline value support without jq/manual heredocs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs: Add PR number to roadmap entry for traceability

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* address comments

* update docs

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: aknysh <andriy.knysh@gmail.com>
osterman added a commit that referenced this pull request Jan 23, 2026
Main branch merged #1980 which removed error returns from ui.* functions.
Updated cmd/ci/status.go and cmd/terraform/planfile/*.go to match the
new API that doesn't return values.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
osterman added a commit that referenced this pull request Jan 23, 2026
Main branch merged #1980 which removed error returns from ui.* functions.
Updated cmd/ci/status.go and cmd/terraform/planfile/*.go to match the
new API that doesn't return values.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch A minor, backward compatible change size/xl Extra large size PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants