Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated release process for Search and Comments UI #22146

Merged
merged 2 commits into from
Feb 10, 2025
Merged

Conversation

allouis
Copy link
Contributor

@allouis allouis commented Feb 10, 2025

ref #22127

The update to the Portal release process has now been tested on main, it would be good to get Search & Comments updated to the same process so that it's easier to reason about releasing all of them.

Copy link
Contributor

coderabbitai bot commented Feb 10, 2025

Walkthrough

This pull request updates the release process for specific applications by refining configuration management and automating package publication. In the release script (release-apps.js), new entries were added to the CONFIG_KEYS object to include mappings for both @tryghost/sodo-search and @tryghost/comments-ui. The CI configuration was enhanced with two new jobs in the GitHub Actions workflow to publish these packages when their versions change. Additionally, the ship scripts in the respective package.json files for @tryghost/sodo-search and @tryghost/comments-ui were modified to directly invoke the centralized release script, and the postship scripts have been removed entirely. These modifications standardize the release process and centralize operations within the release script.

Possibly related PRs

  • Released Portal, Comments & Search #22125: The changes in the main PR, which add new mappings to the CONFIG_KEYS object in release-apps.js, are related to the modifications in the ship script of the @tryghost/comments-ui and @tryghost/sodo-search packages in the retrieved PR, as both involve the same script file for handling package releases.
  • Improve apps release #22127: The changes in the main PR are related to the modifications in the CONFIG_KEYS object in .github/scripts/release-apps.js, which are directly tied to the new jobs for publishing the @tryghost/sodo-search and @tryghost/comments-ui packages in the CI workflow, as both PRs involve updates to the release management process for these packages.

Suggested labels

browser-tests

Suggested reviewers

  • sagzy
  • daniellockyer

Poem

Oh, hop and skip in lines of code,
New releases make my heart explode! 🐰
Mapping keys for search and chat,
Automated jobs, imagine that!
A bashful cheer from little paws—
Enjoy the changes, no need for faux pas!
Keep on hopping through the code!


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c7b631b and b0c792b.

📒 Files selected for processing (4)
  • .github/scripts/release-apps.js (1 hunks)
  • .github/workflows/ci.yml (1 hunks)
  • apps/comments-ui/package.json (1 hunks)
  • apps/sodo-search/package.json (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (14)
  • GitHub Check: Unit tests (Node 20.11.1)
  • GitHub Check: Regression tests (Node 20.11.1, sqlite3)
  • GitHub Check: Unit tests (Node 18.12.1)
  • GitHub Check: Signup-form tests
  • GitHub Check: Regression tests (Node 20.11.1, mysql8)
  • GitHub Check: Database tests (Node 20.11.1, sqlite3)
  • GitHub Check: Database tests (Node 20.11.1, mysql8)
  • GitHub Check: Lint
  • GitHub Check: i18n
  • GitHub Check: Database tests (Node 18.12.1, mysql8)
  • GitHub Check: Ghost-CLI tests
  • GitHub Check: Comments-UI tests
  • GitHub Check: Admin-X Settings tests
  • GitHub Check: Admin tests - Chrome
🔇 Additional comments (4)
.github/scripts/release-apps.js (1)

9-13: LGTM! Configuration mapping follows existing pattern.

The new entries for sodo-search and comments-ui follow the same pattern as the existing portal entry, maintaining consistency in the configuration structure.

apps/sodo-search/package.json (1)

36-36: LGTM! Ship script updated to use centralized release process.

The ship script now uses the centralized release-apps.js script, aligning with the standardized release process.

apps/comments-ui/package.json (1)

30-30: LGTM! Ship script updated to use centralized release process.

The ship script now uses the centralized release-apps.js script, aligning with the standardized release process.

.github/workflows/ci.yml (1)

1142-1276: LGTM! New publish jobs follow existing patterns.

The new publish jobs for sodo-search and comments-ui follow the same secure patterns as existing jobs:

  • Proper job dependencies
  • Version change checks
  • Secure npm configuration
  • CDN cache purging

.github/workflows/ci.yml Outdated Show resolved Hide resolved
ref #22127

The update to the Portal release process has now been tested on main, it would
be good to get Search & Comments updated to the same process so that it's
easier to reason about releasing all of them.
@allouis allouis force-pushed the improve-apps-release branch from b0c792b to 6bc243e Compare February 10, 2025 11:35
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
apps/comments-ui/package.json (1)

30-30: Streamlined "ship" Script Implementation
The "ship" script now directly calls the centralized release-apps.js command, removing the earlier git status check and version bump logic. This simplification aligns the release process for Comments UI with the updated Portal process. Please verify that any pre-release validations now occur inside release-apps.js and that removal of the "postship" script has no unintended downstream effects.

.github/workflows/ci.yml (2)

1142-1209: Addition of the Publish @tryghost/sodo-search Job
This new job automates the publishing process for the @tryghost/sodo-search package. It performs a version comparison, conditionally builds the package when a version change is detected, and then publishes the package to npm. Additionally, it purges both the JavaScript and CSS assets from the jsdelivr cache using the extracted current minor version. Please verify that the working directory ("apps/sodo-search") is correctly configured and that the version-check logic reliably detects changes.


1210-1276: Addition of the Publish @tryghost/comments-ui Job
This job introduces an automated workflow for publishing the @tryghost/comments-ui package. It mirrors the logic used in the publish_search job by checking for a version change, building the package if needed, setting up npm credentials, publishing to npm, and purging the jsdelivr cache. Ensure that the working directory ("apps/comments-ui") and environment variable interpolations (such as for "current_minor") are correct, and that the overall job condition reliably restricts publishing to the main branch.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b0c792b and 6bc243e.

📒 Files selected for processing (4)
  • .github/scripts/release-apps.js (1 hunks)
  • .github/workflows/ci.yml (1 hunks)
  • apps/comments-ui/package.json (1 hunks)
  • apps/sodo-search/package.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • .github/scripts/release-apps.js
  • apps/sodo-search/package.json
⏰ Context from checks skipped due to timeout of 90000ms (14)
  • GitHub Check: Unit tests (Node 20.11.1)
  • GitHub Check: Unit tests (Node 18.12.1)
  • GitHub Check: Regression tests (Node 20.11.1, sqlite3)
  • GitHub Check: Signup-form tests
  • GitHub Check: Regression tests (Node 20.11.1, mysql8)
  • GitHub Check: Database tests (Node 20.11.1, sqlite3)
  • GitHub Check: Lint
  • GitHub Check: Database tests (Node 20.11.1, mysql8)
  • GitHub Check: i18n
  • GitHub Check: Ghost-CLI tests
  • GitHub Check: Database tests (Node 18.12.1, mysql8)
  • GitHub Check: Admin tests - Chrome
  • GitHub Check: Admin-X Settings tests
  • GitHub Check: Comments-UI tests

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
apps/comments-ui/README.md (1)

30-32: Clarify Manual JsDelivr Cache Clearing Instructions
The new “JsDelivr cache” section offers helpful guidance for manually clearing the cache when CI does not do it automatically. It would be beneficial to:

  • Ensure that the variable ${COMMENTS_UI_VERSION} is clearly documented elsewhere so users know where to find or update it.
  • Consider providing an example or further context on how to verify the cache has been cleared successfully.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6bc243e and 9713cca.

📒 Files selected for processing (1)
  • apps/comments-ui/README.md (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (10)
  • GitHub Check: Signup-form tests
  • GitHub Check: Ghost-CLI tests
  • GitHub Check: Regression tests (Node 20.11.1, sqlite3)
  • GitHub Check: Comments-UI tests
  • GitHub Check: Database tests (Node 20.11.1, sqlite3)
  • GitHub Check: Regression tests (Node 20.11.1, mysql8)
  • GitHub Check: Database tests (Node 20.11.1, mysql8)
  • GitHub Check: Database tests (Node 18.12.1, mysql8)
  • GitHub Check: Admin-X Settings tests
  • GitHub Check: Admin tests - Chrome
🔇 Additional comments (2)
apps/comments-ui/README.md (2)

22-22: Streamlined Patch Release Step
The new step “Merge the release commit to main” provides a clear and concise action for patch releases, ensuring consistency with the updated Portal release process. Please confirm that this new step is coordinated with the rest of the release workflow documentation.


27-27: Streamlined Minor/Major Release Step
Adding “Merge the release commit to main” as the second step for minor/major releases aligns the process with the patch release flow. Verify that all release-related scripts and documentation reflect this change consistently.

@allouis allouis merged commit c4d6019 into main Feb 10, 2025
25 checks passed
@allouis allouis deleted the improve-apps-release branch February 10, 2025 11:48
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