Skip to content

ci: notify customer-portal when search-ui is published#51

Merged
betschki merged 1 commit into
mainfrom
chore/notify-customer-portal-on-release
Jun 24, 2026
Merged

ci: notify customer-portal when search-ui is published#51
betschki merged 1 commit into
mainfrom
chore/notify-customer-portal-on-release

Conversation

@betschki

@betschki betschki commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

After the npm publish step in release.yml, fire a repository_dispatch to magicpages/customer-portal carrying the new @magicpages/ghost-typesense-search-ui version. The portal listens for it (customer-portal#2247) and opens a PR bumping its pin within seconds of the release — instead of waiting up to a week for its Dependabot run.

Behaviour

  • Best-effort / non-fatal: continue-on-error: true plus an explicit skip-with-warning when the token is unset. A dispatch failure never fails an otherwise-successful release (the publish already happened).
  • Sends the search-ui package's own version (packages/search-ui/package.json), built as JSON via node -p and piped to gh api --input - (no shell interpolation of the value).

Required setup

Add a repo secret CUSTOMER_PORTAL_DISPATCH_TOKEN — a fine-grained PAT with Contents: write on magicpages/customer-portal (the GITHUB_TOKEN here is scoped to this repo only and can't dispatch cross-repo). Until it's set, the step logs a warning and skips; releases still publish normally and the portal's weekly Dependabot net covers the gap.

Test plan

  • release.yml parses; dispatch is the final publish-job step
  • Add the secret, publish a release, confirm a bump PR opens on customer-portal

Summary by Sourcery

CI:

  • Extend the release workflow to send a repository_dispatch event with the new search-ui package version to magicpages/customer-portal, guarded by an optional PAT-backed token and non-fatal on failure.

After the npm publish step, fire a repository_dispatch to
magicpages/customer-portal carrying the new search-ui version. The portal
listens for it and opens a PR bumping its
@magicpages/ghost-typesense-search-ui pin within seconds of the release,
instead of waiting for its weekly Dependabot run.

Best-effort and non-fatal: a missing token or API error won't fail an
otherwise-successful release (continue-on-error + an explicit skip when
the token is unset). Requires a CUSTOMER_PORTAL_DISPATCH_TOKEN secret — a
fine-grained PAT with "Contents: write" on the customer-portal repo, since
GITHUB_TOKEN is scoped to this repository only.
@sourcery-ai

sourcery-ai Bot commented Jun 24, 2026

Copy link
Copy Markdown

Reviewer's Guide

Adds a best-effort GitHub Actions step to the release workflow that, after publishing, sends a repository_dispatch event with the new search-ui package version to the customer-portal repo so it can auto-open a bump PR.

Sequence diagram for GitHub Actions dispatch to customer-portal on search-ui release

sequenceDiagram
    actor Developer
    participant search_ui_repo as search-ui_repo
    participant release_workflow as release.yml_publish_job
    participant github_api as GitHub_API
    participant customer_portal as customer-portal_repo

    Developer->>search_ui_repo: Merge release changes
    search_ui_repo->>release_workflow: Trigger release workflow
    release_workflow->>release_workflow: npm publish packages
    release_workflow->>release_workflow: Check CUSTOMER_PORTAL_DISPATCH_TOKEN
    alt token missing
        release_workflow-->>release_workflow: Log warning and skip dispatch
    else token present
        release_workflow->>github_api: gh api POST repos/magicpages/customer-portal/dispatches
        github_api-->>customer_portal: repository_dispatch ghost-typesense-search-ui-released
    end
Loading

File-Level Changes

Change Details Files
Add post-publish repository_dispatch notification to customer-portal from release workflow
  • Append a new job step that runs only on successful releases and is marked continue-on-error so failures don’t break publishing
  • Load a fine-grained PAT from CUSTOMER_PORTAL_DISPATCH_TOKEN into GH_TOKEN for use by the GitHub CLI
  • Guard the step with a shell check that logs a workflow warning and exits early when the token is missing
  • Compute the @magicpages/ghost-typesense-search-ui package version from packages/search-ui/package.json using node -p and JSON.stringify
  • Send a POST request to the magicpages/customer-portal dispatches endpoint via gh api, passing event_type and client_payload.version in the JSON body
.github/workflows/release.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@betschki, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 41 minutes and 48 seconds. Learn how PR review limits work.

To continue reviewing without waiting, enable usage-based billing in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e634cabb-300c-483e-9303-41b77dce187b

📥 Commits

Reviewing files that changed from the base of the PR and between 5c3c720 and ac4d7fd.

📒 Files selected for processing (1)
  • .github/workflows/release.yml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/notify-customer-portal-on-release

Warning

Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption.


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

@betschki betschki merged commit a54a3b8 into main Jun 24, 2026
7 checks passed
@betschki betschki deleted the chore/notify-customer-portal-on-release branch June 24, 2026 19:05
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.

1 participant