Implement source field tracking and update command for workflow provenance#1175
Closed
Implement source field tracking and update command for workflow provenance#1175
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>
Copilot
AI
changed the title
[WIP] Add source field handling for workflows
Implement source field tracking and update command for workflow provenance
Oct 2, 2025
Contributor
|
Update the reference format to |
Contributor
|
let's just restart it from the epic. |
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.
Overview
This PR implements the
sourcefield proposal for tracking workflow provenance and enabling seamless updates from source repositories. Workflows installed from packages now automatically track their origin, allowing users to update them when new versions become available.Key Changes
1. Automatic Source Field Population
When adding workflows from packages, the system now automatically populates a
sourcefield in the frontmatter:The format is:
org/repo <ref> path/to/workflow.mdThis happens transparently when using:
2. New
gh aw updateCommandThe update command allows updating workflows that have source information:
Update Algorithm:
3. Enhanced
gh aw statusCommandThe status command now displays source tracking information:
The command checks:
Implementation Details
Source Field Generation
The
generateSourceField()function creates the source string by:Update Merge Strategy
The update process uses a conservative merge strategy:
sourcefield itself)This ensures that configuration updates flow from upstream while preserving local documentation customizations.
Testing
Added comprehensive unit tests:
TestGenerateSourceField: Validates source field generation logicTestAddSourceToWorkflow: Tests adding source to workflow frontmatterTestFindWorkflowsWithSource: Validates finding workflows with sourceTestCheckUpdateAvailable: Tests update availability detectionExample Workflow
Files Changed
cmd/gh-aw/main.go: Added update command to CLIpkg/cli/commands.go: Source field helpers and status enhancementspkg/cli/update_command.go: Update command implementation (new)pkg/cli/source_field_test.go: Unit tests (new)Breaking Changes
None. The source field is optional and only populated for workflows added from packages. Existing workflows continue to work without modification.
Related Issue
Closes #[issue-number]
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.