feat: add shared/apm.md shared workflow with Microsoft APM support#23509
feat: add shared/apm.md shared workflow with Microsoft APM support#23509
Conversation
- Create shared/apm.md with import-schema (packages required, github-token
and isolated optional) and apm-packages top-level field using import
input substitution
- Add apm-packages to valid fields in include_processor.go so shared
workflows can declare it without triggering warnings
- Add MergedAPMPackages []string to ImportsResult in import_processor.go
- Extract apm-packages field from imported workflows in
import_field_extractor.go and propagate through ImportsResult
- Add mergeImportedAPMPackages() in apm_import_merge.go that parses
JSON-serialized configs, deduplicates packages, applies first-wins
auth strategy, and strips unresolved ${{ github.aw.import-inputs.* }}
placeholder expressions left by omitted optional parameters
- Merge imported APM packages into main workflow APM dependencies in
compiler_orchestrator_tools.go
- Add unit tests in apm_import_merge_test.go covering array/object configs,
deduplication, first-wins auth, expression stripping, and error cases
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/9e515a93-259c-41ab-9cc1-924a99c37800
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…ort_field_extractor.go
- Improve isUnsubstitutedImportExpression comment to explain why two
separate Contains checks are used (whitespace variants like '${{ github...')
- Add debug logging for apm-packages extraction failures in import_field_extractor.go
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/9e515a93-259c-41ab-9cc1-924a99c37800
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot migrate any use of imports.apm-packages to use the new shared/apm.md file |
…apm.md Replace the deprecated top-level `dependencies:` field with an import of the new `shared/apm.md` shared workflow, passing the package list via the `with.packages` input parameter. Agent-Logs-Url: https://github.com/github/gh-aw/sessions/c186006b-eafa-4d1c-9595-c35a41dcb1ae Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done in 30c3fbf. imports:
- uses: shared/apm.md
with:
packages:
- microsoft/apm-sample-packageThe recompiled lock file confirms the dedicated 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 do not add any special support in .go, it should be exclusively in the share agentic workflow. |
…ield via generic import mechanism - Delete apm_import_merge.go (complex dedicated APM merging logic removed) - Delete apm_import_merge_test.go - Replace apm-packages: extraction with dependencies: in import_field_extractor.go, following the exact same pattern as runtimes:/network:/etc. - Replace MergedAPMPackages []string with MergedDependencies string in import_processor.go - Update include_processor.go: dependencies is a valid shared workflow field (replaces apm-packages) - Simplify compiler_orchestrator_tools.go: inline merge using extractAPMDependenciesFromValue, no dedicated file needed - Update shared/apm.md: use dependencies: field (not apm-packages:), simplify import-schema to packages only (required), update docs for auth options Agent-Logs-Url: https://github.com/github/gh-aw/sessions/ddbd3afc-6b18-421d-a296-235f9fcf772d Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done in 5443c7f. Removed The 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:
|
|
Hey One thing to address before this is ready for merge:
If you'd like a hand, you can assign this prompt to your coding agent:
|
|
@copilot you cannot use dependencies, apm-packages. must self contained. |
…s: only Remove all special Go code added for apm-packages/dependencies import support. Revert pkg/parser/import_field_extractor.go, import_processor.go, include_processor.go and pkg/workflow/compiler_orchestrator_tools.go back to original state. Rewrite shared/apm.md to use the existing steps: mechanism exclusively: - Step 1 (run): converts JSON packages array to YAML format via jq - Step 2 (uses: microsoft/apm-action@v1.4.1): packs packages inline in agent job - Step 3 (run): stages the bundle to RUNNER_TEMP - Step 4 (uses: actions/github-script@v8): unpacks via apm_unpack.cjs No new Go code. No special compiler hooks. Packages install as pre-steps in the agent job before the AI model runs. Action refs are auto-pinned by the compiler's existing ApplyActionPinsToTypedSteps mechanism. Agent-Logs-Url: https://github.com/github/gh-aw/sessions/c9b67c7c-1741-41e3-a314-6a6ad960a13c Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done in 60e1649.
The workflow injects 4 inline pre-steps into the agent job:
Action refs are auto-pinned by the compiler's existing 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:
|
|
Implemented in commits Separate APM job strategy in
The agent job automatically gets Removed
|
There was a problem hiding this comment.
🤖 Smoke test automated review — all checks nominal. The codemod removal and test count update look correct.
📰 BREAKING: Report filed by Smoke Copilot
|
|
||
| // Verify we have the expected number of codemods | ||
| expectedCount := 29 | ||
| expectedCount := 28 |
There was a problem hiding this comment.
🤖 Smoke test review: expectedCount correctly updated from 29 → 28 after removing the dependencies-to-imports-apm-packages codemod. ✅
| @@ -50,7 +50,6 @@ func GetAllCodemods() []Codemod { | |||
| getSafeInputsToMCPScriptsCodemod(), // Rename safe-inputs to mcp-scripts | |||
| getPluginsToDependenciesCodemod(), // Migrate plugins to dependencies (plugins removed in favour of APM) | |||
There was a problem hiding this comment.
🤖 Smoke test review: Removal of getDependenciesToImportsAPMPackagesCodemod() looks clean. The migration path is now handled by shared/apm.md imports instead. ✅
There was a problem hiding this comment.
👋 Smoke test agent reply #23772198483 confirming reply functionality works! ✅
📰 BREAKING: Report filed by Smoke Copilot
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
…ck' input, find exact bundle path Agent-Logs-Url: https://github.com/github/gh-aw/sessions/fb52c6ca-6d5c-4cbe-bf90-ba2c1458636a Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Fixed in Two issues found in the CI logs:
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:
|
|
📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing... |
|
🔮 The ancient spirits stir... Smoke Codex awakens to divine this pull request... |
|
✅ All tools validated successfully! Agent Container Smoke Test confirms agent container is ready. |
|
🎬 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 #23772198483 — PR Results
Overall: PASS (11/12) —
|
There was a problem hiding this comment.
Smoke test review pass on PR #23509. Changes look clean — jobs: extraction generalized properly, codemod count updated correctly, and the shared APM workflow pattern is well-structured.
📰 BREAKING: Report filed by Smoke Copilot
|
|
||
| // Verify we have the expected number of codemods | ||
| expectedCount := 29 | ||
| expectedCount := 28 |
There was a problem hiding this comment.
👍 Count correctly updated from 29 → 28 to reflect the removal of dependencies-to-imports-apm-packages codemod. This keeps the test accurate without requiring a full enumeration of all codemods.
| jobsContent, err := extractFieldJSONFromMap(fm, "jobs", "{}") | ||
| if err == nil && jobsContent != "" && jobsContent != "{}" { | ||
| acc.jobsBuilder.WriteString(jobsContent + "\n") | ||
| } |
There was a problem hiding this comment.
The jobs: extraction from shared .md imports is a clean generalization of the existing steps: pattern. Consider adding a comment documenting which frontmatter keys are intentionally supported here so future contributors know what to add when new top-level fields need importing.
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
Warning The Smoke Test Results — Run §23772198471 Core (#1–11): ✅✅✅✅✅✅✅✅✅✅✅ Status: PARTIAL (15 passed, 2 skipped — threads/close-PR)
|
There was a problem hiding this comment.
💥 Automated smoke test review - all systems nominal!
💥 [THE END] — Illustrated by Smoke Claude
|
@copilot update smoke-Claude to allow protected files See https://github.com/github/gh-aw/actions/runs/23772198471/job/69267092570#step:8:1 |
…branch Agent-Logs-Url: https://github.com/github/gh-aw/sessions/606e9faf-b54d-403c-accb-80f66fbe9f44 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Fixed in 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 delete this integration test https://github.com/github/gh-aw/actions/runs/23773239934/job/69271826158#step:10:1 |
…ted) Agent-Logs-Url: https://github.com/github/gh-aw/sessions/a8644556-b631-422a-a951-8c73a0ad3fb7 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done in |
Summary
Creates a shared agentic workflow (
shared/apm.md) that packages Microsoft APM (Agent Package Manager) functionality as a reusable import. The workflow implements the separate APM job strategy — a dedicatedapm:job packs and uploads the bundle, while unpack pre-steps are injected into the agent job. Alldependencies:andimports.apm-packages:compiler support has been removed in favour of this shared workflow.How it works
Users can install APM packages by importing the shared workflow:
The compiler then:
apm:job (needs: [activation]) that prepares the package list (serialized as JSON viatoJson), packs them withmicrosoft/apm-action, and uploads the bundle as a workflow artifact.microsoft/apm-actionin unpack mode) so the agent job automatically depends onapm.Action refs are automatically pinned to SHA hashes by the compiler's existing
ApplyActionPinsToTypedSteps/buildCustomJobsmechanism.Changes
Updated file:
.github/workflows/shared/apm.mdimport-schemawithpackages(required array)jobs:section defining the dedicatedapm:job (needs: activation,runs-on: ubuntu-slim,permissions: {}) with prepare, pack, and upload artifact stepsAW_APM_PACKAGESenv usestoJson(github.aw.import-inputs.packages)to ensure the packages array is a valid JSON string at runtimeretention-daysset as'1'(string) to prevent float rendering in compiled YAMLsteps:section with unpack pre-steps (download artifact +microsoft/apm-actioninunpack: 'true'mode)Parser changes
pkg/parser/import_field_extractor.go: Addedjobs:field extraction from shared.mdworkflow frontmatter (generic, non-APM-specific — same pattern assteps:,runtimes:, etc.)pkg/parser/include_processor.go: Added"jobs"to the valid shared-workflow fields listpkg/parser/import_field_extractor_test.go: AddedTestJobsFieldExtractedFromMdImportunit test verifyingjobs:in a shared.mdimport is captured intoImportsResult.MergedJobsCompiler changes
compiler_orchestrator_tools.gowhen the now-removeddependencies:orimports.apm-packages:fields are present, directing users toshared/apm.mdCompiler and JS runtime removal
compiler_apm_job.goandapm_dependencies.go(dedicated APM pack/restore step generators)APMDependenciesInfotype,APMDependenciesfield fromWorkflowData, and APM constants (APMJobName,APMArtifactName,DefaultAPMVersion,DefaultAPMActionVersion)extractAPMDependenciesFromFrontmatter, APM job build call, APM download/restore steps from the agent job, and APM experimental-feature warning from the compilerapm_version/GH_AW_INFO_APM_VERSIONhandling fromgenerate_aw_info.cjsapm_unpack.cjs,apm_unpack.test.cjs,run_apm_unpack.cjs— the restore step now usesmicrosoft/apm-actiondirectlycodemod_dependencies.go(thedependencies → imports.apm-packagesmigration codemod is no longer needed); codemod registry count updated from 29 to 28Migration
.github/workflows/smoke-claude.md: Migrated from the deprecated top-leveldependencies:field to the newshared/apm.mdimport pattern💡 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.
✨ PR Review Safe Output Test - Run 23772198471