Skip to content

fix: checkout Workflows scripts in reusable-codex-run.yml - #190

Merged
stranske merged 1 commit into
mainfrom
fix/reusable-codex-scripts-checkout
Dec 26, 2025
Merged

stranske merged 1 commit into
mainfrom
fix/reusable-codex-scripts-checkout

Conversation

@stranske

@stranske stranske commented Dec 26, 2025

Copy link
Copy Markdown
Owner

Automated Status Summary

Scope

  • Scope section missing from source issue.

Tasks

  • Tasks section missing from source issue.

Acceptance criteria

  • Acceptance criteria section missing from source issue.

Head SHA: 4f5d0f6
Latest Runs: ⏳ queued — Gate
Required: gate: ⏳ queued

Workflow / Job Result Logs
Agents PR meta manager ❔ in progress View run
CI Autofix Loop ✅ success View run
Copilot code review ❔ in progress View run
Gate ⏳ queued View run
Health 40 Sweep ❔ in progress View run
Health 44 Gate Branch Protection ❔ in progress View run
Health 45 Agents Guard ✅ success View run
Health 50 Security Scan ❔ in progress View run
Maint 52 Validate Workflows ✅ success View run
PR 11 - Minimal invariant CI ✅ success View run
Selftest CI ❔ in progress View run

The reusable workflow was referencing scripts at .github/scripts/ but
when running in consumer repos, those scripts don't exist there.

Added a sparse checkout of stranske/Workflows to .workflows-lib/ to
make the scripts available, and updated the require() paths to use
the new location.

Fixes: Cannot find module '.github/scripts/post_completion_comment.js'
Copilot AI review requested due to automatic review settings December 26, 2025 18:16
@stranske
stranske temporarily deployed to agent-high-privilege December 26, 2025 18:16 — with GitHub Actions Inactive
@agents-workflows-bot

Copy link
Copy Markdown
Contributor

⚠️ Action Required: Unable to determine source issue for PR #190. The PR title, branch name, or body must contain the issue number (e.g. #123, branch: issue-123, or the hidden marker ).

@github-actions

Copy link
Copy Markdown
Contributor

Automated Status Summary

Head SHA: cb0f1c2
Latest Runs: ⏳ pending — Gate
Required contexts: Gate / gate, Health 45 Agents Guard / Enforce agents workflow protections
Required: core tests (3.11): ⏳ pending, core tests (3.12): ⏳ pending, docker smoke: ⏳ pending, gate: ⏳ pending

Workflow / Job Result Logs
(no jobs reported) ⏳ pending

Coverage Overview

  • Coverage history entries: 1

Coverage Trend

Metric Value
Current 77.97%
Baseline 0.00%
Delta +77.97%
Minimum 70.00%
Status ✅ Pass

Updated automatically; will refresh on subsequent CI/Docker completions.


Keepalive checklist

Scope

No scope information available

Tasks

  • No tasks defined

Acceptance criteria

  • No acceptance criteria defined

@stranske
stranske merged commit df30d5f into main Dec 26, 2025
54 checks passed
@stranske
stranske deleted the fix/reusable-codex-scripts-checkout branch December 26, 2025 18:18
@github-actions

Copy link
Copy Markdown
Contributor

🤖 Keepalive Loop Status

PR #190 | Agent: Codex | Iteration 0/5

Current State

Metric Value
Iteration progress [----------] 0/5
Action wait (missing-agent-label)
Gate success
Tasks 0/2 complete
Keepalive ❌ disabled
Autofix ❌ disabled

🔍 Failure Classification

| Error type | infrastructure |
| Error category | resource |
| Suggested recovery | Confirm the referenced resource exists (repo, PR, branch, workflow, or file). |

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

This PR fixes a module resolution issue in the reusable-codex-run.yml workflow where consumer repos couldn't find the post_completion_comment.js and error_classifier.js scripts because they only exist in the stranske/Workflows repository.

Key Changes

  • Added a sparse checkout step for the Workflows repository scripts
  • Updated require() paths to reference scripts from the checked-out location
  • Enables the workflow to function correctly in consumer repositories

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

with:
script: |
const { classifyError, ERROR_CATEGORIES, suggestRecoveryAction } = require('./.github/scripts/error_classifier.js');
const { classifyError, ERROR_CATEGORIES, suggestRecoveryAction } = require('./.workflows-lib/.github/scripts/error_classifier.js');

Copilot AI Dec 26, 2025

Copy link

Choose a reason for hiding this comment

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

If the path is changed to workflows-lib (to match the convention used in other reusable workflows), this require path should be updated to ./.workflows-lib/.github/scripts/error_classifier.js./workflows-lib/.github/scripts/error_classifier.js (without the leading dot before workflows-lib).

Alternatively, consider following the pattern used in reusable-20-pr-meta.yml (lines 124-139) and reusable-18-autofix.yml (lines 234-236) where an environment variable WORKFLOWS_SCRIPTS_PATH is set, and then the require uses that variable: require(\${scriptsPath}/.github/scripts/error_classifier.js`)`.

Copilot uses AI. Check for mistakes.
ref: main
sparse-checkout: .github/scripts
sparse-checkout-cone-mode: false
path: .workflows-lib

Copilot AI Dec 26, 2025

Copy link

Choose a reason for hiding this comment

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

The path name .workflows-lib is inconsistent with the naming convention used in other reusable workflows in this repository. Both reusable-20-pr-meta.yml and reusable-18-autofix.yml use workflows-lib (without the leading dot) for the same purpose.

Consider changing the path to workflows-lib to maintain consistency across the codebase. This would also align with the pattern used in lines 115-121 of reusable-20-pr-meta.yml and lines 226-232 of reusable-18-autofix.yml.

Suggested change
path: .workflows-lib
path: workflows-lib

Copilot uses AI. Check for mistakes.
with:
script: |
const { postCompletionComment } = require('./.github/scripts/post_completion_comment.js');
const { postCompletionComment } = require('./.workflows-lib/.github/scripts/post_completion_comment.js');

Copilot AI Dec 26, 2025

Copy link

Choose a reason for hiding this comment

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

If the path is changed to workflows-lib (to match the convention used in other reusable workflows), this require path should be updated to .workflows-lib/.github/scripts/post_completion_comment.js./workflows-lib/.github/scripts/post_completion_comment.js (without the leading dot before workflows-lib).

Alternatively, consider following the pattern used in reusable-20-pr-meta.yml (lines 124-139) and reusable-18-autofix.yml (lines 234-236) where an environment variable WORKFLOWS_SCRIPTS_PATH is set, and then the require uses that variable: require(\${scriptsPath}/.github/scripts/post_completion_comment.js`)`.

Copilot uses AI. Check for mistakes.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +172 to +176
repository: stranske/Workflows
ref: main
sparse-checkout: .github/scripts
sparse-checkout-cone-mode: false
path: .workflows-lib

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Exclude .workflows-lib checkout from git commits

The new checkout clones stranske/Workflows into .workflows-lib, but the directory is left unignored and undeleted. Later in the same job the Commit and push changes step runs git status --porcelain/git add -A (around lines 413‑450), so even when Codex makes no edits the untracked nested repo makes CHANGED_FILES non‑zero and will be committed and pushed as a gitlink. That means every run now tries to add .workflows-lib to consumer branches, even on no-op runs, polluting repos with an unintended submodule.

Useful? React with 👍 / 👎.

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