Add history link to generated footers for issues, PRs, and discussions#19321
Add history link to generated footers for issues, PRs, and discussions#19321
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot remove clock emoji |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
🎬 THE END — Smoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨ |
|
📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing... |
|
🌑 The shadows whisper... Smoke Codex failed. The oracle requires further meditation... |
This comment has been minimized.
This comment has been minimized.
|
Commit pushed:
|
|
Smoke test §22608083737 —
Overall:
|
There was a problem hiding this comment.
This PR adds history links to generated footers for issues, PRs, and discussions — a useful feature for traceability. The implementation is clean and well-tested. Two minor inline suggestions left above.
📰 BREAKING: Report filed by Smoke Copilot
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
@copilot messages templates in agentic workflows to include history url . Using emojis for the history url text is encouraged. |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
💥 Automated smoke test review - all systems nominal!
💥 [THE END] — Illustrated by Smoke Claude
…rkflows Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done in 1299ac7. Added a Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot set default text of history link to "◷" |
|
🌑 The shadows whisper... Smoke Codex failed. The oracle requires further meditation... |
|
📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing... |
|
🎬 THE END — Smoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨ |
Agent Container Tool Check
Result: 12/12 tools available ✅ Overall Status: PASS
|
Smoke Test Results — §22608693288
Overall:
|
There was a problem hiding this comment.
Changes look good — adds {history_link} support to workflow-generated footers so readers can navigate to related items. One minor consistency nit on the default footer path (left inline).
📰 BREAKING: Report filed by Smoke Copilot
actions/setup/js/messages_footer.cjs
Outdated
| // Create context with both camelCase and snake_case keys | ||
| const templateContext = toSnakeCase(ctx); | ||
| // Pre-compute history_link as a ready-to-use markdown suffix (empty string when unavailable) | ||
| const historyLink = ctx.historyUrl ? ` · [🕐 history](${ctx.historyUrl})` : ""; |
There was a problem hiding this comment.
Nice approach pre-computing historyLink as an empty string fallback — this ensures {history_link} in custom footer templates is always safely resolved rather than left as a literal placeholder.
actions/setup/js/messages_footer.cjs
Outdated
| } | ||
| // Append history link when available | ||
| if (ctx.historyUrl) { | ||
| defaultFooter += " · [history]({history_url})"; |
There was a problem hiding this comment.
Minor nit: the default footer appends [history]({history_url}) using history_url as a template variable, while custom footers use {history_link} (the pre-formatted markdown). It might be worth using {history_link} here too for consistency — that way both paths render identically and historyUrl doesn't need to be exposed as a raw template variable.
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done in 02e37f0. History links now render as Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Smoke Test Results - Run §22608693292Core Tests #1–10: ✅✅❌✅✅✅✅✅✅✅
Overall: PARTIAL — Serena
|
There was a problem hiding this comment.
💥 Automated smoke test review - all systems nominal!
💥 [THE END] — Illustrated by Smoke Claude
There was a problem hiding this comment.
Pull request overview
Adds a “history” link to workflow-generated footers so readers can jump to a GitHub search page listing other items created by the same workflow identity (including enterprise serverUrl support).
Changes:
- Introduces a dedicated history URL/link generator (
generate_history_link.cjs) with item-type-specific search qualifiers. - Threads optional
historyUrlthrough the messages footer system, adding{history_link}/{history_url}template support and default footer rendering. - Updates many workflow templates to append
{history_link}to custom footers, and adds targeted tests.
Reviewed changes
Copilot reviewed 76 out of 76 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| actions/setup/js/messages_footer.cjs | Adds historyUrl plumbing and {history_link} support in footer rendering. |
| actions/setup/js/messages.test.cjs | Adds tests covering history link rendering and placeholders in footers. |
| actions/setup/js/generate_history_link.cjs | New module to generate search URLs (and a markdown link helper). |
| actions/setup/js/generate_history_link.test.cjs | New tests validating history URL generation across item types and server URLs. |
| actions/setup/js/create_issue.cjs | Generates and passes a history URL (preferring workflow call ID) into footer generation. |
| actions/setup/js/create_pull_request.cjs | Generates and passes a history URL into footer generation for PRs. |
| actions/setup/js/create_discussion.cjs | Adds a history link into the discussion footer text. |
| .github/workflows/unbloat-docs.md | Appends {history_link} to custom footer template. |
| .github/workflows/unbloat-docs.lock.yml | Regenerates locked workflow with {history_link} in messages footer. |
| .github/workflows/technical-doc-writer.md | Appends {history_link} to custom footer template. |
| .github/workflows/technical-doc-writer.lock.yml | Regenerates locked workflow with {history_link} in messages footer. |
| .github/workflows/stale-repo-identifier.md | Appends {history_link} to custom footer template. |
| .github/workflows/stale-repo-identifier.lock.yml | Regenerates locked workflow with {history_link} in messages footer. |
| .github/workflows/smoke-workflow-call.md | Appends {history_link} to custom footer template. |
| .github/workflows/smoke-workflow-call.lock.yml | Regenerates locked workflow with {history_link} in messages footer. |
| .github/workflows/smoke-update-cross-repo-pr.md | Appends {history_link} to custom footer template. |
| .github/workflows/smoke-update-cross-repo-pr.lock.yml | Regenerates locked workflow with {history_link} in messages footer. |
| .github/workflows/smoke-test-tools.md | Appends {history_link} to custom footer template. |
| .github/workflows/smoke-test-tools.lock.yml | Regenerates locked workflow with {history_link} in messages footer. |
| .github/workflows/smoke-temporary-id.md | Appends {history_link} to custom footer template. |
| .github/workflows/smoke-temporary-id.lock.yml | Regenerates locked workflow with {history_link} in messages footer. |
| .github/workflows/smoke-project.md | Appends {history_link} to custom footer template. |
| .github/workflows/smoke-project.lock.yml | Regenerates locked workflow with {history_link} in messages footer. |
| .github/workflows/smoke-multi-pr.md | Appends {history_link} to custom footer template. |
| .github/workflows/smoke-multi-pr.lock.yml | Regenerates locked workflow with {history_link} in messages footer. |
| .github/workflows/smoke-gemini.md | Appends {history_link} to custom footer template. |
| .github/workflows/smoke-gemini.lock.yml | Regenerates locked workflow with {history_link} in messages footer. |
| .github/workflows/smoke-create-cross-repo-pr.md | Appends {history_link} to custom footer template. |
| .github/workflows/smoke-create-cross-repo-pr.lock.yml | Regenerates locked workflow with {history_link} in messages footer. |
| .github/workflows/smoke-copilot.md | Appends {history_link} to custom footer template. |
| .github/workflows/smoke-copilot.lock.yml | Regenerates locked workflow with {history_link} in messages footer. |
| .github/workflows/smoke-copilot-arm.md | Appends {history_link} to custom footer template. |
| .github/workflows/smoke-copilot-arm.lock.yml | Regenerates locked workflow with {history_link} in messages footer. |
| .github/workflows/smoke-codex.md | Appends {history_link} to custom footer template. |
| .github/workflows/smoke-codex.lock.yml | Regenerates locked workflow with {history_link} in messages footer. |
| .github/workflows/smoke-claude.md | Appends {history_link} to custom footer template. |
| .github/workflows/smoke-claude.lock.yml | Regenerates locked workflow with {history_link} in messages footer. |
| .github/workflows/smoke-agent.md | Appends {history_link} to custom footer template. |
| .github/workflows/smoke-agent.lock.yml | Regenerates locked workflow with {history_link} in messages footer. |
| .github/workflows/security-review.md | Appends {history_link} to custom footer template. |
| .github/workflows/security-review.lock.yml | Regenerates locked workflow with {history_link} in messages footer. |
| .github/workflows/scout.md | Appends {history_link} to custom footer template. |
| .github/workflows/scout.lock.yml | Regenerates locked workflow with {history_link} in messages footer. |
| .github/workflows/q.md | Appends {history_link} to custom footer template. |
| .github/workflows/q.lock.yml | Regenerates locked workflow with {history_link} in messages footer. |
| .github/workflows/pr-nitpick-reviewer.md | Appends {history_link} to custom footer template. |
| .github/workflows/pr-nitpick-reviewer.lock.yml | Regenerates locked workflow with {history_link} in messages footer. |
| .github/workflows/poem-bot.md | Appends {history_link} to custom footer template. |
| .github/workflows/poem-bot.lock.yml | Regenerates locked workflow with {history_link} in messages footer. |
| .github/workflows/pdf-summary.md | Appends {history_link} to custom footer template. |
| .github/workflows/pdf-summary.lock.yml | Regenerates locked workflow with {history_link} in messages footer. |
| .github/workflows/issue-monster.md | Appends {history_link} to custom footer template. |
| .github/workflows/issue-monster.lock.yml | Regenerates locked workflow with {history_link} in messages footer. |
| .github/workflows/grumpy-reviewer.md | Appends {history_link} to custom footer template. |
| .github/workflows/grumpy-reviewer.lock.yml | Regenerates locked workflow with {history_link} in messages footer. |
| .github/workflows/discussion-task-miner.md | Appends {history_link} to custom footer template. |
| .github/workflows/discussion-task-miner.lock.yml | Regenerates locked workflow with {history_link} in messages footer. |
| .github/workflows/dev-hawk.md | Appends {history_link} to custom footer template. |
| .github/workflows/dev-hawk.lock.yml | Regenerates locked workflow with {history_link} in messages footer. |
| .github/workflows/delight.md | Appends {history_link} to custom footer template. |
| .github/workflows/delight.lock.yml | Regenerates locked workflow with {history_link} in messages footer. |
| .github/workflows/daily-fact.md | Appends {history_link} to custom footer template. |
| .github/workflows/daily-fact.lock.yml | Regenerates locked workflow with {history_link} in messages footer. |
| .github/workflows/craft.md | Appends {history_link} to custom footer template. |
| .github/workflows/craft.lock.yml | Regenerates locked workflow with {history_link} in messages footer. |
| .github/workflows/cloclo.md | Appends {history_link} to custom footer template. |
| .github/workflows/cloclo.lock.yml | Regenerates locked workflow with {history_link} in messages footer. |
| .github/workflows/ci-doctor.md | Appends {history_link} to custom footer template. |
| .github/workflows/ci-doctor.lock.yml | Regenerates locked workflow with {history_link} in messages footer. |
| .github/workflows/breaking-change-checker.md | Appends {history_link} to custom footer template. |
| .github/workflows/breaking-change-checker.lock.yml | Regenerates locked workflow with {history_link} in messages footer. |
| .github/workflows/brave.md | Appends {history_link} to custom footer template. |
| .github/workflows/brave.lock.yml | Regenerates locked workflow with {history_link} in messages footer. |
| .github/workflows/archie.md | Appends {history_link} to custom footer template. |
| .github/workflows/archie.lock.yml | Regenerates locked workflow with {history_link} in messages footer. |
| .changeset/patch-history-link-footer.md | Adds a patch changeset documenting the new footer history links. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| function generateHistoryLink(params) { | ||
| const url = generateHistoryUrl(params); | ||
| if (!url) { | ||
| return null; | ||
| } | ||
| return `[history](${url})`; | ||
| } |
There was a problem hiding this comment.
generateHistoryLink() hard-codes the link label as history, but the rest of the footer system (and the PR description/examples) uses the clock symbol (◷). This will produce inconsistent UI (e.g., discussions show [history](...) while issues/PRs show [◷](...)). Consider either (a) making generateHistoryLink() return [◷](url) to match, or (b) removing generateHistoryLink() and having callers format · [◷](...) consistently from generateHistoryUrl().
| const historyLink = generateHistoryLink({ | ||
| owner: repoParts.owner, | ||
| repo: repoParts.repo, | ||
| itemType: "discussion", | ||
| workflowCallId: callerWorkflowId, | ||
| workflowId, | ||
| serverUrl: context.serverUrl, | ||
| }); | ||
| const footerText = historyLink ? `> AI generated by [${workflowName}](${runUrl}) · ${historyLink}` : `> AI generated by [${workflowName}](${runUrl})`; | ||
| const footer = generateFooterWithExpiration({ |
There was a problem hiding this comment.
The discussion footer appends generateHistoryLink() directly, which currently yields a [history](...) link label. That makes discussion footers inconsistent with the ◷ history link used by issues/PRs and described in the PR metadata. Suggest generating a history URL and formatting it as · [◷](url) here (or updating generateHistoryLink() to use ◷ so this footer matches the others).
| const historyUrl = generateHistoryUrl({ | ||
| owner: repoParts.owner, | ||
| repo: repoParts.repo, | ||
| itemType: "pull_request", | ||
| workflowId, | ||
| serverUrl: context.serverUrl, | ||
| }); |
There was a problem hiding this comment.
generateHistoryUrl() is called with workflowId only. Per the PR description, history links should prefer the more specific caller workflow identity when available (e.g., GH_AW_CALLER_WORKFLOW_ID / gh-aw-workflow-call-id). If PR bodies don’t include a gh-aw-workflow-call-id marker today, passing workflowCallId won’t match anything—so this likely needs both: embed the call-id marker in the PR body and pass workflowCallId here so history links can disambiguate callers of reusable workflows.
| // Pre-compute history_link as a ready-to-use markdown suffix (empty string when unavailable) | ||
| const historyLink = ctx.historyUrl ? ` · [◷](${ctx.historyUrl})` : ""; | ||
|
|
||
| // Create context with both camelCase and snake_case keys, including computed history_link | ||
| const templateContext = toSnakeCase({ ...ctx, historyLink }); | ||
|
|
There was a problem hiding this comment.
Custom templates can use {history_url}, but when ctx.historyUrl is not provided the placeholder won’t be replaced (the current renderTemplate keeps placeholders for undefined values). Since this PR introduces {history_url} as a supported placeholder, it would be better to ensure it resolves to an empty string when unavailable (similar to {history_link}), so users don’t end up with literal {history_url} in rendered footers.
Footers on workflow-generated items lacked a way to quickly navigate to all items created by the same workflow. This adds a history link that opens a pre-filtered GitHub search page matching the item type and workflow identity.
New module:
generate_history_link.cjsEncapsulates all history URL generation logic:
gh-aw-workflow-call-idovergh-aw-workflow-id(more specific for reusable workflows)is:issue/is:prqualifier +type=param; discussions usetype=discussionsonly — nois:qualifier)serverUrlparam orGITHUB_SERVER_URLenv varExample output for an issue footer (default template):
Example output using a custom footer template with emoji (e.g.
archie):Footer integration
messages_footer.cjs:FooterContextgains optionalhistoryUrl; default footer template appends· [◷](url)when set. Custommessages.footertemplates can use{history_link}(pre-formatted as· [◷](url), or""when unavailable) or{history_url}(raw URL) as placeholders.generateFooterWithMessages: optional 8th parameterhistoryUrlthreads through to context.create_issue.cjs,create_pull_request.cjs,create_discussion.cjs: each generates the history URL/link using the appropriate item type and passes it to footer generation.GH_AW_CALLER_WORKFLOW_IDis preferred where available.Workflow template updates
All 34 agentic workflow
.mdfiles with custommessages.footertemplates have been updated to include the{history_link}placeholder, appending the◷history link when a history URL is available and rendering nothing when it is not.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.
Changeset
Warning
The following domain was blocked by the firewall during workflow execution:
github.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.
✨ PR Review Safe Output Test - Run 22608083755
✨ PR Review Safe Output Test - Run 22608693292