Skip to content

Fix failing "Integration: Workflow Misc Part 2" tests#31860

Merged
pelikhan merged 3 commits into
mainfrom
copilot/fix-workflow-misc-part-2
May 13, 2026
Merged

Fix failing "Integration: Workflow Misc Part 2" tests#31860
pelikhan merged 3 commits into
mainfrom
copilot/fix-workflow-misc-part-2

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 13, 2026

Bug Fix

Two categories of test failures in pkg/workflow/ caused by production code changes that weren't reflected in tests.

What was the bug?

1. Invalid top-level command: in test frontmatterlocal_action_permissions_test.go used command: /fix at the top level of workflow YAML frontmatter. Schema validation now correctly rejects unknown top-level fields (command belongs under on:). Since the field was never actually parsed from the top level, it was always a no-op — the pre_activation job was already created by the issues: {types: [opened]} unsafe event trigger.

2. Stale template expression assertions — Three tests in template_expression_integration_test.go expected env-var placeholder conditions like {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }}. Per ADR-31820, github_context_prompt.md was updated to use compound fallback expressions with bare (non-${{ }}-wrapped) conditions, so ExtractExpressions no longer replaces them with placeholders.

How did you fix it?

  • local_action_permissions_test.go: Removed the invalid top-level command: /fix from two test frontmatter strings.

  • template_expression_integration_test.go: Updated assertions in three tests to match the compound expression format now emitted:

- if !strings.Contains(compiledStr, "{{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }}") {
+ if !strings.Contains(compiledStr, "{{#if github.event.issue.number ||") {

Testing

All 5 previously failing tests pass. Full pkg/workflow integration test suite passes with no regressions.

Copilot AI and others added 2 commits May 13, 2026 05:18
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] Fix failing GitHub Actions job Integration: Workflow Misc Part 2 Fix failing "Integration: Workflow Misc Part 2" tests May 13, 2026
Copilot AI requested a review from pelikhan May 13, 2026 05:21
@pelikhan pelikhan marked this pull request as ready for review May 13, 2026 05:24
Copilot AI review requested due to automatic review settings May 13, 2026 05:24
@pelikhan pelikhan merged commit 339e25e into main May 13, 2026
2 checks passed
@pelikhan pelikhan deleted the copilot/fix-workflow-misc-part-2 branch May 13, 2026 05:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes failing pkg/workflow integration tests by updating test fixtures/assertions to reflect recent schema validation and GitHub-context template changes.

Changes:

  • Removed invalid top-level command: from workflow frontmatter fixtures in local_action_permissions_test.go.
  • Updated integration-test assertions to expect compound fallback conditionals in the built-in GitHub context prompt (ADR-31820 behavior).
  • Minor formatting change in .github/workflows/agentic_commands.yml (blank line).
Show a summary per file
File Description
pkg/workflow/template_expression_integration_test.go Updates assertions to match new GitHub context conditional format (compound fallback expressions) and adjusts related test commentary.
pkg/workflow/local_action_permissions_test.go Removes invalid top-level command: from frontmatter test data to satisfy stricter schema validation.
.github/workflows/agentic_commands.yml Adds a blank line between permissions and steps (formatting only).

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Comment on lines 179 to 181
// After compilation, GitHub expressions are extracted and replaced with placeholders
// for security. The original ${{ ... }} expressions are not preserved in the compiled output.
// Instead, we verify that:
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.

3 participants