Skip to content

fix: remove duplicate permission + add mktree to cspell#1005

Merged
tamirdresher merged 7 commits intodevfrom
fix/ci-yaml-and-cspell
Apr 20, 2026
Merged

fix: remove duplicate permission + add mktree to cspell#1005
tamirdresher merged 7 commits intodevfrom
fix/ci-yaml-and-cspell

Conversation

@tamirdresher
Copy link
Copy Markdown
Collaborator

@tamirdresher tamirdresher commented Apr 18, 2026

What

Fixes CI — all 213 tests green again 🟢

Root Causes (layered)

  1. YAML parse error — duplicate \pull-requests: read\ in squad-ci.yml (from chore: CI cleanup — delete ci-rerun.yml, streamline squad-ci.yml (#1000) #1001 merge) → 0 jobs, instant failure
  2. Orphaned test files — PR ci: remove fork-added workflows not in ralph/test/publish #940 deleted scripts but left tests behind
  3. Monorepo detection in tests — commit 8449a77 added \detectParentGitRepo()\ which writes \squad.agent.md\ to repo root when tests create temp dirs inside the checkout
  4. Error message mismatches — loop.test.ts regex and comms-teams warning text drifted from source
  5. Template-sync race — acceptance tests run \squad init\ from repo root (overwriting \squad.agent.md), while template-sync checks byte parity in parallel

Changes

File Fix
.github/workflows/squad-ci.yml\ Remove duplicate \pull-requests: read\
\cspell.json\ Add 'mktree' to dictionary
\ est/scripts/architectural-review.test.ts\ Deleted (orphaned)
\ est/scripts/check-bootstrap-deps.test.ts\ Deleted (orphaned)
\ est/cli/init.test.ts\ \TEST_ROOT\ → \ mpdir()\
\ est/cli/upgrade.test.ts\ \TEST_ROOT\ → \ mpdir()\
\ est/cli/export-import.test.ts\ \TEST_ROOT\ + \IMPORT_ROOT\ → \ mpdir()\
\ est/cli/scrub-emails.test.ts\ \TEST_ROOT\ → \ mpdir()\
\ est/cli/init-upgrade-parity.test.ts\ \TEST_ROOT\ → \ mpdir()\
\ est/cli/loop.test.ts\ Regex /gh CLI/i\ → /Copilot CLI/i\
\ est/comms-teams-integration.test.ts\ Expected warning includes (invalid_grant)\
\ est/template-sync.test.ts\ \�eforeAll\ re-syncs templates before byte comparison

Testing

CI green — all 213 test files pass ✅

- Remove duplicate 'pull-requests: read' in squad-ci.yml that caused
  YAML parsing failure (0 jobs, instant CI failure)
- Add 'mktree' to cspell.json dictionary (git command used in
  state-backends.md was flagged as unknown word)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 18, 2026 08:31
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 CI failures on dev by correcting an invalid GitHub Actions workflow permissions block and updating the cspell dictionary to recognize a git command used in docs.

Changes:

  • Removed a duplicate pull-requests: read entry from .github/workflows/squad-ci.yml so the workflow YAML parses and runs.
  • Added mktree to cspell.json to prevent docs-quality spellcheck failures.

Reviewed changes

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

File Description
cspell.json Adds mktree to the dictionary to stop cspell from failing on the docs term.
.github/workflows/squad-ci.yml Removes duplicate permissions key to restore valid workflow YAML parsing/execution.

Copilot and others added 6 commits April 18, 2026 11:38
architectural-review.test.ts and check-bootstrap-deps.test.ts were left
behind when PR #940 deleted the scripts they test (architectural-review.mjs,
check-bootstrap-deps.mjs). Tests fail with 'No JSON object found' because
the scripts no longer exist.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…hanges

- init.test.ts, upgrade.test.ts: use os.tmpdir() instead of process.cwd()
  for TEST_ROOT so temp dirs aren't inside the repo checkout, avoiding
  detectParentGitRepo() redirecting agent files to the repo root (8449a77)
- loop.test.ts: update regex from /gh CLI/i to /Copilot CLI/i to match
  the new error message text (21587fb)
- comms-teams-integration.test.ts: update expected warning to include
  authError detail in permanently-failed message

Also fixes template-sync.test.ts indirectly — init tests were overwriting
the repo's .github/agents/squad.agent.md causing a content mismatch.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Same monorepo detection fix as init/upgrade — tests creating temp dirs
inside the repo checkout cause detectParentGitRepo() to write to
.github/agents/ instead of the test dir, corrupting template-sync.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Same monorepo detection fix as other test files — place temp dir
outside git repo to prevent detectParentGitRepo() from corrupting
.github/agents/squad.agent.md during tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Acceptance tests run 'squad init' from the repo root, which overwrites
.github/agents/squad.agent.md with CLI template content + version stamp.
Since Vitest runs test files in parallel, this corrupts the file before
template-sync checks it.

Add beforeAll() that re-runs sync-templates.mjs to restore the canonical
state before any byte-for-byte comparisons.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Same pattern as init, upgrade, export-import, scrub-emails, and
init-upgrade-parity tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@tamirdresher tamirdresher merged commit 95746d2 into dev Apr 20, 2026
6 checks passed
tamirdresher added a commit that referenced this pull request Apr 21, 2026
Fixes all test failures on dev caused by monorepo subfolder detection (#939).

Changes:
- Use os.tmpdir() for test temp dirs to avoid detectParentGitRepo() interference
- Update loop.test.ts regex from /gh CLI/i to /Copilot CLI/i (rebranding)
- Update comms-teams warning message expectation (invalid_grant detail)
- Remove orphaned test files for deleted scripts
- Re-sync templates before byte comparison in template-sync test
- Use tmpdir() in consult, init-upgrade-parity, export-import, scrub-emails tests

All 6 CI jobs pass: changes, docs-quality, sdk-exports-validation, samples-build, test, Policy Gates.
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