fix(hooks): initialize .pr-monitor-seen.json and event-queue.json in init.sh (#94)#115
Merged
fix(hooks): initialize .pr-monitor-seen.json and event-queue.json in init.sh (#94)#115
Conversation
…init.sh - Add initialization for .pr-monitor-seen.json and event-queue.json to hooks/init.sh - Remove redundant/risky initialization from hooks/monitor-prs.sh - Add check in hooks/monitor-prs.sh to ensure seen file exists before use - Fixes #94
There was a problem hiding this comment.
Pull request overview
This PR fixes first-run failures in AutoShip’s hook monitors by ensuring required state files under .autoship/ are created during initialization, and by making monitor-prs.sh fail fast with a clear directive when initialization hasn’t been run.
Changes:
hooks/init.sh: Initialize.autoship/.pr-monitor-seen.json({}) and.autoship/event-queue.json([]) on first run.hooks/monitor-prs.sh: Remove redundant auto-creation of the seen-state file and replace it with an explicit existence check + actionable error.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| hooks/init.sh | Creates monitor/runtime state files (.pr-monitor-seen.json, event-queue.json) so fresh workspaces have required baseline state. |
| hooks/monitor-prs.sh | Validates seen-state presence and exits with a clear error message instead of attempting inline initialization. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
hooks/init.sh: Added initialization for.autoship/.pr-monitor-seen.jsonand.autoship/event-queue.jsonafter creating.autoship/workspaces/, ensuring all monitor state files exist on first runhooks/monitor-prs.sh: Removed redundant initialization; added existence check with clear error message directing users to runinit.shTest plan
bash hooks/init.shinitializes both filesbash hooks/init.shtwice is idempotent (second run skips existing files)bash hooks/monitor-prs.shstarts correctly when files present; errors clearly when missingCloses #94
🤖 Generated with AutoShip