Fix CLI SOURCE column for GitHub/Slack TaskSpawners
What type of PR is this?
/kind bug
What this PR does / why we need it:
The SOURCE column in kelos get taskspawners was misleading in two ways:
-
GitHub Issues / Pull Requests spawners showed the workspace name.
When aworkspaceRefwas set (which is required for both source types),
printTaskSpawnerTableoverrode the source label with the workspace
name. Since the workspace ref is required, users almost always saw
my-workspaceinstead ofGitHub Issues/GitHub Pull Requests,
making the table unreadable. The workspace is already shown separately
in the-ddetail view. -
Slack spawners showed an empty SOURCE. There was no
Slackbranch
in eitherprintTaskSpawnerTableorprintTaskSpawnerDetail, so the
SOURCE column was blank for Slack spawners and-drendered no
Slack-specific fields (channels, triggers, exclude patterns).
This PR:
- Always prints
GitHub Issues/GitHub Pull Requestsfor those sources
(workspace remains visible in detail view). - Adds a
Slackbranch to the table view. - Adds a
Slackbranch to the detail view that printsChannels,
Triggers, andExclude Patternswhen set. - Updates the existing
GitHubPullRequeststable test (which asserted the
buggy workspace-name behavior) and adds positive tests for GitHub Issues
with a workspace, Slack table output, and Slack detail output.
Which issue(s) this PR is related to:
Fixes #1147
Special notes for your reviewer:
N/A
Does this PR introduce a user-facing change?
Fix `kelos get taskspawners` SOURCE column to show `GitHub Issues` or `GitHub Pull Requests` instead of the workspace name, and to show `Slack` for Slack-based spawners. `kelos get taskspawner -d` now also prints Slack channels, triggers, and exclude patterns.
Summary by cubic
Fixes the SOURCE column in kelos get taskspawners to show the actual source for GitHub and Slack spawners. Improves table clarity and adds Slack details in the -d view.
- Bug Fixes
- Table: Always show "GitHub Issues" or "GitHub Pull Requests" (not the workspace name). Show "Slack" for Slack spawners.
- Detail: Print Slack Channels, Triggers, and Exclude Patterns.
- Tests: Updated GitHub PR table; added GitHub Issues (with workspace) and Slack table/detail tests; tightened Slack table check by renaming the fixture to avoid false positives.