-
Notifications
You must be signed in to change notification settings - Fork 28
Add optional fingerprint field for asset tracking #3602
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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 refactor the JavaScript that generates the fingerprint xml comment as a separate file required in JavaScript |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Refactored the fingerprint generation code into a separate reusable module The new module:
All 785 JavaScript tests and 1070+ Go tests pass. All 75 workflows recompiled successfully. Commit: 80fe5c9 |
|
@copilot add core.info with fingerprint value if any |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Added Updated files:
All tests pass. All 75 workflows recompiled. Commit: a1303d9 |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot update shared function to take the type of rendering as parameter (markdown vs text) and refactor the code that generates the xml comment as well |
…rmat parameter Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Consolidated the fingerprint functions into a single unified New API:
Changes:
Commit: ca857ee |
pelikhan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot add fingerprint field to existing agentic workflows
| @@ -0,0 +1,37 @@ | |||
| --- | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot move to test workflows
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved example-fingerprint.md and .lock.yml to .github/workflows/tests/ directory alongside other test workflows like test-firewall-default.md.
Commit: 3dec7ca
pkg/workflow/js/get_fingerprint.cjs
Outdated
| core.info(`Fingerprint: ${fingerprint}`); | ||
| } | ||
|
|
||
| if (!fingerprint) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot simplify this function, make it shorter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simplified the function from 19 lines to 7 lines (63% reduction) by consolidating all return logic into a single ternary expression. All tests still pass.
Commit: 3dec7ca
…ints to daily/weekly workflows Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Added fingerprints to 6 production workflows that create issues or discussions:
These workflows run on schedules (daily/weekly) and now all created assets will be searchable by their fingerprint values. Commit: 3dec7ca |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements an optional fingerprint field in the workflow frontmatter that enables tracking and searching of assets (issues, discussions, comments, PRs) created by GitHub Agentic Workflows. The fingerprint is embedded as an HTML comment in all created assets, making them searchable while remaining invisible in the rendered UI.
Key Changes:
- Added
fingerprintfield to workflow schema with validation (minimum 8 characters, alphanumeric + hyphens/underscores) - Implemented unified
getFingerprint()JavaScript function with format parameter for retrieval and logging - Integrated fingerprint into all safe-output operations (issues, discussions, comments, PRs)
- Updated 6 production workflows to demonstrate real-world usage
Reviewed Changes
Copilot reviewed 87 out of 88 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
pkg/workflow/frontmatter_extraction.go |
Added extractFingerprint() validation function with character validation |
pkg/workflow/compiler.go |
Added Fingerprint field to WorkflowData struct and extraction logic |
pkg/workflow/safe_outputs.go |
Added helper function to build env vars with fingerprint |
pkg/workflow/js/get_fingerprint.cjs |
Implemented unified 7-line function with format parameter and logging |
pkg/workflow/js/get_fingerprint.test.cjs |
Added 9 comprehensive test cases for the fingerprint function |
pkg/workflow/fingerprint_test.go |
Added 11 unit tests for extraction and validation |
pkg/workflow/fingerprint_integration_test.go |
Added 5 integration tests covering all safe-output types |
pkg/parser/schemas/main_workflow_schema.json |
Added schema definition with validation rules |
pkg/workflow/create_issue.go |
Updated to use fingerprint env vars helper function |
pkg/workflow/create_discussion.go |
Updated to use fingerprint env vars helper function |
pkg/workflow/add_comment.go |
Updated to use fingerprint env vars helper function |
pkg/workflow/create_pull_request.go |
Added fingerprint env var passing |
pkg/workflow/create_pr_review_comment.go |
Updated to use fingerprint env vars helper function |
pkg/workflow/js/create_issue.cjs |
Integrated getFingerprint("markdown") call |
pkg/workflow/js/create_discussion.cjs |
Integrated getFingerprint("markdown") call |
pkg/workflow/js/add_comment.cjs |
Integrated getFingerprint("markdown") call |
pkg/workflow/js/create_pull_request.cjs |
Integrated getFingerprint("markdown") call |
*.lock.yml files |
Recompiled workflows with bundled fingerprint function |
| Production workflows | Added fingerprints to 6 workflows for real-world demonstration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add Fingerprint Field to Agentic Workflows ✅
Summary
Successfully implemented an optional top-level
fingerprintfield that is included in all created assets (issues, discussions, comments, PRs) to enable searching and retrieving assets associated with a specific fingerprint.Recent Changes
Simplified and optimized (latest commit):
getFingerprint()function from 19 lines to 7 lines (63% reduction).github/workflows/tests/directoryaudit-workflows.md-fingerprint: audit-workflows-dailyblog-auditor.md-fingerprint: blog-auditor-weeklyci-doctor.md-fingerprint: ci-doctor-failuresdaily-news.md-fingerprint: daily-news-weekdaydaily-repo-chronicle.md-fingerprint: daily-repo-chronicleweekly-issue-summary.md-fingerprint: weekly-issue-summaryConsolidated fingerprint functions:
getFingerprint()function now accepts optionalformatparameter ("markdown" or "text")format="markdown": Returns HTML comment\n\n<!-- fingerprint: {value} -->format="text"or undefined: Returns raw fingerprint valuegenerate_fingerprint_comment.cjsmodule (functionality merged intoget_fingerprint.cjs)getFingerprint("markdown")Previous refactoring:
get_fingerprint.cjsas a reusable shared module for fingerprint retrieval and loggingcore.infologging to output fingerprint value when presentImplementation Status: COMPLETE ✅
All requirements have been fully implemented and tested:
Core Implementation
fingerprintfield to JSON schema with validation (min 8 chars, alphanumeric + hyphens/underscores)GH_AW_FINGERPRINTto all safe-output jobscore.infowhen present for observabilityCode Quality
Testing
Files Modified
Core implementation:
pkg/workflow/js/get_fingerprint.cjs(simplified to 16 lines total, 7-line function)pkg/workflow/js/get_fingerprint.test.cjs(9 test cases)getFingerprint("markdown")create_pull_request.test.cjsupdated to mock unified functionpkg/workflow/js.goupdated to include unified moduleProduction workflows with fingerprints:
audit-workflows.md- Daily audit workflowblog-auditor.md- Weekly blog auditci-doctor.md- CI failure analysisdaily-news.md- Weekday news summarydaily-repo-chronicle.md- Daily repository chronicleweekly-issue-summary.md- Weekly issue summaryExample workflow:
.github/workflows/tests/example-fingerprint.md(moved from root).github/workflows/tests/example-fingerprint.lock.yml(moved from root)Recompiled workflows:
API
Simplified Unified Function:
Implementation (7 lines):
Production Usage Examples
Daily Audit Workflow:
Search GitHub for
"fingerprint: audit-workflows-daily"to find all daily audit discussions created by this workflow.Logging Example
When a workflow with fingerprint is executed, the logs will show:
This makes it easy to:
Quality Assurance
Ready for Merge ✅
All requirements met, fully tested, maximally simplified, production workflows updated with real usage examples, and ready for review.
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.