Skip to content

fix: keep missing resource and hook targets read-only in sync previews - #389

Merged
coisa merged 1 commit into
mainfrom
fix/386-read-only-sync-preview
Oct 21, 2026
Merged

coisa merged 1 commit into
mainfrom
fix/386-read-only-sync-preview

Conversation

@coisa

@coisa coisa commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Related Issue

Closes #386

Motivation / Context

Missing resource/hook targets previously bypassed preview/check guards, wrote assets and returned success even for check mode.

Changes

  • Detect missing files before any resource copy or hook install, report the planned creation, and retain check-over-dry-run precedence.
  • Do not create parent directories or invoke copy/dump/chmod in preview modes, including rendered hooks and overwrite/interactive combinations.
  • Add PHPUnit regressions for missing file/directory targets, copied/rendered hooks, mixed resource sets, and top-level sync forwarding/skipped destructive commands. Existing normal install/overwrite behavior remains unchanged.

Executed behavioral evidence

Focused actual-source harnesses with boundary doubles and real disposable filesystem fixtures were run against unchanged main (RED) and this patch (GREEN):

  • Resource copy: dry-run/check previously both created targets with exit 0; now neither writes, dry-run exits 0, check exits 1.
  • GitHooks execute: copied/rendered × dry-run/check (four cases) previously all created parent directories; now none creates them, with check exiting 1.
    These are focused method/command harnesses, not the installed PHPUnit suite or full CLI integration.

Verification

  • PHP 8.4.26 syntax checks passed for every changed PHP source/test file.
  • git diff --check and composer validate --no-plugins --no-scripts --no-check-publish passed.
  • Independent source/test/doc review found no blocker.
  • Not run: dependency-backed PHPUnit, ECS, PHPDoc and complete composer dev-tools. This cloud checkout has no DevTools vendor dependencies (Symfony/Prophecy absent); a previously denied dependency download was not retried or bypassed. The committed PHPUnit regressions still need execution in the normal supported environment.
  • Self-hosted CI is intentionally not being retried/monitored today: the owner said the Mac is offline and will run it later. This is a draft awaiting normal validation and human review, not a claim of a green CI run.

Documentation / Generated Output

Command docs updated. No generated output, workflow, release, deployment or extraction proposal changed.

Changelog

Added an independent patch/fixed fragment; no manual release/version change.

Reviewer Notes

Based on main 35d27ee20066fd9e234d228bb866102c64c7ef1a. Separate from the responsibility-extraction proposals. No merge, release or deployment authorization is exercised here.

PR #376 also touches GitHooks/tests/docs for external runtime migration; these guards address an independent missing-target regression and must be preserved when integrating that PR.

@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 2adba76d-4e0f-4d46-8617-95022c9bf8f2
📥 Commits

Reviewing files that changed from the base of the PR and between 35d27ee and 4cc48cb.

📒 Files selected for processing: 8
  • .changelog/read-only-missing-sync-targets.md
  • docs/commands/copy-resource.rst
  • docs/commands/git-hooks.rst
  • src/Console/Command/CopyResourceCommand.php
  • src/Console/Command/GitHooksCommand.php
  • tests/Console/Command/CopyResourceCommandTest.php
  • tests/Console/Command/GitHooksCommandTest.php
  • tests/Console/Command/SyncCommandTest.php
+-----------------------------------------------------------+
| Your API returns 200 OK; your users return 404 Not Found. |
+-----------------------------------------------------------+
  \
   \     /)/)
        ( '')
        /  |
      o(___)
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

Changelog

✅ Contribution check passed.

Head: 4cc48cbab863fd5fb26f2e515723a253ec230ba4

Base: 35d27ee20066fd9e234d228bb866102c64c7ef1a

Contribution: 1 new valid fragment(s). Policy: ordinary.

  • read-only-missing-sync-targets.md — fixed, patch

    Keep resource and Git hook synchronization dry-run/check modes read-only when destinations are missing, reporting planned creations and failing checks without creating directories, copying files, rendering installed hooks or changing permissions.

@github-actions

Copy link
Copy Markdown
Contributor

@coisa
coisa marked this pull request as ready for review October 21, 2026 17:29
@github-actions

Copy link
Copy Markdown
Contributor

Rigorous review requested

This pull request is ready for the dedicated review-guardian pass powered by $pull-request-review.

Review focus

  • Source behavior or orchestration changed; verify regressions, contracts, and dependency boundaries.
  • Tests changed; confirm assertions still cover the touched behavior and edge cases.
  • Docs or README changed; verify commands, examples, and generated outputs stayed aligned.

Sample changed files

  • .changelog/read-only-missing-sync-targets.md
  • docs/commands/copy-resource.rst
  • docs/commands/git-hooks.rst
  • src/Console/Command/CopyResourceCommand.php
  • src/Console/Command/GitHooksCommand.php
  • tests/Console/Command/CopyResourceCommandTest.php
  • tests/Console/Command/GitHooksCommandTest.php
  • tests/Console/Command/SyncCommandTest.php

Suggested prompt

Use $pull-request-review with the review-guardian agent to review PR #389 (https://github.com/php-fast-forward/dev-tools/pull/389).
Lead with findings ordered by severity. Include repository file references whenever possible.
Prioritize bugs, regressions, missing tests, missing docs, generated-output drift, and workflow or CI impacts.
For workflow/action changes, record validation evidence or residual risk; pay special attention to GITHUB_TOKEN pushes and required-check dispatch/mirroring.
Base: main
Head: fix/386-read-only-sync-preview @ 4cc48cb

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T17:31:00.787474Z 4cc48cb Draft marked ready
🔒 Security Review ✅ Completed 2026-10-21T17:32:09.235668Z 4cc48cb Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coisa
coisa merged commit 7b37b0e into main Oct 21, 2026
66 of 67 checks passed
@coisa
coisa deleted the fix/386-read-only-sync-preview branch October 21, 2026 17:32
@github-project-automation github-project-automation Bot moved this from Backlog to Released in PHP Fast Forward Project Oct 21, 2026
github-actions Bot added a commit that referenced this pull request Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Released

Development

Successfully merging this pull request may close these issues.

Keep sync dry-run/check read-only when resource or hook targets are missing

1 participant