Skip to content

Sync main into develop (v0.6.0 release)#81

Merged
yimsk merged 2 commits intodevelopfrom
merge-main-sync
Jan 2, 2026
Merged

Sync main into develop (v0.6.0 release)#81
yimsk merged 2 commits intodevelopfrom
merge-main-sync

Conversation

@yimsk
Copy link
Copy Markdown
Contributor

@yimsk yimsk commented Jan 2, 2026

Summary

Merge main branch into develop to sync after v0.6.0 squash release.

This resolves the conflict in PR #80 by incorporating the squashed v0.6.0 changes back into develop.

Changes: Merge commit only, resolves conflict in cmd/claws/main.go

yimsk added 2 commits January 2, 2026 20:10
* Align naming conventions with AWS CLI (#71)

* Align registry names with AWS CLI conventions

Rename 7 services to match AWS CLI naming:
- computeoptimizer → compute-optimizer
- cognito → cognito-idp
- config → configservice
- costexplorer → ce
- eventbridge → events
- macie → macie2
- sfn → stepfunctions

Old names preserved as aliases for backward compatibility.

Closes #65

* Fix pseudo-ARN prefix to match registry service name (ce)

* Add comment explaining pseudo-ARN format for Cost Explorer

* Rename directories to align with AWS CLI conventions

- Service dirs: costexplorer→ce, eventbridge→events, sfn→stepfunctions,
  cognito→cognito-idp, config→configservice, macie→macie2,
  computeoptimizer→compute-optimizer, servicequotas→service-quotas,
  licensemanager→license-manager, networkfirewall→network-firewall
- Resource dirs: hyphenate compound names (e.g., loggroups→log-groups)
- Update imports and ARN mappings

Closes #65

* Rename bedrock dirs to kebab-case for AWS CLI consistency

* Fix DAO error strings and deduplicate client helpers

* Fix error strings and deduplicate client helpers

* Fix package names to match directory names (events, stepfunctions)

* Add develop branch to CI triggers

* feat: propagate ALL_PROXY to HTTP_PROXY/HTTPS_PROXY (#74)

* feat: support ALL_PROXY environment variable (#69)

* feat: propagate ALL_PROXY to HTTP_PROXY and configure NO_PROXY

Extend proxy support based on issue #69 feedback:
- Propagate ALL_PROXY to both HTTP_PROXY and HTTPS_PROXY
- Auto-configure NO_PROXY for AWS credential endpoints:
  - 169.254.169.254 (EC2 IMDS)
  - 169.254.170.2 (ECS Task Role)
  - 169.254.170.23 (EKS Pod Identity)
- Preserve existing NO_PROXY entries, only add missing endpoints

Refs #69, #67

* fix: default NO_PROXY to IMDS only and remove proxy value from logs

- NO_PROXY now only includes EC2 IMDS (169.254.169.254) by default
- ECS/EKS endpoints can be added via config (TODO #67)
- Remove proxy URL from log output to avoid credential exposure

* refactor: simplify splitNoProxy and use tagged switch in parseFlags

* refactor: separate NO_PROXY config from ALL_PROXY propagation

configureNoProxy() now runs independently when any proxy is set,
not tied to ALL_PROXY propagation. Cleaner separation of concerns.

* refactor: remove lowercase env var support for simplicity

* refactor: remove NO_PROXY auto-configuration

* refactor: skip proxy propagation for --help/--version and cleanup test

* test: add test case for lowercase all_proxy not supported

* feat: add alias completion in command mode (#76)

* feat: add alias completion in command mode (#70)

Include aliases in GetSuggestions() so :cost+Tab suggests cost-explorer.
Self-referential aliases (sfn→sfn) excluded from suggestions.

* refactor: use prefix+fuzzy for diff completion

* refactor: use CutPrefix and cache GetAliases

* refactor: extract match functions to shared module

- Move fuzzyMatch and matchNamesWithFallback to match.go
- Make :tag/:tags clear behavior explicit
- Sort suggestions alphabetically (services + aliases)

* refactor: cache GetAliasesForService and sort match results

* refactor: unify command parser pattern for sort and login

* test: add cache concurrency tests and improve comments

* refactor: use CutPrefix in ecs tasks render

* refactor: use CutSuffix in parseNumericValue

* fix: quote profile name in error message for clarity

* fix: lowercase pattern in fuzzyMatch for case insensitivity

* chore: remove .claude symlink

* chore: add .claude to gitignore

* fix: lowercase pattern in matchNamesWithFallback prefix check

* fix: return defensive copy from alias cache methods
@claude
Copy link
Copy Markdown

claude Bot commented Jan 2, 2026

Pull Request Review: Sync main into develop (v0.6.0 release)

Overview

This PR merges the v0.6.0 release from main back into develop. The release includes significant improvements including AWS CLI naming alignment, proxy support enhancements, and alias completion features. Overall, this is a well-executed merge with high code quality.

✅ Strengths

Code Quality & Best Practices

  • Excellent test coverage: New features include comprehensive unit tests
    • cmd/claws/proxy_test.go: 6 test cases covering ALL_PROXY propagation edge cases
    • internal/view/match_test.go: 13 test cases for fuzzy matching
    • internal/registry/registry_test.go: 23 test cases including concurrency tests
  • Well-documented code: Clear comments explaining behavior and design decisions
  • Proper error handling: Consistent use of error returns and validation
  • Clean architecture: Good separation of concerns (match.go extraction, client.go helpers)

Security

  • No security vulnerabilities detected
  • Proxy credential exposure prevented: Line 212 in main.go avoids logging proxy URLs
  • Input validation: Profile name and region format validation (lines 42-51 in main.go)
  • No hardcoded credentials or secrets

Performance

  • Excellent caching strategy:
    • sync.Once for alias list computation (registry.go:59-62)
    • Defensive copies returned from cache to prevent mutation
    • Concurrent access properly handled with RWMutex
  • Code reuse: Extracted common match functions to avoid duplication

📋 Observations & Minor Suggestions

1. Potential Race Condition (Low Risk)

File: cmd/claws/main.go:200-227

The propagateAllProxy() function is called before logging is initialized (line 24), but logs debug/warn messages. This works because the log package uses no-op until enabled, but it's subtle.

Suggestion: Add a comment explaining this is intentional:

// propagateAllProxy copies ALL_PROXY to HTTP_PROXY/HTTPS_PROXY if not set.
// Called before log initialization - logs will be no-op until EnableFile() called.
func propagateAllProxy() {

2. Test Isolation

File: cmd/claws/proxy_test.go:82-94

The test uses t.Setenv() which is good, but the helper functions could be more defensive.

Observation: Current implementation is fine for Go 1.17+, but consider documenting the Go version requirement since t.Setenv() automatically handles cleanup.

3. Directory Rename Consistency

Observation: The PR renames 250 files to align with AWS CLI kebab-case conventions. This is excellent for consistency, but:

Question for maintainers: Have you verified all import path updates in files not shown in the diff? The genimports script should handle this, but a quick verification would be prudent.

4. Fuzzy Match Algorithm

File: internal/view/match.go:8-19

The fuzzy match implementation is simple and effective, but has O(n*m) complexity.

Suggestion: For future optimization (not blocking), consider caching lowercase conversions if patterns are reused frequently.

🔍 Detailed Code Review

Proxy Support Implementation

Files: cmd/claws/main.go, cmd/claws/proxy_test.go

Strengths:

  • Correct behavior: Only propagates if target vars not set
  • Good test coverage including edge cases
  • Intentionally only supports uppercase (documented in test)

Minor note: The usage text (line 171) correctly documents ALL_PROXY. Consider adding a note about case sensitivity.

Registry Alias System

Files: internal/registry/registry.go, internal/registry/registry_test.go

Strengths:

  • Thread-safe caching with sync.Once
  • Defensive copies prevent cache corruption (lines in registry.go)
  • Concurrent access tests validate safety
  • Self-referential aliases properly excluded

Excellent practice: The cache returns slices.Clone() to prevent external modification.

Match Utilities

Files: internal/view/match.go, internal/view/match_test.go

Strengths:

  • Clean extraction into shared module
  • Prefix matching before fuzzy fallback is smart
  • Case-insensitive by default (good UX)
  • Empty pattern returns all sorted (expected behavior)

Note: Line 30 lowercases the pattern, and line 34 lowercases each name. This is correct and thoroughly tested.

🧪 Test Coverage Assessment

Excellent Coverage (all new features tested):

  • ✅ Proxy propagation: 6 test cases
  • ✅ Fuzzy matching: 13 test cases
  • ✅ Registry aliases: 10+ test cases
  • ✅ Concurrency: 2 dedicated tests
  • ✅ Cache behavior: Multiple test cases

Missing Tests (acceptable for merge commit):

  • Integration tests for directory rename impacts
  • End-to-end command input with aliases

🔒 Security Analysis

No concerns identified:

  • ✅ Input validation on user-provided values
  • ✅ No SQL injection vectors (no raw SQL)
  • ✅ No command injection (no os.Exec with user input)
  • ✅ Proxy credentials not logged
  • ✅ No hardcoded secrets
  • ✅ Thread-safe operations

⚡ Performance Considerations

Optimizations Implemented:

  • ✅ Lazy initialization with sync.Once
  • ✅ Cache defensive copies
  • ✅ Sorted results for predictable output
  • ✅ RWMutex for read-heavy workloads

Potential Future Optimizations (not blocking):

  • Could pre-compile lowercase strings for large datasets
  • Could use trie for prefix matching if performance becomes an issue

📊 Code Metrics

  • Files changed: 250 files (mostly renames for consistency)
  • Additions: 965 lines
  • Deletions: 557 lines
  • Net change: +408 lines (includes tests and documentation)
  • Test-to-code ratio: Excellent (~40% of changes are tests)

✨ Conclusion

Recommendation: APPROVE ✅

This is a high-quality merge commit that brings v0.6.0 changes into develop. The code demonstrates:

  • Excellent software engineering practices
  • Comprehensive test coverage
  • Good documentation
  • No security vulnerabilities
  • Thoughtful performance optimizations
  • Consistent code style

The observations noted above are minor and do not block merging. This PR successfully syncs the release branch while maintaining code quality standards.

Great work on the v0.6.0 release! 🎉


Review conducted by Claude Code Assistant

@yimsk yimsk merged commit 5149ce5 into develop Jan 2, 2026
5 checks passed
@yimsk yimsk deleted the merge-main-sync branch January 2, 2026 16:01
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