Skip to content

Move noop processing step from separate job into conclusion job#4318

Merged
pelikhan merged 8 commits into
mainfrom
copilot/update-noop-javascript-step
Nov 19, 2025
Merged

Move noop processing step from separate job into conclusion job#4318
pelikhan merged 8 commits into
mainfrom
copilot/update-noop-javascript-step

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Nov 19, 2025

Move noop processing step from separate job into conclusion job

Consolidates workflow structure by generating the noop JavaScript step inside the conclusion job instead of as a separate job.

Changes

  • pkg/workflow/notify_comment.go: Added noop step generation to buildConclusionJob(), including environment variables, script invocation, and noop_message output. Artifact download steps are now added once at the beginning and shared by both noop and conclusion steps.
  • pkg/workflow/compiler_jobs.go: Removed noop job creation code; noop no longer added to safeOutputJobNames
  • pkg/workflow/noop.go: Removed unused buildCreateOutputNoOpJob() function
  • pkg/workflow/safe_outputs.go: Added buildGitHubScriptStepWithoutDownload() helper function for building script steps without duplicate artifact downloads
  • pkg/workflow/noop_in_conclusion_test.go: Added test validating noop step appears in conclusion job with correct outputs and dependencies

Structure Change

Before:

jobs:
  agent: ...
  noop:
    needs: [agent]
    steps:
      - name: Download artifact
      - name: Process No-Op Messages
  conclusion:
    needs: [agent, noop]
    steps:
      - name: Download artifact
      - name: Update reaction comment

After:

jobs:
  agent: ...
  conclusion:
    needs: [agent]
    steps:
      - name: Download artifact (shared)
      - name: Process No-Op Messages
      - name: Update reaction comment

The noop processing logic and JavaScript remain unchanged—only the job structure is simplified and artifact downloads are no longer duplicated.

Fix Details

Fixed duplicate artifact download issue where both the noop step and the conclusion step were independently adding artifact download steps. Now:

  • Artifact download steps are added once at the beginning of the conclusion job
  • Created buildGitHubScriptStepWithoutDownload() helper for subsequent steps
  • Both noop and conclusion steps share the same downloaded artifact
  • Reduces workflow execution time and resource usage
Original prompt

Update the compiler to generate the noop javascript step inside of the conclusion job instead of the noop job.

  • generate noop javascript step inside of conclusion job
  • remove noop job

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits November 19, 2025 06:47
- Modified notify_comment.go to add noop processing step to conclusion job
- Added noop_message output to conclusion job when noop is configured
- Removed noop job generation from compiler_jobs.go
- Verified all test workflows compile correctly with new structure
- All unit tests pass

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Created noop_in_conclusion_test.go to validate the new structure
- Test verifies no separate noop job exists
- Test verifies noop step is in conclusion job
- Test verifies conclusion job has noop_message output
- Test verifies conclusion job does not depend on noop job
- Test passes successfully

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan pelikhan marked this pull request as ready for review November 19, 2025 06:52
Copilot AI review requested due to automatic review settings November 19, 2025 06:52
- Removed buildCreateOutputNoOpJob function that is no longer used
- Removed unused fmt import
- Noop job is now generated inside conclusion job instead
- All linter checks pass
- All unit tests pass

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
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

This PR refactors the noop (no-operation) processing by consolidating it into the conclusion job, eliminating a separate noop job. This simplifies the workflow structure while maintaining all functionality.

Key changes:

  • Noop step generation moved to buildConclusionJob in notify_comment.go
  • Removed noop job generation code from compiler_jobs.go
  • Added comprehensive test coverage in noop_in_conclusion_test.go

Reviewed Changes

Copilot reviewed 74 out of 74 changed files in this pull request and generated 2 comments.

File Description
pkg/workflow/notify_comment.go Adds noop processing step to conclusion job with proper environment variables and outputs
pkg/workflow/compiler_jobs.go Removes dedicated noop job generation code
pkg/workflow/noop_in_conclusion_test.go Adds unit tests verifying noop step placement in conclusion job
.github/workflows/*.lock.yml All compiled workflows updated with noop step now in conclusion job

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

Comment on lines 4455 to +4457
find "/tmp/gh-aw/safeoutputs/" -type f -print
echo "GH_AW_AGENT_OUTPUT=/tmp/gh-aw/safeoutputs/agent_output.json" >> "$GITHUB_ENV"
- name: Process No-Op Messages
Copy link

Copilot AI Nov 19, 2025

Choose a reason for hiding this comment

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

The noop step is placed after a 'Setup agent output environment variable' step, but then followed by another identical artifact download and setup at lines 4542-4552. This creates duplicate artifact downloads and environment setup. The noop step should be moved after the second artifact download/setup block to avoid running before artifacts are properly downloaded.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@copilot fix ordering of steps

Comment on lines +4542 to +4552
- name: Download agent output artifact
continue-on-error: true
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6
with:
name: agent_output.json
path: /tmp/gh-aw/safeoutputs/
- name: Setup agent output environment variable
run: |
mkdir -p /tmp/gh-aw/safeoutputs/
find "/tmp/gh-aw/safeoutputs/" -type f -print
echo "GH_AW_AGENT_OUTPUT=/tmp/gh-aw/safeoutputs/agent_output.json" >> "$GITHUB_ENV"
Copy link

Copilot AI Nov 19, 2025

Choose a reason for hiding this comment

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

Duplicate artifact download and environment setup steps appear after the noop processing step. This redundancy suggests the noop step was inserted in the wrong location. These duplicate steps at lines 4542-4552 appear to be unnecessary since the same setup already occurred at lines 4448-4456 before the noop step.

Copilot uses AI. Check for mistakes.
@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot avoid generate two artifact download steps for the same resource

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Update compiler to generate noop javascript step in conclusion job Move noop processing step from separate job into conclusion job Nov 19, 2025
Copilot AI requested a review from pelikhan November 19, 2025 07:00
@pelikhan pelikhan added the smoke label Nov 19, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Nov 19, 2025

✅ Agentic Changeset Generator completed successfully.

- Added buildGitHubScriptStepWithoutDownload helper function
- Artifact download steps now added once at beginning of conclusion job
- Both noop and conclusion steps share the same artifact download
- Eliminates duplicate "Download agent output artifact" steps
- All workflows compile successfully with no duplicate downloads

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Nov 19, 2025

@copilot avoid generate two artifact download steps for the same resource

Fixed in d42afa8. The artifact download steps are now added once at the beginning of the conclusion job and shared by both the noop and conclusion steps. Created a new buildGitHubScriptStepWithoutDownload() helper function to avoid duplicating the artifact download in subsequent steps.

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:

  • https://api.github.com/user
    • Triggering command: gh api user --jq .login (http block)

If you need me to access, download, or install something from one of these locations, you can either:

@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot the conclusion job has duplicate steps to download and setup artifacts. Remove the later ones

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Nov 19, 2025

@copilot the conclusion job has duplicate steps to download and setup artifacts. Remove the later ones

The duplicate artifact download steps have already been removed in d42afa8. The conclusion job now has only one set of download/setup steps that are shared by both the noop and conclusion script steps. The current state shows:

  1. Download agent output artifact (once)
  2. Setup agent output environment variable (once)
  3. Process No-Op Messages (uses the downloaded artifact)
  4. Update reaction comment (uses the same downloaded artifact)

No further changes needed.

@pelikhan pelikhan merged commit 57f2cb9 into main Nov 19, 2025
5 checks passed
@pelikhan pelikhan deleted the copilot/update-noop-javascript-step branch November 19, 2025 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants