Skip to content

Refactor command handling and tag reconciliation#47

Merged
ncode merged 2 commits into
mainfrom
juliano/refactoring
May 29, 2026
Merged

Refactor command handling and tag reconciliation#47
ncode merged 2 commits into
mainfrom
juliano/refactoring

Conversation

@ncode
Copy link
Copy Markdown
Owner

@ncode ncode commented May 29, 2026

Summary

Refactors TagIt command execution and tag updates into smaller, testable units.

  • Moves shared Cobra/Viper input resolution and command dependencies into dedicated command helpers.
  • Extracts managed tag reconciliation, scheduler behavior, and Consul service registration updates.
  • Updates systemd generation to render an explicit ExecStart invocation from shared command input.
  • Documents the TAGIT_* environment variable precedence and shared validation path.
  • Adds focused coverage for the refactored command, scheduler, registration, and TagIt helper paths.

Impact

The CLI paths now share validation and construction logic, while tag cleanup and reconciliation preserve unmanaged Consul tags through a focused reconciler. The systemd command now uses the same input resolution path as run and cleanup, with separate tests for invocation rendering.

Validation

  • go test ./cmd ./pkg/tagit ./pkg/consul
  • go test -coverpkg=./... ./... -race -coverprofile=coverage.out -covermode=atomic

@ncode ncode changed the title [codex] Refactor command handling and tag reconciliation Refactor command handling and tag reconciliation May 29, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 29, 2026

Codecov Report

❌ Patch coverage is 98.45679% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.09%. Comparing base (1fa5cf2) to head (87d9c06).

Files with missing lines Patch % Lines
cmd/systemd.go 83.33% 2 Missing and 2 partials ⚠️
cmd/intake.go 98.61% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #47      +/-   ##
==========================================
+ Coverage   89.94%   96.09%   +6.14%     
==========================================
  Files           8       13       +5     
  Lines         368      512     +144     
==========================================
+ Hits          331      492     +161     
+ Misses         25       14      -11     
+ Partials       12        6       -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

@ncode ncode marked this pull request as ready for review May 29, 2026 08:25
@ncode ncode merged commit ee0b6ae into main May 29, 2026
9 checks passed
@ncode ncode deleted the juliano/refactoring branch May 29, 2026 08:26
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