Skip to content

test(agents): integration specs for the Configuration tab [21/21] - #342

Merged
gusfcarvalho merged 4 commits into
agent-config/20-config-tabfrom
agent-config/21-config-tab-integration-tests
Oct 6, 2026
Merged

gusfcarvalho merged 4 commits into
agent-config/20-config-tabfrom
agent-config/21-config-tab-integration-tests

Conversation

@gusfcarvalho

@gusfcarvalho gusfcarvalho commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Part 21 of 21 of the stacked split of #318 (agent remote configuration). Every layer adds the final version of its files from #318, and only imports from layers below it, so each layer passes make reviewable on its own. Nothing is reachable in the app until layer 20 wires the Configuration tab in.

What

Integration specs that mount the full Configuration tab: inline editing, pending changes and review-and-save, plugin tabs, and add-plugin gating.

Tests

This layer is tests only.

Size exception

This PR is over the 1k-line limit (about 1,290 lines, all tests) and carries the size-exception label. These four specs mount the whole AgentConfigTab to test flows that cross components (edit inline → pending changes bar → review-and-save → save; adding a plugin against instance capabilities). They can't move below layer 20 because the tab doesn't exist until then, and moving them into layer 20 would push that layer to about 2.2k lines. Splitting them across more test-only PRs would add review rounds without making any one of them easier to read. No production code changes here.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Expanded coverage of agent configuration workflows, including plugin access restrictions, inline editing, pending changes, save conflicts, and plugin-tab navigation.
    • Added checks for permission-based controls, accessible restriction explanations, preview and discard behavior, and preserving or rebasing edits after conflicts.
    • These checks help verify that configuration changes and access states behave consistently across supported scenarios.

Copilot AI balanced review requested due to automatic review settings October 5, 2026 10:52
@coderabbitai

coderabbitai Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 333f210f-bcd5-40f8-8d21-a02c6f9fd61b
📥 Commits

Reviewing files that changed from the base of the PR and between f630a5c and 224c22a.

📒 Files selected for processing (4)
  • src/components/agents/config/__tests__/AddPluginGating.spec.ts
  • src/components/agents/config/__tests__/InlineEditing.spec.ts
  • src/components/agents/config/__tests__/PendingChanges.spec.ts
  • src/components/agents/config/__tests__/PluginTabs.spec.ts

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: aef369d8-9bf4-4c03-b317-858c36374f65
📥 Commits

Reviewing files that changed from the base of the PR and between 89bb1db and f630a5c.

📒 Files selected for processing (4)
  • src/components/agents/config/__tests__/AddPluginGating.spec.ts
  • src/components/agents/config/__tests__/InlineEditing.spec.ts
  • src/components/agents/config/__tests__/PendingChanges.spec.ts
  • src/components/agents/config/__tests__/PluginTabs.spec.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Adds four Vitest suites for agent configuration plugin access, tabs, inline editing, and pending-change review and save behavior.

Changes

Agent configuration tests

Layer / File(s) Summary
Plugin access and tabs
src/components/agents/config/__tests__/AddPluginGating.spec.ts, src/components/agents/config/__tests__/PluginTabs.spec.ts
Adds coverage for plugin-add access rules, restriction indicators, tab navigation, plugin draft changes, and empty and reader views.
Inline editing and field access
src/components/agents/config/__tests__/InlineEditing.spec.ts
Adds coverage for editing and removing configuration values, field access states, validation, and reader permissions.
Pending changes and review
src/components/agents/config/__tests__/PendingChanges.spec.ts
Adds coverage for draft preview, review, save, discard, conflict handling, and edits made during an in-flight save.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to f630a

The added configuration tests introduce no identified product behavior change or merge-blocking issue. Merge after normal checks.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 30.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the pull request’s main change: integration tests for the Configuration tab.
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit checks each plugin gate,
Then hops through tabs at a steady rate.
Draft fields change, previews glow,
Conflicts keep edits in the flow.
Saved with a comment, off we go!

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

@gusfcarvalho
gusfcarvalho added this pull request to stack #343 October 5, 2026 10:52
@gusfcarvalho gusfcarvalho added the size-exception PR intentionally exceeds the 1k-line size limit; reasoning in the description label Oct 5, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Several claimed save, conflict, masked-value, and keyboard flows remain incompletely tested.

Review effort: Balanced
Findings: 4 Medium severity

Open (4)
What changed in this PR

Adds full-tab integration coverage for agent remote configuration workflows without changing production code.

Changes:

  • Tests inline editing, field permissions, and masked-value safeguards.
  • Tests pending changes, review/save, conflicts, plugin tabs, and add-plugin gating.
  • Verifies accessibility and keyboard behavior.
File Description
AddPluginGating.spec.ts Tests instance-based plugin installation gating.
InlineEditing.spec.ts Tests inline editors and field access states.
PendingChanges.spec.ts Tests draft review, saving, and conflicts.
PluginTabs.spec.ts Tests plugin tab behavior and accessibility.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +138 to +140
it('config keys: per-key editor with Remove, and never pre-fills a masked value (R25)', async () => {
const { wrapper, ws } = await mountTab();
const editor = await openEditor(wrapper, '/plugins/local-ssh/config/port');
Comment on lines +127 to +131
it('Review & save previews, then saves ONE revision with If-Match and the comment', async () => {
const saved = { ...configRev7, revision: 8, overlay: { verbosity: 2 } };
api.current.putConfig = vi
.fn()
.mockResolvedValue({ revision: saved, created: true });
expect(wrapper.find('[data-test="pending-bar"]').exists()).toBe(false);
});

it('409: shows the conflict and keeps the changes on "Keep my changes"', async () => {
Comment on lines +118 to +121
await tab(wrapper, 'ubuntu-packages').trigger('keydown', { code: 'Home' });
expect(document.activeElement).toBe(tab(wrapper, 'local-ssh').element);
await tab(wrapper, 'local-ssh').trigger('keydown', { code: 'Enter' });
expect(selectedTabs(wrapper)).toEqual(['plugin-tab-local-ssh']);
ianmiell
ianmiell previously approved these changes Oct 6, 2026

@ianmiell ianmiell left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ccf-review: APPROVE

no findings.

Stack (gh stack 343): #322 → #323 → #324 → #325 → #326 → #327 → #328 → #329 → #330 → #331 → #332 → #333 → #334 → #335 → #336 → #337 → #338 → #339 → #340 → #341 → #342

ianmiell
ianmiell previously approved these changes Oct 6, 2026

@ianmiell ianmiell left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ccf-review: APPROVE

no findings.

Stack (gh stack 343): #322 → #323 → #324 → #325 → #326 → #327 → #328 → #329 → #330 → #331 → #332 → #333 → #334 → #335 → #336 → #337 → #338 → #339 → #340 → #341 → #342

@ccf-lisa
ccf-lisa Bot force-pushed the agent-config/21-config-tab-integration-tests branch from 1c1b7f8 to d5b1242 Compare October 6, 2026 13:32
@ccf-lisa
ccf-lisa Bot force-pushed the agent-config/21-config-tab-integration-tests branch from d5b1242 to 7f87365 Compare October 6, 2026 14:20
@ccf-lisa
ccf-lisa Bot force-pushed the agent-config/21-config-tab-integration-tests branch from 7f87365 to 4ae4c8d Compare October 6, 2026 14:38

@gusfcarvalho gusfcarvalho left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ccf-review: would APPROVE

Submitted as COMMENT: GitHub does not let a PR's author request changes on or approve it.

1 Nit.

Stack (gh stack 343): #322 → #323 → #324 → #325 → #326 → #327 → #328 → #329 → #330 → #331 → #332 → #333 → #334 → #335 → #336 → #337 → #338 → #339 → #340 → #341 → #342

Outside the diff

  • [Nit] src/views/admin/AgentsView.vue:568 Before permissions hydrate, admins land on the Configuration tab and are then moved to Details: isAdmin is false until permissionsReady, and can() is optimistic, so on a cold load of /admin/agents defaultTab() returns 'config'. If the agent list resolves before /me/permissions, AgentConfigTab mounts and starts its loads (ensurePermissions waits for hydration, then fires GET config, instances and instance detail). The permissionsReady watch then moves the admin to Details and unmounts the tab. The requests still in flight are not cancelled. (1f18dbff7e7a)

Fixed later in the stack

  • Plugin lookups by name read inherited properties in src/components/agents/config/PluginSummaryCard.vue: fixed in #338
  • Add plugin can silently replace a plugin the saved overlay already defines in src/components/agents/config/PluginTabs.vue: fixed in #339
  • CORE-TEST-002 in src/components/agents/config/__tests__/InlineEditing.spec.ts: fixed in #342
  • CORE-ERR-001 in src/components/agents/config/editor/SavePreviewPanel.vue: fixed in #334
  • UI-COMP-001 in src/components/agents/config/editor/KeyValueEditor.vue: fixed in #333
  • 422 errors for instances not in the preview are never shown, but still disable Save in src/components/agents/config/editor/SavePreviewPanel.vue: fixed in #334
  • policy_data arrays lack the "differs across instances" warning the policies editor has in src/components/agents/config/effective/PolicyDataNode.vue: fixed in #337
  • Removals are computed against whichever instance files happen to be loaded in src/composables/agent-config/useOverlayDraft.ts: fixed in #331
  • CORE-DUP-001 in src/utils/agent-config/__tests__/fixtures/agentconfig-conformance.json: fixed in #325
  • Follow the API's bounded instance list (companion of api#476) in src/composables/agent-config/useAgentConfigApi.ts: fixed in #330
  • The sync summary now counts stale instances as in sync in src/utils/agent-config/instance-status.ts: fixed in #327

gusfcarvalho and others added 4 commits October 6, 2026 12:14
Layer 21 of 21 in the stacked split of #318.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nces

"a reader gets no pencils and no plugin actions" only asserted
absences, so it passed when the tab failed to load (CORE-TEST-002). It
now first expects the schedule field and the local-ssh card.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
"keeps the shield on the new plugin's tab" lists an extra instance
(ip-all) the fixture API had no detail for. Its load failed silently
before; now Add plugin waits for every reporting instance's file, so
the spec serves ip-all's detail too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AddPluginGating and InlineEditing build their fleets with
pagedListInstances, so meta (page fields, counts) matches the rows as
the paginated API's would.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gusfcarvalho
gusfcarvalho force-pushed the agent-config/21-config-tab-integration-tests branch from 4ae4c8d to 224c22a Compare October 6, 2026 15:14
@gusfcarvalho
gusfcarvalho merged commit 28aa99a into main Oct 6, 2026
4 checks passed
@gusfcarvalho
gusfcarvalho deleted the agent-config/21-config-tab-integration-tests branch October 6, 2026 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size-exception PR intentionally exceeds the 1k-line size limit; reasoning in the description

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants