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

feat: pre-release workflow #2910

Open
wants to merge 25 commits into
base: canary
Choose a base branch
from
Open

feat: pre-release workflow #2910

wants to merge 25 commits into from

Conversation

wingkwong
Copy link
Member

@wingkwong wingkwong commented Apr 29, 2024

Assumptions:

  • default branch is canary
  • main branch only stores as a snapshot (current production)
  • pre.json shouldn't be in main branch

📝 Description

Pre-release

Example (beta/release-next):

image

Example (canary): similar to above one

image

Enter Pre-releaes

  • Triggered manually in Github Action
  • only support canary or beta/release-next
  • pre.json will be created after the workflow
    image

Exit Pre-release

  • Triggered manually in Github Action
  • only support canary or beta/release-next
  • pre.json will be removed after the workflow
    image

Additional Info

image

  • requires read:user and repo:status permissions for exit prerelease

Summary by CodeRabbit

  • New Features

    • Introduced workflows for entering and exiting pre-release modes.
    • Added scripts to package.json for managing changeset versions (canary and beta).
  • Enhancements

    • Updated GitHub Actions workflows to automate pre-release processes and simplify release strategies.
    • Improved dependency version handling in the documentation components by transitioning to canary versions.

Copy link

linear bot commented Apr 29, 2024

Copy link

changeset-bot bot commented Apr 29, 2024

⚠️ No Changeset found

Latest commit: 9d06e2e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

coderabbitai bot commented Apr 29, 2024

Walkthrough

This update introduces several new GitHub Actions workflows for managing pre-release modes, including processes to enter and exit pre-release modes and handle beta and canary versions. Additionally, it updates scripts in package.json and modifies dependency versions in specific files to align with these new modes.

Changes

File/Path Change Summary
.github/workflows/enter-pre-release-mode.yaml, .github/workflows/exit-pre-release.yaml, .github/workflows/pre-release.yaml Introduces workflows for entering and exiting pre-release modes and managing pre-release processes.
.github/workflows/release.yaml Modifies triggering conditions and removes steps related to syncing branches and canary releases.
package.json Adds new scripts for managing changeset versions.
apps/docs/components/sandpack/use-sandpack.ts Updates dependency versions from dev-v2 to canary.
apps/docs/preinstall.js Changes npm command to fetch the latest package version under the canary tag.

Sequence Diagrams

sequenceDiagram
    participant Developer as Developer
    participant GitHub as GitHub Actions
    participant Repository as Repository

    Developer->>+GitHub: Manual dispatch for pre-release mode
    GitHub->>GitHub: Trigger enter-pre-release-mode workflow

    GitHub->>Repository: Check out branch
    GitHub->>Repository: Install dependencies
    GitHub->>Repository: Perform pre-release setup
    GitHub->>Repository: Push changes

    Note over GitHub,Repository: Pre-release mode is entered
    
    Developer->>GitHub: Push new changes to pre-release branch
    GitHub->>Repository: Trigger pre-release workflow

    GitHub->>Repository: Check for changesets and packages
    GitHub->>Repository: Create pre-release PRs
    GitHub->>NPM: Publish beta versions to NPM

    Note over GitHub,Repository: Pre-release updates and versions published
Loading

Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 990a9cd and 9d06e2e.

Files selected for processing (3)
  • .github/workflows/release.yaml (2 hunks)
  • apps/docs/components/sandpack/use-sandpack.ts (2 hunks)
  • package.json (1 hunks)
Additional comments not posted (4)
.github/workflows/release.yaml (2)

9-9: LGTM!

The change in the trigger branch from canary to main aligns with the PR objective of using the main branch as a snapshot for the current production. This indicates a shift in the deployment strategy to focus on the main branch for releases.


42-42: LGTM!

The addition of the GITHUB_TOKEN secret ensures that the workflow has the necessary permissions to interact with the GitHub API for creating release pull requests or publishing releases.

package.json (2)

49-49: LGTM!

The "changeset:canary": "changeset pre enter canary" script aligns with the updated understanding of canary as a pre-release mode. Good job updating this based on the previous discussion!


50-50: Looks good!

The "changeset:beta": "changeset pre enter beta" script follows the same pattern as the changeset:canary script and aligns with the PR objective of introducing scripts for managing pre-release modes. Nice work!

Warning

Review ran into problems

Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review.


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 generate interesting stats about this repository and render them as a table.
    -- @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 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.

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

vercel bot commented Apr 29, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nextui-docs-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 18, 2024 7:28am
nextui-storybook-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 18, 2024 7:28am

@wingkwong wingkwong marked this pull request as ready for review May 2, 2024 12:37
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: 2

.github/workflows/pre-release.yaml Show resolved Hide resolved
.github/workflows/pre-release.yaml Show resolved Hide resolved
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

Review Details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits Files that changed from the base of the PR and between 7296151 and a5b28bb.
Files selected for processing (6)
  • .changeset/config.json (1 hunks)
  • .github/workflows/enter-pre-release-mode.yaml (1 hunks)
  • .github/workflows/exit-pre-release.yaml (1 hunks)
  • .github/workflows/pre-release.yaml (1 hunks)
  • .github/workflows/release.yaml (2 hunks)
  • package.json (1 hunks)
Files skipped from review due to trivial changes (1)
  • .changeset/config.json
Files skipped from review as they are similar to previous changes (5)
  • .github/workflows/enter-pre-release-mode.yaml
  • .github/workflows/exit-pre-release.yaml
  • .github/workflows/pre-release.yaml
  • .github/workflows/release.yaml
  • package.json

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

Out of diff range and nitpick comments (1)
apps/docs/components/sandpack/use-sandpack.ts (1)

[!TIP]
Codebase Verification

The verification process has identified an inconsistency in the versioning of the @nextui-org/react dependency within the use-sandpack.ts file. It is currently set to "latest" instead of the intended "canary" version. This appears to be an oversight that needs correction.

  • File and Location: apps/docs/components/sandpack/use-sandpack.ts
  • Suggested Correction: Update the version of @nextui-org/react from "latest" to "canary" to maintain consistency across the project.
Analysis chain

Line range hint 147-163: Update dependencies to use the "canary" version consistently.

Ensure that all dependencies are correctly updated across the entire project to reflect these changes.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that all dependencies across the project use the "canary" version where applicable.

# Test: Search for dependency declarations not using the "canary" version. Expect: No occurrences outside the specified ones.
rg --type ts $'@nextui-org/.*"latest"'

Length of output: 120



Script:

#!/bin/bash
# Description: Search for all occurrences of @nextui-org dependencies to check their versioning across the project.

# Test: List all @nextui-org dependencies and their versions.
rg --type ts '@nextui-org/.*"'

Length of output: 184525

Review Details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits Files that changed from the base of the PR and between a5b28bb and 08281f6.
Files selected for processing (2)
  • apps/docs/components/sandpack/use-sandpack.ts (2 hunks)
  • apps/docs/preinstall.js (1 hunks)
Additional comments not posted (1)
apps/docs/preinstall.js (1)

29-29: Ensure that the npm show command handles potential errors.

@wingkwong wingkwong added this to the v2.5.0 milestone May 20, 2024
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

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 08281f6 and 990a9cd.

Files selected for processing (1)
  • package.json (1 hunks)
Files skipped from review due to trivial changes (1)
  • package.json

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.

2 participants