Skip to content

fix(shared/apm.md): drop || 'all' fallback so gh-aw substitutes target (#1185)#1186

Merged
danielmeppiel merged 1 commit into
mainfrom
fix/shared-apm-target-substitution
May 7, 2026
Merged

fix(shared/apm.md): drop || 'all' fallback so gh-aw substitutes target (#1185)#1186
danielmeppiel merged 1 commit into
mainfrom
fix/shared-apm-target-substitution

Conversation

@danielmeppiel

Copy link
Copy Markdown
Collaborator

Closes #1185.

Problem

#1184 introduced a defensive || 'all' fallback on the target import:

target: ${{ github.aw.import-inputs.target || 'all' }}

That broke gh-aw's substitution. The importInputsExprRegex in pkg/parser/import_field_extractor.go only matches bare ${{ github.aw.import-inputs.X }}. Anything inside the brackets (like || 'all') makes the regex skip substitution entirely, so the unresolved expression was emitted verbatim into the consuming lock workflow. At runtime with.target was empty, which apm-action then interpreted as all -- silently ignoring whatever the consumer passed via with: target: copilot.

Fix

Drop the fallback. The schema default default: all declared on the target input is already applied by gh-aw's applyImportSchemaDefaultsFromFrontmatter before substitution, so omitted-input behaviour is preserved without the belt-and-suspenders.

target: ${{ github.aw.import-inputs.target }}

Validation

Recompiled with gh aw compile pinned to v0.71.5 (matching the compiler_version stamped in current lock metadata). Diff is exactly 3 files / 3 lines:

  • shared/apm.md -- 1 line, drops the fallback
  • pr-review-panel.lock.yml -- gh-aw substituted the schema default in place; line now reads literal target: all
  • triage-panel.lock.yml -- same

Consumers who pass with: target: copilot will now get target: copilot substituted into their lock workflow.

Follow-up (not in this PR)

It would be nice for gh-aw upstream to make importInputsExprRegex tolerant of GHA-idiom || fallbacks, since this is a footgun. Worth filing in githubnext/gh-aw.

#1185)

The bare-expression regex in gh-aw's importInputsExprRegex
(pkg/parser/import_field_extractor.go) only matches
`${{ github.aw.import-inputs.X }}`. The `|| 'all'` belt-and-suspenders
introduced in #1184 made the regex skip substitution entirely, so
consumer-supplied `with: target: copilot` was silently ignored: the
unresolved expression survived into the lock workflow and the runtime
env was empty (which apm-action then treated as `all`).

The schema default `default: all` declared in import-schema is already
applied by gh-aw's applyImportSchemaDefaultsFromFrontmatter BEFORE
substitution, so the fallback was redundant. Dropping it lets gh-aw
substitute literal values into consuming lock workflows.

Recompiled with gh-aw v0.71.5 (matching the version stamped in lock
metadata). The two consuming lock workflows now carry the literal
substituted value `target: all` since neither import sets `target:`.
Consumers who pass `with: target: copilot` will get `target: copilot`.

Closes #1185.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 7, 2026 12:34
@danielmeppiel danielmeppiel merged commit 9d4e2ba into main May 7, 2026
18 checks passed
@danielmeppiel danielmeppiel deleted the fix/shared-apm-target-substitution branch May 7, 2026 12:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes gh-aw import-input substitution for the shared APM workflow by removing a non-bare expression fallback that prevented compile-time replacement of target, ensuring consumer-provided with: target: ... values flow through correctly.

Changes:

  • Remove the || 'all' fallback from target: ${{ github.aw.import-inputs.target ... }} in shared/apm.md so gh-aw can substitute the value.
  • Regenerate lock workflows so the default schema value compiles to a literal target: all.
  • Add a changelog entry describing the fix.
Show a summary per file
File Description
CHANGELOG.md Adds an Unreleased “Fixed” entry for the gh-aw substitution compatibility fix.
.github/workflows/shared/apm.md Updates the apm-action invocation to use a bare github.aw.import-inputs.target expression for gh-aw substitution.
.github/workflows/pr-review-panel.lock.yml Regenerated compiled workflow now contains literal target: all (schema default applied).
.github/workflows/triage-panel.lock.yml Regenerated compiled workflow now contains literal target: all (schema default applied).

Copilot's findings

  • Files reviewed: 4/4 changed files
  • Comments generated: 1

Comment thread CHANGELOG.md

### Fixed

- `shared/apm.md` no longer wraps the `target` input in a `|| 'all'` fallback. The defensive expression broke gh-aw's bare-expression substitution regex, causing consumer-supplied `target:` values to be silently dropped; the `import-schema` default already covers the omitted-input case. (#1185)
danielmeppiel added a commit to DevExpGbb/zava-storefront that referenced this pull request May 7, 2026
…+ triage) (#3)

Brings DevExpGbb/zava-storefront to current shipping state:
- v5.0.1 marketplace pins (5 kits)
- PR Review Panel gh-aw workflow (review-kit panel skill)
- Triage Panel gh-aw workflow
- shared/apm.md from microsoft/apm@main (post #1186 fix)
- .github/aw/actions-lock.json

All apm.yml + workflow .md/.lock.yml refs rewritten from
hackathon-white-pig-8 → DevExpGbb (canonical home).

Source: hackathon-white-pig-8/zava-storefront@main HEAD (PR #6 merged
green E2E with apm-action v1.7.2 + microsoft/apm#1186 + gh-aw v0.72.0).

Co-authored-by: Daniel Meppiel <dmeppiel@github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
sergio-sisternes-epam pushed a commit that referenced this pull request May 19, 2026
#1185) (#1186)

The bare-expression regex in gh-aw's importInputsExprRegex
(pkg/parser/import_field_extractor.go) only matches
`${{ github.aw.import-inputs.X }}`. The `|| 'all'` belt-and-suspenders
introduced in #1184 made the regex skip substitution entirely, so
consumer-supplied `with: target: copilot` was silently ignored: the
unresolved expression survived into the lock workflow and the runtime
env was empty (which apm-action then treated as `all`).

The schema default `default: all` declared in import-schema is already
applied by gh-aw's applyImportSchemaDefaultsFromFrontmatter BEFORE
substitution, so the fallback was redundant. Dropping it lets gh-aw
substitute literal values into consuming lock workflows.

Recompiled with gh-aw v0.71.5 (matching the version stamped in lock
metadata). The two consuming lock workflows now carry the literal
substituted value `target: all` since neither import sets `target:`.
Consumers who pass `with: target: copilot` will get `target: copilot`.

Closes #1185.

Co-authored-by: Daniel Meppiel <copilot-rework@github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

shared/apm.md: drop || 'all' fallback on target (gh-aw substitution incompatible with GHA-idiom fallbacks)

2 participants