fix(abctl): correct pipeline divider row cell count (fixes startup panic)#469
fix(abctl): correct pipeline divider row cell count (fixes startup panic)#469huang195 wants to merge 1 commit into
Conversation
…nic)
The inbound/outbound "(app)" divider row in the pipeline table carried 7 cells, but the table has only 6 columns (the WRITES column was removed earlier). bubbles' table.renderRow indexes columns by cell position, so it panicked ("index out of range [6] with length 6") whenever abctl rendered a pipeline. Trim the divider to 6 cells and add a regression test asserting every row matches the column count.
Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com>
Signed-off-by: Hai Huang <huang195@gmail.com>
📝 WalkthroughWalkthroughThis PR documents and tests a cell-count constraint in the pipeline table divider row. Comments clarify that the divider must have exactly 6 cells to match the table's column structure, preventing bubbles table renderer panics. A new regression test verifies all rows conform to this 6-cell requirement. ChangesPipeline Table Divider Row Cell-Count Constraint
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies" Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
authbridge/cmd/abctl/tui/pipeline_pane_test.go (1)
16-22: 💤 Low valueConsider initializing
m.eventsfor test completeness.While
rebuildPipelineTable()handles a nileventsmap safely (viacountEventsPerPlugin()ranging over nil), explicitly initializing it would make the test's model setup more complete and self-documenting.Optional: initialize events map
m := &model{ pipeline: &apiclient.PipelineView{ Inbound: []apiclient.PipelinePlugin{{Name: "jwt-validation", Direction: "inbound", Position: 1}}, Outbound: []apiclient.PipelinePlugin{{Name: "token-exchange", Direction: "outbound", Position: 1}}, }, pipelineTbl: newPipelineTable(), + events: map[string][]apiclient.Event{}, }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@authbridge/cmd/abctl/tui/pipeline_pane_test.go` around lines 16 - 22, Initialize the model's events map in the test setup: when creating the model instance (m := &model{...}) add an explicit m.events = make(map[string]int) so the test model is fully initialized; this is a simple change near the model literal used in pipeline_pane_test.go and keeps rebuildPipelineTable() and countEventsPerPlugin() behavior unchanged while making the test self-documenting.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@authbridge/cmd/abctl/tui/pipeline_pane_test.go`:
- Around line 16-22: Initialize the model's events map in the test setup: when
creating the model instance (m := &model{...}) add an explicit m.events =
make(map[string]int) so the test model is fully initialized; this is a simple
change near the model literal used in pipeline_pane_test.go and keeps
rebuildPipelineTable() and countEventsPerPlugin() behavior unchanged while
making the test self-documenting.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 5ff6831a-effb-46c8-9bb5-34730e9d05d0
📒 Files selected for processing (2)
authbridge/cmd/abctl/tui/pipeline_pane.goauthbridge/cmd/abctl/tui/pipeline_pane_test.go
|
Superseded by #470 (combined with the echo-demo preflight fix). |
Summary
abctlpanics on startup the moment it renders a pipeline:Root cause
The pipeline table defines 6 columns (
#,DIRECTION,PLUGIN,DEPS,BODY,EVENTS), andpipelineRowreturns 6 cells — but the inbound/outbound── (app) ──divider row still had 7 cells:It's a leftover from when the table had a 7th
WRITEScolumn (removed in the capability-simplification change). bubbles'table.renderRowindexes the column slice by cell position, so the 7th cell on a 6-column table panics withindex out of range [6] with length 6.Fix
pipeline_pane_test.go— a regression test asserting every row built byrebuildPipelineTable(including the divider) has exactly the column count, so this can't silently recur.go test ./cmd/abctl/tui/passes;abctlno longer panics rendering a pipeline.Attribution
Assisted-By: Claude Code
Summary by CodeRabbit
Bug Fixes
Tests