Skip to content

fix(authbridge): post-#464 follow-ups — abctl pipeline panic + echo demo preflight#470

Merged
huang195 merged 4 commits into
rossoctl:mainfrom
huang195:fix/placeholder-swap-followups
Jun 3, 2026
Merged

fix(authbridge): post-#464 follow-ups — abctl pipeline panic + echo demo preflight#470
huang195 merged 4 commits into
rossoctl:mainfrom
huang195:fix/placeholder-swap-followups

Conversation

@huang195

@huang195 huang195 commented Jun 3, 2026

Copy link
Copy Markdown
Member

Summary

Small follow-ups in the authbridge abctl / echo-demo area (post-#464). Three independent fixes:

1. fix(abctl): pipeline divider row cell count — fixes startup panic

abctl panicked the moment it rendered a pipeline:

runtime error: index out of range [6] with length 6
  .../bubbles/table.(*Model).renderRow → .../abctl/tui.(*model).rebuildPipelineTable

The pipeline table has 6 columns and pipelineRow returns 6 cells, but the inbound/outbound ── (app) ── divider row still had 7 cells — a leftover from when there was a 7th WRITES column. bubbles' renderRow indexes columns by cell position, so the extra cell panics. Trimmed the divider to 6 cells + added a regression test asserting every row matches the column count.

2. fix(abctl): scope event detail to the selected plugin

The events list is one row per plugin invocation, but selecting a row rendered the whole SessionEvent (every plugin's invocation + the full per-plugin Plugins map). Now the selected invocation is carried through to showDetail, which renders a copy of the event scoped to just that plugin's invocations and Plugins entry (event-level context like the protocol slot/identity is preserved). Added eventScopedToPlugin + unit tests.

3. demo(authbridge): echo demo — fail fast in preflight on missing python-keycloak

make demo-echo checked python-keycloak only in the late setup-keycloak step, so a missing package failed the run after building images, overriding the operator config, and deploying. Moved the check into preflight (first step), matching the existing PyYAML check.

Testing

  • go test ./cmd/abctl/tui/ passes (incl. the two new regression tests); abctl no longer panics, and event detail is plugin-scoped.
  • make demo-echo now errors in preflight with a clear install hint when python-keycloak is absent.

abctl / demo / tooling only; no production authbridge runtime code touched.

Attribution

Assisted-By: Claude Code

Summary by CodeRabbit

  • New Features

    • Detail view can be scoped to a selected plugin invocation for focused event inspection and will preserve that scope across resizes/re-renders.
  • Bug Fixes

    • Pipeline table divider row and other rows now consistently match column count to prevent rendering panics.
  • Tests

    • Added regression test for pipeline table row/column alignment.
    • Added tests verifying event scoping filters plugin data without mutating the original.
  • Chores

    • Demo preflight now checks for required Python package and suggests an install command.

Review Change Stack

huang195 added 2 commits June 3, 2026 06:16
make demo-echo previously failed at the late setup-keycloak step (after building images, overriding the operator, and deploying) when python-keycloak was missing. Move the check into preflight so it fails before any of that.

Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com>
Signed-off-by: Hai Huang <huang195@gmail.com>
…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>
@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 56ca9060-4bbe-409f-9ea2-63d4264ac1c0

📥 Commits

Reviewing files that changed from the base of the PR and between 36cde30 and b830120.

📒 Files selected for processing (2)
  • authbridge/cmd/abctl/tui/detail_pane.go
  • authbridge/demos/echo/Makefile

📝 Walkthrough

Walkthrough

Adds invocation-scoped event detail rendering and selection plumbing, fixes a pipeline table divider row to match the table’s 6 columns with a regression test, and adds a demo preflight check to verify python-keycloak is installed.

Changes

TUI: invocation scoping and pipeline rendering

Layer / File(s) Summary
Event detail scoping and selection plumbing
authbridge/cmd/abctl/tui/app.go, authbridge/cmd/abctl/tui/detail_pane.go, authbridge/cmd/abctl/tui/detail_pane_test.go, authbridge/cmd/abctl/tui/events_pane.go, authbridge/cmd/abctl/tui/keys.go
Adds model.detailInvocation to remember a selected pipeline.Invocation; implements eventScopedToPlugin and filterInvocationsByPlugin; updates model.showDetail to accept an optional invocation and render a plugin-scoped event when provided; adds selection plumbing (selectedInvocation) and updates key handlers to pass the invocation. Tests verify scoping behavior and non-aliasing.
Pipeline table divider row cell count fix and regression test
authbridge/cmd/abctl/tui/pipeline_pane.go, authbridge/cmd/abctl/tui/pipeline_pane_test.go
Divider row between inbound and outbound pipeline sections corrected to produce exactly 6 cells (matching the table's 6 columns). Comments document the column-count requirement. New test TestRebuildPipelineTable_AllRowsMatchColumnCount asserts every row's cell count equals 6 to prevent render panics.

Demo preflight

Layer / File(s) Summary
Preflight dependency verification
authbridge/demos/echo/Makefile
preflight target now verifies python-keycloak can be imported; when missing it prints an install hint and exits non-zero to stop downstream demo build/deploy steps. Documentation strings updated to recommend pip3 install --user python-keycloak.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • pdettori

Poem

🐰
Six tidy cells in each table row,
An invocation chosen slow,
Detail scoped where insights grow,
Keycloak checked before the show,
Rabbits hop—your UI's aglow!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately summarizes the three main fixes: pipeline divider panic, event detail scoping, and demo preflight check improvements—all post-#464 follow-ups.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


Comment @coderabbitai help to get the list of available commands and usage tips.

The events list is one row per plugin invocation, but selecting a row rendered the whole SessionEvent (every plugin's invocation). Carry the selected invocation through to showDetail and render a copy scoped to that plugin's invocations and Plugins entry.

Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com>
Signed-off-by: Hai Huang <huang195@gmail.com>

@coderabbitai coderabbitai Bot 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.

🧹 Nitpick comments (1)
authbridge/cmd/abctl/tui/detail_pane_test.go (1)

70-127: 💤 Low value

Consider adding edge case test coverage.

The existing tests cover the main scenarios well. For additional robustness, consider adding test cases for:

  • eventScopedToPlugin when the plugin doesn't exist in the invocations or plugins map
  • eventScopedToPlugin when e.Invocations is nil
  • eventScopedToPlugin when e.Plugins is nil

These edge cases are handled correctly by the implementation, but explicit test coverage would improve confidence.

🤖 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/detail_pane_test.go` around lines 70 - 127, Add unit
tests to cover edge cases for eventScopedToPlugin: (1) when the requested plugin
name does not appear in either ev.Invocations or ev.Plugins — assert returned
scoped event has empty Invocations.Inbound and Plugins map (and original ev
unchanged); (2) when ev.Invocations is nil — call eventScopedToPlugin(ev,
"some-plugin") and assert no panic and returned scoped.Invocations is nil or
empty as appropriate and original ev.Invocations remains nil; (3) when
ev.Plugins is nil — call eventScopedToPlugin(ev, "some-plugin") and assert no
panic and returned scoped.Plugins is empty map or nil as per implementation and
original ev.Plugins remains nil; reference the helper eventScopedToPlugin and
the existing tests
TestEventScopedToPlugin_FiltersToSelectedPlugin/TestEventScopedToPlugin_EmptyPluginReturnsUnchanged
to mirror structure and assertions.
🤖 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/detail_pane_test.go`:
- Around line 70-127: Add unit tests to cover edge cases for
eventScopedToPlugin: (1) when the requested plugin name does not appear in
either ev.Invocations or ev.Plugins — assert returned scoped event has empty
Invocations.Inbound and Plugins map (and original ev unchanged); (2) when
ev.Invocations is nil — call eventScopedToPlugin(ev, "some-plugin") and assert
no panic and returned scoped.Invocations is nil or empty as appropriate and
original ev.Invocations remains nil; (3) when ev.Plugins is nil — call
eventScopedToPlugin(ev, "some-plugin") and assert no panic and returned
scoped.Plugins is empty map or nil as per implementation and original ev.Plugins
remains nil; reference the helper eventScopedToPlugin and the existing tests
TestEventScopedToPlugin_FiltersToSelectedPlugin/TestEventScopedToPlugin_EmptyPluginReturnsUnchanged
to mirror structure and assertions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 0d01abf2-6588-43b4-a0d5-0dbf140cfdef

📥 Commits

Reviewing files that changed from the base of the PR and between ab4af84 and 36cde30.

📒 Files selected for processing (5)
  • authbridge/cmd/abctl/tui/app.go
  • authbridge/cmd/abctl/tui/detail_pane.go
  • authbridge/cmd/abctl/tui/detail_pane_test.go
  • authbridge/cmd/abctl/tui/events_pane.go
  • authbridge/cmd/abctl/tui/keys.go

Split the merged doc block so showDetail keeps its own godoc and eventScopedToPlugin gets a one-liner (the comment had drifted onto the helper). Use the PEP 668-friendly 'pip3 install --user' form for the python-keycloak hints, matching the adjacent PyYAML check.

Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com>
Signed-off-by: Hai Huang <huang195@gmail.com>

@cwiklik cwiklik left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean follow-up fixing the pipeline table startup panic (divider row had 7 cells vs 6 columns) and scoping event detail to the selected plugin invocation. Both fixes have regression tests. Echo demo preflight now catches missing python-keycloak early.

Areas reviewed: Go (TUI pane logic, detail scoping, pipeline table), Makefile (echo demo), Tests
Commits: 4 commits, all signed-off
CI status: all passing

@pdettori pdettori left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean follow-up PR fixing two TUI bugs and improving demo UX.

Areas reviewed: Go (TUI logic + tests), Makefile, Security
Commits: 4/4 signed-off, conventional format
CI: All checks passing

No issues found — well-structured fixes with proper regression tests.

@huang195
huang195 merged commit 4cc7bb1 into rossoctl:main Jun 3, 2026
19 checks passed
@github-project-automation github-project-automation Bot moved this from New /:ToDo to Done in Rossoctl Issue Prioritization Jun 3, 2026
@huang195
huang195 deleted the fix/placeholder-swap-followups branch June 3, 2026 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants