Skip to content

feat!: Remove root-user command in favor of user command#201

Merged
jarfernandez merged 3 commits intomainfrom
feat/remove-root-user-command
Mar 16, 2026
Merged

feat!: Remove root-user command in favor of user command#201
jarfernandez merged 3 commits intomainfrom
feat/remove-root-user-command

Conversation

@jarfernandez
Copy link
Copy Markdown
Owner

Summary

  • Remove root-user command: The user command (added in v0.21.0) fully supersedes root-user. Without flags or policy, user performs the exact same non-root check. Removing root-user simplifies the CLI, reduces maintenance, and avoids confusion about which command to use
  • Delete all root-user artifacts: root_user.go, root_user_test.go, RootUserDetails struct, render function, config constants, and all references in config files, CI workflow, and documentation
  • Update all command: Check count drops from 11 to 10. All orchestration tests, config tests, and help text updated accordingly
  • Bump version to v1.0.0: Updated .github/release-please-manifest.json to signal API stability

BREAKING CHANGE

The root-user command has been removed. Use user instead, which provides the same basic non-root check plus additional policy-based validation (UID ranges, blocked users, numeric UID requirements).

Test plan

  • All unit tests pass (go test ./...)
  • Missing root-user test case (0:somegroup) ported to user_test.go
  • golangci-lint passes with 0 issues
  • pre-commit run --all-files passes
  • E2E: check-image --help does NOT show root-user
  • E2E: check-image root-user nginx:latest returns "unknown command" (exit 2)
  • E2E: check-image user nginx:latest works (basic non-root check)
  • E2E: check-image all nginx:latest --skip registry,labels,platform -o json runs 7 checks (no root-user)
  • Coverage remains at 94.6%

🤖 Generated with Claude Code

The `user` command (added in v0.21.0) fully supersedes `root-user`.
Without flags or policy, `user` performs the exact same non-root check.
Removing `root-user` simplifies the CLI, reduces maintenance, and avoids
confusion about which command to use.

BREAKING CHANGE: The `root-user` command has been removed. Use `user`
instead, which provides the same basic non-root check plus additional
policy-based validation (UID ranges, blocked users, numeric UID
requirements).

- Delete `root_user.go`, `root_user_test.go`, and `RootUserDetails` struct
- Remove `root-user` from `all` command (check count: 11 → 10)
- Update all config files, tests, CI workflow, and documentation
- Bump version to v1.0.0 in release-please manifest
The `go fix` hook runs `go fix ./...` before linting and testing,
ensuring code always uses modern Go patterns (e.g., `new(v)` instead
of helper functions marked with `//go:fix inline`). The `modernize`
linter in `golangci-lint` v2 provides the same detection in CI.
@jarfernandez jarfernandez self-assigned this Mar 16, 2026
`go fix` rewrites code that the linter then validates. Running it after
`golangci-lint` meant the linter analyzed pre-modernization code.
@jarfernandez jarfernandez merged commit 43ca533 into main Mar 16, 2026
13 checks passed
@jarfernandez jarfernandez deleted the feat/remove-root-user-command branch March 16, 2026 01:30
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