Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
Add support for cascading token resolution. The resolution order should be:
|
|
Copilot also adds support for an object-type configuration setting for plugins. This configuration includes a |
|
@copilot Copilot also adds support for an object-type configuration setting for plugins. This configuration includes a repos field, which is a string array of repositories, and a github-token field, which holds a custom token to use. This token overrides the default token resolution chain. |
Added getEffectivePluginGitHubToken function with cascading precedence: 1. Custom token from frontmatter github-token field 2. secrets.GH_AW_PLUGINS_TOKEN 3. secrets.GH_AW_GITHUB_TOKEN 4. secrets.GITHUB_TOKEN Updated all engine integrations to use cascading resolution and added tests for token resolution behavior. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Implemented cascading token resolution with the requested precedence order:
The implementation follows the same pattern used in Example output: - name: 'Install plugin: github/test-plugin'
env:
GITHUB_TOKEN: ${{ secrets.GH_AW_PLUGINS_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
run: copilot install plugin github/test-pluginCommit: bcffcfb |
|
@copilot , make sure the main JSON schema is updated with the new frontmatter entries. |
- Added PluginsConfig struct to support object format with repos and github-token fields - Updated schema to accept both array and object formats using oneOf - Updated extractPluginsFromFrontmatter to return (repos, token) tuple - Updated engine integrations to use plugin-specific token with precedence: 1. plugins.github-token (custom token in object format) 2. github-token (top-level frontmatter token) 3. Cascading fallback (GH_AW_PLUGINS_TOKEN || GH_AW_GITHUB_TOKEN || GITHUB_TOKEN) - Added comprehensive tests for object format with custom token override Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Implemented object-type configuration for plugins with Both formats are now supported: Array format: plugins:
- github/example-pluginObject format: plugins:
repos:
- github/example-plugin
github-token: ${{ secrets.CUSTOM_PLUGIN_TOKEN }}Token precedence: Commit: fea000d
Implemented object-type configuration for plugins with Both formats are now supported: Array format: plugins:
- github/example-pluginObject format: plugins:
repos:
- github/example-plugin
github-token: ${{ secrets.CUSTOM_PLUGIN_TOKEN }}Token precedence: Commit: fea000d |
|
@copilot add more tests for compilation |
The main JSON schema (
Schema validation is active and correctly rejects invalid fields while accepting both valid formats. Updated in commit: fea000d |
Added integration tests covering: - Array format with single and multiple plugins for all engines - Object format with and without custom token - Top-level github-token precedence - Token precedence hierarchy validation - No plugins scenario - Invalid repo format schema validation All 5 test suites with 11 test cases pass successfully. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Added comprehensive compilation tests in Test Coverage (5 test suites, 11 test cases):
All tests pass successfully. Commit: 0daa50e |
There was a problem hiding this comment.
Pull request overview
This PR adds comprehensive plugin installation support to the agentic-workflows compiler, enabling users to specify plugins in the frontmatter that will be automatically installed before workflow execution. The implementation includes dual-format configuration (array and object formats), intelligent cascading GitHub token resolution, and seamless integration with all three supported engines (Copilot, Claude, and Codex).
Changes:
- Added
pluginsfrontmatter field with dual-format support (array or object with optional custom token) - Implemented cascading GitHub token resolution for plugin authentication (custom token → GH_AW_PLUGINS_TOKEN → GH_AW_GITHUB_TOKEN → GITHUB_TOKEN)
- Integrated plugin installation steps into Copilot, Claude, and Codex engine installation flows
Reviewed changes
Copilot reviewed 158 out of 158 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/frontmatter_extraction_metadata.go | Adds extractPluginsFromFrontmatter() to parse both array and object plugin formats |
| pkg/workflow/compiler_types.go | Adds Plugins and PluginsToken fields to WorkflowData struct |
| pkg/workflow/compiler_orchestrator_tools.go | Integrates plugin extraction into tools processing pipeline |
| pkg/workflow/compiler_orchestrator_workflow.go | Passes plugin data to WorkflowData initialization |
| pkg/workflow/copilot_engine_installation.go | Adds plugin installation steps after Copilot CLI installation |
| pkg/workflow/claude_engine.go | Adds plugin installation steps after Claude CLI installation |
| pkg/workflow/codex_engine.go | Adds plugin installation steps after Codex CLI installation |
| pkg/parser/schemas/main_workflow_schema.json | Defines plugins field schema with oneOf for dual-format validation |
| docs/src/content/docs/reference/frontmatter-full.md | Documents the plugins frontmatter field |
| .github/workflows/*.lock.yml | Recompiled workflow lock files with updated MCP_GATEWAY_PAYLOAD_DIR configuration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Adds
pluginsfrontmatter field supporting both array and object formats for flexible plugin configuration. Compiler generates installation steps using engine-specific CLI commands with intelligent cascading GitHub token authentication.Implementation
pluginsin both array and object formats, validate repo slugs (org/repopattern)pluginsfield to main workflow schema withoneOffor dual-format support["org/repo1", "org/repo2"]{ repos: ["org/repo1"], github-token: "${{ secrets.TOKEN }}" }GeneratePluginInstallationSteps()that produces installation steps with:copilot install plugin,claude install plugin,codex install pluginGITHUB_TOKENenvironment variable with cascading token resolutiongetEffectivePluginGitHubToken()with cascading precedence:plugins.github-tokenfrom object format (highest priority, overrides all defaults)github-tokenfrom top-level frontmatter (if specified)secrets.GH_AW_PLUGINS_TOKEN(dedicated plugin token)secrets.GH_AW_GITHUB_TOKEN(general gh-aw token)secrets.GITHUB_TOKEN(default GitHub Actions token)Testing
plugin_installation_test.go): 23 test cases covering step generation, extraction, and token resolutionplugin_compilation_test.go): 11 test cases validating end-to-end compilation:All 34 test cases pass successfully.
Usage
Array format (simple):
Generates installation steps with cascading token resolution:
Object format (with custom token override):
Generates installation steps with custom token:
With top-level github-token:
Generates:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.