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

release script #9

Merged
merged 2 commits into from
Dec 23, 2024
Merged

release script #9

merged 2 commits into from
Dec 23, 2024

Conversation

JLarky
Copy link
Owner

@JLarky JLarky commented Dec 23, 2024

Summary by CodeRabbit

  • New Features

    • Updated versions for the following packages:
      • @lift-html/cli to 0.0.3
      • @lift-html/core to 0.0.4
      • @lift-html/solid to 0.0.6
      • @lift-html/tiny to 0.0.2
    • Introduced a new script for facilitating version bumps of specified packages.
  • Style

    • Improved formatting of the exclude array in the linting rules for better readability.

Copy link

coderabbitai bot commented Dec 23, 2024

Walkthrough

This pull request focuses on version updates for multiple packages within the Lift HTML project. The changes involve incrementing version numbers in deno.jsonc files for four packages: @lift-html/cli (0.0.2 → 0.0.3), @lift-html/core (0.0.3 → 0.0.4), @lift-html/solid (0.0.5 → 0.0.6), and @lift-html/tiny (0.0.1 → 0.0.2). Additionally, a new script bump-version.ts has been introduced to streamline the version bumping process across these packages.

Changes

File Change Summary
packages/cli/deno.jsonc Version updated from 0.0.2 to 0.0.3
packages/core/deno.jsonc Version updated from 0.0.3 to 0.0.4
packages/solid/deno.jsonc Version updated from 0.0.5 to 0.0.6
packages/tiny/deno.jsonc Version updated from 0.0.1 to 0.0.2, with minor formatting changes to lint.rules.exclude
scripts/bump-version.ts New script added to automate package version bumping

Sequence Diagram

sequenceDiagram
    participant User
    participant BumpScript as bump-version.ts
    participant Packages as Package deno.jsonc files
    
    User->>BumpScript: Run version bump script
    BumpScript->>User: Prompt package selection
    User-->>BumpScript: Select packages
    BumpScript->>Packages: Update version numbers
    BumpScript->>BumpScript: Stage changes
    BumpScript->>BumpScript: Commit with version info
    BumpScript->>BumpScript: Create Git tags
Loading

Possibly related PRs

Poem

🐰 Hop, hop, version bump we'll do!
Packages dancing, versions anew
CLI, Core, Solid, and Tiny
Versions growing, oh so shiny!
CodeRabbit's magic, version delight 🚀

Tip

CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command @coderabbitai generate docstrings to have CodeRabbit automatically generate docstrings for your pull request. We would love to hear your feedback on Discord.


🪧 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.

@JLarky JLarky merged commit fe86cef into main Dec 23, 2024
3 of 4 checks passed
@JLarky JLarky deleted the feat--release-script branch December 23, 2024 05:06
Copy link

@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

🧹 Nitpick comments (4)
scripts/bump-version.ts (4)

1-1: Ensure adequate permissions for script operations
The script uses --allow-env, --allow-read, and --allow-run. If the bump command modifies files (like version updates in deno.jsonc), consider adding --allow-write to guard against potential permission errors.


17-17: Validate file existence before bumping
If a package folder is missing or deno.jsonc doesn't exist, the script may fail with an unhelpful error. Validating the file's existence before calling bump can improve user experience.

 for (const name of selected) {
+  if (!(await $.exists(`packages/${name}/deno.jsonc`))) {
+    console.log(`File packages/${name}/deno.jsonc not found. Skipping...`);
+    continue;
+  }
   const filename = `packages/${name}/deno.jsonc`;
   await $`deno run -A jsr:@kellnerd/bump --file ${filename}`;
   ...
 }

29-33: Refine commit message for clarity
The current commit message includes package names and bumped versions. Consider adding a prefix or referencing the PR number/branch for better traceability in larger projects.


38-44: Graceful error handling
Catching Deno.errors.Interrupted is good. For broader errors, consider providing suggestions to the user (e.g., verifying dependencies). Logging only the error may not be enough in complex bumping workflows.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 52896c0 and 6eb7b69.

⛔ Files ignored due to path filters (1)
  • deno.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • packages/cli/deno.jsonc (1 hunks)
  • packages/core/deno.jsonc (1 hunks)
  • packages/solid/deno.jsonc (1 hunks)
  • packages/tiny/deno.jsonc (1 hunks)
  • scripts/bump-version.ts (1 hunks)
✅ Files skipped from review due to trivial changes (4)
  • packages/cli/deno.jsonc
  • packages/core/deno.jsonc
  • packages/solid/deno.jsonc
  • packages/tiny/deno.jsonc

Comment on lines +35 to +36
await $`git tag @lift-html/${name}@${versions.get(name) ?? ""}`;
}
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

Git tag creation needs error handling
The script currently creates tags without checking for existing ones or handling potential errors. This could lead to failed releases if tags already exist. Consider:

  • Adding -f flag to overwrite existing tags or
  • Adding error handling around the tag creation
  • Adding a pre-check for existing tags before attempting creation

Example fix:

for (const name of selected) {
  const tagName = `@lift-html/${name}@${versions.get(name) ?? ""}`;
  try {
    await $`git tag ${tagName}`;
  } catch (error) {
    console.error(`Failed to create tag ${tagName}:`, error);
    // Either exit or prompt user to force
  }
}
🔗 Analysis chain

Consider confirming successful tags creation
Tagging errors (e.g., if a tag already exists) will throw an error. You could confirm success or handle collisions (e.g., prompt or overwrite).


Let me check the implementation of the bump-version script to see how it handles tag creation and potential conflicts.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Verify that all newly created tags do not clash with existing tags
git fetch --tags
for tag in $(git tag); do
    echo "Found tag: $tag"
done

Length of output: 1938


Script:

#!/bin/bash
# Check the implementation of bump-version.ts
cat scripts/bump-version.ts

Length of output: 1412

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