Skip to content

[WIP] Remove redundant compile step from CI workflow#170

Closed
Claude wants to merge 1 commit intomainfrom
claude/remove-redundant-compile-step-again
Closed

[WIP] Remove redundant compile step from CI workflow#170
Claude wants to merge 1 commit intomainfrom
claude/remove-redundant-compile-step-again

Conversation

@Claude
Copy link
Copy Markdown
Contributor

@Claude Claude AI commented Mar 1, 2026

  • Understand the CI workflow and npm scripts
  • Remove the redundant npm run compile step from the CI workflow
  • Verify the workflow still compiles TypeScript via npm script hooks
  • Test the changes (validate workflow syntax)
Original prompt

This section details on the original issue you should resolve

<issue_title>[ci-coach] ci: remove redundant compile step from CI workflow</issue_title>
<issue_description>### Summary

Removes the explicit npm run compile step from the CI workflow, which was running TypeScript compilation redundantly before every test run.

Optimizations

1. Remove Redundant TypeScript Compilation

Type: Resource / Efficiency
Impact: Estimated ~2–3 seconds savings per runner × 3 runners ≈ 6–9 seconds per CI run
Risk: Low

Changes:

  • Removed the standalone npm run compile step from the build job

Rationale: The explicit compile step is never needed because TypeScript is already compiled by downstream scripts:

  • Linux: npm run test:coveragenpm run test:unit (calls npm run compile internally) + npm test → triggers pretest (npm run compile && npm run lint)
  • macOS/Windows: npm test → triggers pretest (npm run compile && npm run lint)

This means TypeScript was being compiled 3× on Linux and 2× on macOS/Windows per CI run. This PR reduces it to 2× on Linux and 1× on macOS/Windows.

Detailed Analysis

npm scripts call chain (before this change):

Platform Compile invocations
Linux 1. explicit step → 2. test:unit script → 3. pretest hook
macOS/Windows 1. explicit step → 2. pretest hook

npm scripts call chain (after this change):

Platform Compile invocations
Linux 1. test:unit script → 2. pretest hook
macOS/Windows 1. pretest hook

Compilation errors are still surfaced early — they will fail the test step with a clear TypeScript compiler error in the output.

Expected Impact

  • Time Savings: ~6–9 seconds per CI run
  • Risk Level: Low — no test coverage or functionality changes; pretest continues to handle compilation and linting

Testing Recommendations

  • Review workflow syntax
  • Monitor first few runs after merge to confirm test steps still surface compilation errors correctly
  • Compare runtime before/after

Generated by CI Optimization Coach

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/ci-coach.md@442992eda2ccb11ee75a39c019ec6d38ae5a84a2
  • expires on Mar 3, 2026, 1:10 PM UTC

[!NOTE]
This was originally intended as a pull request, but the git push operation failed.

Workflow Run: View run details and download patch artifact

The patch file is available in the agent-artifacts artifact in the workflow run linked above.

To create a pull request with the changes:

# Download the artifact from the workflow run
gh run download 22544042209 -n agent-artifacts -D /tmp/agent-artifacts-22544042209

# Create a new branch
git checkout -b ci/remove-redundant-compile-step-b58d366b43d1ffcd

# Apply the patch (--3way handles cross-repo patches where files may already exist)
git am --3way /tmp/agent-artifacts-22544042209/aw-ci-remove-redundant-compile-step.patch

# Push the branch to origin
git push origin ci/remove-redundant-compile-step-b58d366b43d1ffcd

# Create the pull request
gh pr create --title '[ci-coach] ci: remove redundant compile step from CI workflow' --base main --head ci/remove-redundant-compile-step-b58d366b43d1ffcd --repo askpt/code-metrics
Show patch (38 lines)
From 08e93a997cc8018f3504d71bb62e59e31475501b Mon Sep 17 00:00:00 2001
From: Copilot <copilot@github.com>
Date: Sun, 1 Mar 2026 13:09:14 +0000
Subject: [PATCH] ci: remove redundant compile step from CI workflow
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The explicit `npm run compile` step is unnecessary because:
- On Linux: `npm run test:coverage` calls `test:unit` (which compiles) and
  then `npm test` triggers `pretest` (which also compiles + lints)
- On macOS/Windows: `npm test` triggers `pretest` which runs compile + lint

Removing this step eliminates 1 redundant TypeScript compilation per runner,
saving ~2-3 seconds × 3 runners ≈ 6-9 seconds per CI run.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
 .github/workflows/ci.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --gi...

</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

- Fixes askpt/code-metrics#168

@Claude Claude AI assigned Claude and askpt Mar 1, 2026
@askpt askpt closed this Mar 1, 2026
Copilot stopped work on behalf of askpt due to an error March 1, 2026 13:53
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.

2 participants