Skip to content

fix(hooks): initialize .pr-monitor-seen.json and event-queue.json in init.sh (#94)#115

Merged
Maleick merged 1 commit intomainfrom
autoship/issue-94
Apr 13, 2026
Merged

fix(hooks): initialize .pr-monitor-seen.json and event-queue.json in init.sh (#94)#115
Maleick merged 1 commit intomainfrom
autoship/issue-94

Conversation

@Maleick
Copy link
Copy Markdown
Owner

@Maleick Maleick commented Apr 13, 2026

Summary

  • hooks/init.sh: Added initialization for .autoship/.pr-monitor-seen.json and .autoship/event-queue.json after creating .autoship/workspaces/, ensuring all monitor state files exist on first run
  • hooks/monitor-prs.sh: Removed redundant initialization; added existence check with clear error message directing users to run init.sh

Test plan

  • bash hooks/init.sh initializes both files
  • Running bash hooks/init.sh twice is idempotent (second run skips existing files)
  • bash hooks/monitor-prs.sh starts correctly when files present; errors clearly when missing

Closes #94

🤖 Generated with AutoShip

…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
Copilot AI review requested due to automatic review settings April 13, 2026 17:27
Copy link
Copy Markdown

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

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.

@Maleick Maleick merged commit 802934a into main Apr 13, 2026
4 checks passed
@Maleick Maleick deleted the autoship/issue-94 branch April 13, 2026 21:00
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.

Hooks: init.sh must create .pr-monitor-seen.json on first run

2 participants