Skip to content

Commit a981689

Browse files
authored
Merge pull request #22 from jakemgold/docs/readme-monorepo
Document monorepo support in the README
2 parents a6c2352 + 4a873bf commit a981689

1 file changed

Lines changed: 46 additions & 0 deletions

File tree

‎README.md‎

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ AI-written content with embedded images, plus the GitHub Release sidebar panel f
5151
## Features
5252

5353
- Monitor multiple GitHub repositories for new releases
54+
- Monorepo support — repositories releasing multiple packages are monitored per package, with a picker to choose exactly which packages get posts (see [Monorepo support](#monorepo-support))
5455
- AI-powered post generation via WordPress Connectors — works with Anthropic, OpenAI, Google, and any other configured connector
5556
- Significance-aware content — patch, minor, major, and security releases get tailored tone and structure
5657
- Choose the research depth — Standard reviews release notes, linked issues and PRs, metadata, and the README; Deep adds commit messages and file changes since the last release
@@ -68,6 +69,49 @@ AI-written content with embedded images, plus the GitHub Release sidebar panel f
6869
- Optional pre-release tracking per repository (off by default)
6970
- Optional AI disclosure note appended to generated posts
7071

72+
## Monorepo support
73+
74+
Repositories that release multiple packages from one codebase — tags like `@headstartwp/core@1.6.1` alongside `@headstartwp/next@1.5.1` — are detected automatically and monitored per package, so coordinated sibling releases each get their own post.
75+
76+
### Recognized tag shapes
77+
78+
| Tag style | Example | Derived package |
79+
|-----------|---------|-----------------|
80+
| npm / changesets (scoped) | `@headstartwp/core@1.6.1` | `@headstartwp/core` |
81+
| npm / changesets | `create-astro@5.2.2` | `create-astro` |
82+
| name + `-v` + version | `admin-v2.4.0` | `admin` |
83+
| name + version | `admin-2.4.0` | `admin` |
84+
85+
Plain tags (`v3.0.0`, `3.0.0`) form the repository's default stream. A repository whose releases all describe a single project — even in one of the package shapes above — is treated as single-package, and nothing changes for it.
86+
87+
### Choosing packages
88+
89+
Detected monorepos show a **Packages** option in the repository's inline edit: create posts for all packages (the default — no filter, so packages added in the future are included too), or choose a fixed set (stored explicitly, so new packages stay excluded until checked). Selections are stored as comma-separated tag patterns matched with `fnmatch()` semantics — `*`, `?`, and `[0-9]` are supported, brace expansion is not, and matching is case-sensitive, as git tags are.
90+
91+
### How monitoring works
92+
93+
- Each scheduled check inspects one bounded snapshot of the repository's 25 most recent release records.
94+
- Every release belongs to a stream — its package, or the default stream for plain tags — and each stream keeps its own cursor, so sibling releases published between checks are never skipped.
95+
- At most one release per stream is generated per check: a package publishing several versions between checks gets its newest eligible version.
96+
- Releases that already have a post are never re-processed, and the first check after upgrading records current releases without generating a burst of posts.
97+
- Changing **Include pre-releases** or the package selection is forward-only: monitoring continues under the new settings without generating newly eligible older releases. **Generate draft** is the deliberate backfill tool.
98+
- Once a repository is observed releasing multiple packages, post titles, URL slugs, and admin labels use readable package naming ("HeadstartWP core 1.6.1 — …"). Single-package repositories keep their raw-tag naming byte-for-byte.
99+
100+
### Custom tag patterns in code
101+
102+
For tagging schemes the plugin does not recognize, or dynamic rules, supply patterns with the `ghrp_repo_tag_patterns` filter:
103+
104+
```php
105+
add_filter( 'ghrp_repo_tag_patterns', function ( $patterns, $identifier, $repo ) {
106+
if ( 'acme/monorepo' === $identifier ) {
107+
return 'platform/*, sdk-[0-9]*';
108+
}
109+
return $patterns;
110+
}, 10, 3 );
111+
```
112+
113+
Return a comma-separated list of glob patterns, or an empty string for no filtering. The returned value must be deterministic — it participates in the stored eligibility policy, and a value that changed on every run would re-baseline (and therefore never post) on every run. The Packages picker reflects stored selections only; filter-supplied patterns apply at generation time.
114+
71115
## Requirements
72116

73117
- WordPress 7.0 or later
@@ -154,6 +198,8 @@ The plugin is extensible via filter hooks at every stage of the pipeline:
154198
| `ghrp_max_release_body_length` | Truncation threshold for large release bodies |
155199
| `ghrp_sideload_allowed_domains` | Domains allowed for image sideloading |
156200
| `ghrp_check_frequency` | WP-Cron schedule (default: `daily`) |
201+
| `ghrp_repo_tag_patterns` | Tag patterns for monorepo package selection (see [Monorepo support](#monorepo-support)) |
202+
| `ghrp_skip_accessible_repo` | Exclude repositories from the add-repo picker (default: archived and dot-prefixed repos) |
157203
| `ghrp_register_ai_providers` | Register custom AI provider connectors |
158204
| `ghrp_wp_ai_client_model_preferences` | Ordered list of preferred model IDs for WordPress Connectors |
159205
| `ghrp_openai_reasoning_effort` | Reasoning effort level for OpenAI models (default: `high`) |

0 commit comments

Comments
 (0)