Skip to content

feat: support custom node role label sources - #615

Merged
nklmilojevic merged 1 commit into
mainfrom
feat/node-role-label-sources
Sep 16, 2026
Merged

nklmilojevic merged 1 commit into
mainfrom
feat/node-role-label-sources

Conversation

@nklmilojevic

Copy link
Copy Markdown
Owner

Nodes with custom role labels showed <none> in ROLES. Add [node_roles].label_prefixes and label_keys so the built-in column can collect roles from custom key suffixes and label values. Both Kubernetes sources remain active; roles are sorted and duplicates are removed.

The settings support startup, cluster/context overrides, and reload. Display, filtering, and sorting use the same values. Empty prefixes produce a warning and are skipped. Custom path columns retain their own values.

Agreed discussion: #577 (comment)

Closes #614

Validation: just check (format check, clippy with warnings denied, and all tests). Added keyboard-driven tests for defaults, custom sources, empty values and prefixes, duplicate roles, filtering, sorting, overrides, reload, and custom views.

Node roles only read the two built-in Kubernetes label sources, so custom role labels could not appear in the same column. Add configured prefixes and exact keys with normal overrides and reload support, and use the resolved roles for display, filtering, and sorting.

Closes #614
@greptile-apps

greptile-apps Bot commented Sep 16, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds configurable label prefixes and exact label keys for deriving the built-in node ROLES column.

  • Preserves the two built-in Kubernetes role-label sources.
  • Compiles, deduplicates, and propagates custom sources through startup, reload, and context changes.
  • Uses the resulting role text consistently for display, filtering, and sorting.
  • Documents override behavior and adds coverage for custom sources, duplicate roles, warnings, lifecycle changes, and custom views.

Confidence Score: 5/5

The PR appears safe to merge; no actionable correctness, security, or repository-rule issues were identified.

The configured sources are compiled and refreshed across each supported lifecycle path, and all node-role consumers share the same extracted value without altering custom path-backed columns.

Important Files Changed
Filename Overview
src/config.rs Adds deserialization and compilation of custom node-role prefixes and exact label keys, including empty-prefix warnings and deduplication.
src/columns.rs Threads compiled sources into node view contexts and extends the existing role extractor while preserving custom path-column behavior.
src/app/rows.rs Attaches the current node-role configuration whenever the active view specification is rebuilt.
src/app/actions.rs Recompiles node-role sources during configuration reload before refreshing the view.
src/app/pickers.rs Resolves node-role sources for the newly selected cluster or context before rebuilding its resource view.
src/main.rs Compiles startup node-role configuration and exposes configuration warnings consistently.
src/app/tests/node_roles.rs Covers reload, overrides, filtering, sorting, deduplication, empty inputs, warnings, and custom view source selection.
docs/configuration.md Documents source semantics, built-in defaults, override behavior, reload support, and custom-view interactions.
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
    C["Base, cluster, and context config"] --> M["Resolve overrides"]
    M --> P["Compile node-role sources"]
    P --> A["App.node_roles"]
    A --> V["Attach sources to node ViewSpec"]
    V --> E["Extract built-in and custom roles"]
    E --> N["Sort and deduplicate"]
    N --> D["Display"]
    N --> F["Filter"]
    N --> S["Sort"]
Loading

Reviews (1): Last reviewed commit: "feat: support custom node role label sou..." | Re-trigger Greptile

@nklmilojevic
nklmilojevic merged commit 89bfb29 into main Sep 16, 2026
4 checks passed
@nklmilojevic
nklmilojevic deleted the feat/node-role-label-sources branch September 16, 2026 13:10
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.

feat: support custom node role label sources

1 participant