Skip to content

refactor: extract the output symbols into a pkg/symbols package - #618

Open
tampakrap wants to merge 1 commit into
crossplane:mainfrom
tampakrap:theo/refactor_pkg_symbols
Open

tampakrap wants to merge 1 commit into
crossplane:mainfrom
tampakrap:theo/refactor_pkg_symbols

Conversation

@tampakrap

Copy link
Copy Markdown
Collaborator

Description of your changes

Define the status markers ([✓] [!] [x]) and the pieces of the tree connectors in pkg/symbols, and use them in the validate renderer and in the trace printer, which had them as string literals. The output unchanged.

This gives the commands one place for these symbols, so that new subcommands print the same ones.

Related:

I have:

  • Read and followed Crossplane's contribution process.
  • Read and followed Crossplane's AI policy and confirmed a human stands behind this PR.
  • Run ./nix.sh flake check to ensure this PR is ready for review.
  • Added or updated unit tests.
  • Linked a PR or a docs tracking issue to document this change.
  • Added backport release-x.y labels to auto-backport this PR.

Need help with this checklist? See the cheat sheet.

Define the status markers (`[✓]` `[!]` `[x]`) and the pieces of the tree
connectors in `pkg/symbols`, and use them in the validate renderer and
in the trace printer, which had them as string literals. The output
unchanged.

This gives the commands one place for these symbols, so that new
subcommands print the same ones.

Signed-off-by: Theo Chatzimichos <tampakrap@gmail.com>
@tampakrap
tampakrap requested review from a team and jcogilvie as code owners November 26, 2026 13:53
@tampakrap
tampakrap requested review from a team, adamwg and haarchri and a balanced review from Copilot and removed request for a team November 26, 2026 13:53

Copilot AI 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.

🟢 Approval recommended

No active review issues are recorded for the refactor centralizing shared CLI output symbols.

No open issues 🎉

What changed in this PR

This refactor centralizes CLI output symbols in pkg/symbols so validation, tracing, and future commands can reuse consistent markers and tree connectors without changing existing output.

Changes:

  • Add shared constants for status markers and tree connectors.
  • Update the validation renderer and trace printer to use those constants.
File Description
pkg/​validate/​output/​render.go Replace local status markers with shared constants.
pkg/​symbols/​tree.go Define and document reusable tree connectors.
pkg/​symbols/​markers.go Define and document reusable status markers.
cmd/​crossplane/​trace/​internal/​printer/​default.go Replace tree connector literals with shared constants.

Review effort: Balanced

@codecov

codecov Bot commented Nov 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 72.72727% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.43%. Comparing base (14a9f58) to head (91b591a).

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

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.

2 participants