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

πŸ—οΈ Upgrade workflows and enable erasableSyntaxOnly #86

Merged
merged 1 commit into from
Feb 5, 2025

Conversation

NatoBoram
Copy link
Collaborator

@NatoBoram NatoBoram commented Feb 5, 2025

Summary by CodeRabbit

  • Chores
    • Upgraded the runtime environment to Node.js 23 for improved performance.
    • Enhanced automation workflows with a new job for automatic fixes and streamlined release and patch processes.
    • Removed outdated internal access credentials.
  • Documentation
    • Updated installation guidance to reflect the new module import path.
  • Tests
    • Adjusted test command usage and updated dependencies for a more consistent testing experience.

@NatoBoram NatoBoram added the dependencies Pull requests that update a dependency file label Feb 5, 2025
@NatoBoram NatoBoram self-assigned this Feb 5, 2025
Copy link

coderabbitai bot commented Feb 5, 2025

πŸ“ Walkthrough

Walkthrough

The changes update various GitHub Actions workflows and configuration files. The adjustments include upgrading the Node.js version from 21 to 23 across multiple workflows, removing the SSH key for the GitHub Actions bot, and altering job definitions. Notably, a new β€œfix” job has been added to the Node.js CI workflow, and steps in the package publishing and version patch workflows have been restructured. Minor updates are also applied in the README import path, package scripts, TypeScript dependency, and TS configuration.

Changes

File(s) Change Summary
.github/authorized_keys Removed SSH public key for github-actions[bot] to revoke its SSH access.
.github/workflows/github-pages.yaml
.github/workflows/node.js.yaml
.github/workflows/pnpm-publish.yaml
.github/workflows/pnpm-version-patch.yaml
Upgraded Node.js version from 21 to 23; in node.js.yaml, added a new fix job with checkout, dependency installation with flags, commit and push steps; in pnpm-publish.yaml, removed package signing steps; in pnpm-version-patch.yaml, restructured version patch steps and replaced SSH key usage with GitHub ref.
README.md Updated the import path for promptTokensEstimate from "openai-chat-tokens" to "@coderabbitai/openai-chat-tokens".
package.json Modified test scripts (changed "test": "vitest" to "vitest run" and simplified "test:watch") and updated the TypeScript dependency from version 5.7.3 to 5.8.0-beta.
tsconfig.json Added a new compiler option: "erasableSyntaxOnly": true.

Sequence Diagram(s)

sequenceDiagram
    participant Runner as GitHub Actions Runner
    participant Repo as Repository Code
    participant PNPM as Dependency Manager
    participant Commit as Commit Action
    participant Git as Git Repository

    Runner->>Repo: Checkout repository
    Runner->>PNPM: Setup pnpm and install dependencies with --fix-lockfile
    PNPM-->>Runner: Return fixed dependencies and lockfile updates
    Runner->>Commit: Format code and fix lint issues
    Commit-->>Git: Commit changes (lockfile, code formatting, lint fixes)
    Runner->>Git: Conditionally push committed changes
Loading

Tip

🌐 Web search-backed reviews and chat
  • We have enabled web search-based reviews and chat for all users. This feature allows CodeRabbit to access the latest documentation and information on the web.
  • You can disable this feature by setting web_search: false in the knowledge_base settings.
  • Please share any feedback in the Discord discussion.

πŸͺ§ 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

@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)
.github/workflows/pnpm-version-patch.yaml (1)

24-27: Version Patch Step Added
The new step (id: patch) captures the output from pnpm version patch --no-git-tag-version and exposes it via $GITHUB_OUTPUT. This is a smart way to propagate the version information. One suggestion: instead of using git add ., consider staging only the necessary files (e.g., package.json and pnpm-lock.yaml) to avoid unintended changes.

πŸ“œ Review details

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

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 24c6432 and 58f3349.

β›” Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
πŸ“’ Files selected for processing (8)
  • .github/authorized_keys (0 hunks)
  • .github/workflows/github-pages.yaml (1 hunks)
  • .github/workflows/node.js.yaml (2 hunks)
  • .github/workflows/pnpm-publish.yaml (2 hunks)
  • .github/workflows/pnpm-version-patch.yaml (1 hunks)
  • README.md (1 hunks)
  • package.json (2 hunks)
  • tsconfig.json (1 hunks)
πŸ’€ Files with no reviewable changes (1)
  • .github/authorized_keys
πŸ”‡ Additional comments (14)
.github/workflows/github-pages.yaml (1)

18-19: Node.js Version Upgrade Confirmed
The actions/setup-node step now specifies node-version: 23, which aligns with the other workflow updates and ensures consistency across the CI processes.

.github/workflows/pnpm-version-patch.yaml (4)

15-15: Checkout Reference Updated
The checkout step now explicitly uses ref: ${{ github.ref }}, ensuring that the workflow checks out the correct branch or tag. This improves reproducibility of the version patching process.


22-22: Node.js Version Update
The update to node-version: 23 in this workflow is consistent with the other changes. Please double-check that all dependencies are compatible with Node.js 23.


29-33: Commit Step Validation
The commit step uses the qoomon action to create a commit with the version number. Ensure that this action fits your security and stability requirements. Otherwise, the implementation looks good.


34-40: Release Creation Step
The release creation step now pushes changes and uses the GitHub CLI to create a release with the appropriate commit target and version title. Please verify that the environment variables (COMMIT and VERSION) are correctly set and that your release process works as intended.

.github/workflows/pnpm-publish.yaml (2)

25-25: Node.js Version Update in Publish Workflow
The update to node-version: 23 in the publishing workflow aligns with the overall upgrade. This consistency should help avoid discrepancies between different CI jobs.


46-46: Release Upload Step
The final step uses gh release upload to attach the packaged tarball. Please confirm that the glob pattern coderabbitai-openai-chat-tokens-*.tgz accurately matches the generated package file, and that the GitHub CLI is appropriately configured in your environment.

package.json (2)

23-24: Test Script Adjustments
The changes in the scripts section now execute tests via "vitest run" for the default test command, and "vitest" for watch mode. These modifications are clear; ensure that they function as expected both in CI and during local development.


33-33: TypeScript Version Upgrade to Beta
Upgrading TypeScript from "5.7.3" to "5.8.0-beta" introduces access to new language features; however, it is a beta version. It is advisable to thoroughly test your codebase with the new version to catch any unforeseen compatibility issues.

tsconfig.json (1)

36-36: New Compiler Option: erasableSyntaxOnly
The addition of "erasableSyntaxOnly": true under the Interop Constraints section is a notable change. This option should help remove certain syntax constructs during compilation. Please confirm that this alteration produces the desired output and does not adversely affect debugging or runtime behaviour.

.github/workflows/node.js.yaml (3)

3-12: Review Trigger Events Configuration

The workflow now triggers on a new merge_group event as well as on pull_request and push events targeting the main branch. Please verify that the custom merge_group trigger is supported as intended within your GitHub Actions setup.


24-27: Node.js Version Update and pnpm Install Options

The Node.js version has been updated to 23 and the pnpm install command now includes the --strict-peer-dependencies flag. This improves dependency resolution consistency. Ensure that these changes do not conflict with any downstream tooling or scripts.


32-90: New 'fix' Job for Automated Corrections

A new fix job has been added to automatically address lockfile issues, code formatting, and lint fixes. The job is structured with clear steps and commit actions. A few points to note:

  • The job's conditional (if: failure() && github.event_name != 'merge_group' && github.actor != 'github-actions[bot]' && github.actor != 'nektos/act') ensures it runs only under specific failure conditions. Please double-check that using failure() at the job level (without explicit dependencies on prior jobs) meets your intended logic.
  • Make sure that the commit actions using qoomon/actions--create-commit@v1 align with your version control policies.
README.md (1)

17-19: Update Import Path for Namespace Alignment

The import path for promptTokensEstimate has been updated to use the scoped package @coderabbitai/openai-chat-tokens, ensuring consistency with the new package structure. This change aligns the documentation with the current distribution strategy.

@NatoBoram NatoBoram merged commit 3efccff into main Feb 5, 2025
3 checks passed
@NatoBoram NatoBoram deleted the feature/ts-8-beta branch February 5, 2025 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant