Fix admin contribution grant bridge#37
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes the admin contribution “bridge” so contribution registration/listing stays on the legacy (map-shaped) execution path while the plugin advertises proto_with_legacy_struct contracts, enabling contribution composition across workflow steps without relying on process-local registry shortcuts. It also tightens the UI’s permission-grant bridging so admin iframe tools receive the authenticated user’s granted permissions and the nav maintains a single active contribution item.
Changes:
- Switch
step.admin_register_contribution/step.admin_list_contributionscontracts toproto_with_legacy_structwhile keeping those step types on the legacy StepInstance execution path. - Allow
step.admin_list_contributionsto consumecontributionoutputs from prior workflow steps (viacontribution_steps) and filter contributions by granted permissions. - Update the embedded admin UI to pass
granted_permissionsthrough to iframe tools and ensure only one contribution nav item is marked active.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| plugin.contracts.json | Updates step contract modes for contribution steps to proto_with_legacy_struct. |
| internal/ui_dist/index.html | Bridges granted permissions into iframe auth responses; improves nav active-state handling. |
| internal/step_admin.go | Adds legacy step support for aggregating contributions from prior step outputs; adds typed-step fallbacks for missing inputs. |
| internal/step_admin_test.go | Updates tests for map-shaped contribution arrays and validates legacy execution for contribution steps. |
| internal/registry.go | Refactors permission-based listing/filtering path (noted perf/lock behavior in review comment). |
| internal/plugin.go | Limits typed step exposure to non-contribution steps; sets contribution step contract mode explicitly. |
| internal/plugin_contracts_test.go | Verifies contract mode matches runtime registry and manifest. |
| internal/module_dashboard.go | Enables list filtering over provided contributions and normalizes legacy output shapes. |
| internal/module_dashboard_test.go | Updates assertions for contribution list output shape ([]any). |
| internal/assets_test.go | Ensures embedded UI contains the new granted_permissions wiring. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
proto_with_legacy_structcontracts.step.admin_list_contributionsto consume contribution outputs from prior Workflow steps, which makes external plugin contribution composition work without process-local registry shortcuts.Verification
GOWORK=off go test ./internalPASS=96 FAIL=01 passed