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

chore: Fix and update CI #194

Merged
merged 2 commits into from
Jan 31, 2025
Merged

chore: Fix and update CI #194

merged 2 commits into from
Jan 31, 2025

Conversation

Fryuni
Copy link
Owner

@Fryuni Fryuni commented Jan 31, 2025

Summary by CodeRabbit

  • Chores

    • Updated GitHub Actions workflows to use newer versions of Node.js (version 22)
    • Updated PNPM and Node.js action versions across multiple workflow files
    • Upgraded action versions from v2/v4 to v4/v4.2.0
  • New Features

    • Added new Astro test fixture for hybrid output configuration
    • Introduced new API routes for testing different rendering scenarios
  • Documentation

    • Updated configuration files to reflect new testing approaches

@Fryuni Fryuni self-assigned this Jan 31, 2025
Copy link

vercel bot commented Jan 31, 2025

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

Name Status Preview Updated (UTC)
inox-tools ✅ Ready (Inspect) Visit Preview Jan 31, 2025 1:00pm

Copy link

coderabbitai bot commented Jan 31, 2025

Walkthrough

This pull request introduces comprehensive updates to GitHub Actions workflows across multiple files in the .github/workflows directory. The changes primarily focus on upgrading action versions, specifically updating pnpm/action-setup from v2 to v4 and actions/setup-node from v4 to v4.2.0. Additionally, the Node.js version is consistently updated from 18 or 20 to 22 across different workflow files. The modifications also include a new test fixture for the Astro When package, adding configuration and API route files to support hybrid output testing.

Changes

File Change Summary
.github/workflows/ci.yml Updated PNPM and Node.js action versions, changed Node version from 20 to 22
.github/workflows/example-deploys.yml Updated PNPM action to v4, changed Node version from 20 to 22
.github/workflows/preview-mode.yml Updated PNPM and Node.js action versions, changed Node version from 18 to 22
.github/workflows/release.yml Updated PNPM and Node.js action versions, changed Node version from 18 to 22
.github/workflows/snapshot-release.yml Updated PNPM and Node.js action versions
packages/astro-when/tests/fixture/hybrid-output/* Added new test fixture files for Astro hybrid output testing

Suggested labels

workspace

Suggested reviewers

  • BryceRussell
  • florian-lefebvre
  • OliverSpeir

Possibly related PRs

Poem

🐰 Workflows dancing, versions bright,
CI pipelines taking flight!
From v2 to v4 we leap,
Node version 22, no time to sleep
Automation's rabbit hops with glee! 🚀


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 9ed2ba0 and c542b10.

📒 Files selected for processing (1)
  • .github/workflows/example-deploys.yml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/example-deploys.yml

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.

Repository owner deleted a comment from github-actions bot Jan 31, 2025
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 (2)
packages/astro-when/tests/fixture/hybrid-output/src/pages/default.ts (1)

4-6: Consider type safety for the Response body.

The implementation is clean and follows Astro's API route conventions. However, consider explicitly typing the Response body for better type safety.

 export const GET: APIRoute = () => {
-	return new Response(whenAmI);
+	return new Response(String(whenAmI));
 };
packages/astro-when/tests/fixture/hybrid-output/src/pages/prerendered.ts (1)

6-8: Consider adding error handling.

The endpoint directly returns whenAmI without any error handling. Consider wrapping the response in a try-catch block to handle potential errors gracefully.

 export const GET: APIRoute = () => {
-	return new Response(whenAmI);
+	try {
+		return new Response(whenAmI);
+	} catch (error) {
+		return new Response('Error: Unable to determine when', { status: 500 });
+	}
 };
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 03246b2 and 9ed2ba0.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (12)
  • .github/workflows/ci.yml (8 hunks)
  • .github/workflows/example-deploys.yml (1 hunks)
  • .github/workflows/preview-mode.yml (1 hunks)
  • .github/workflows/release.yml (1 hunks)
  • .github/workflows/snapshot-release.yml (1 hunks)
  • packages/astro-when/tests/fixture/hybrid-output/astro.config.ts (1 hunks)
  • packages/astro-when/tests/fixture/hybrid-output/package.json (1 hunks)
  • packages/astro-when/tests/fixture/hybrid-output/src/pages/default.ts (1 hunks)
  • packages/astro-when/tests/fixture/hybrid-output/src/pages/on-demand.ts (1 hunks)
  • packages/astro-when/tests/fixture/hybrid-output/src/pages/prerendered.ts (1 hunks)
  • packages/astro-when/tests/hybrid-output.test.ts (1 hunks)
  • packages/astro-when/tests/server-output.test.ts (0 hunks)
💤 Files with no reviewable changes (1)
  • packages/astro-when/tests/server-output.test.ts
✅ Files skipped from review due to trivial changes (1)
  • packages/astro-when/tests/fixture/hybrid-output/package.json
⏰ Context from checks skipped due to timeout of 120000ms (1)
  • GitHub Check: E2E test
🔇 Additional comments (16)
packages/astro-when/tests/fixture/hybrid-output/src/pages/default.ts (1)

1-2: LGTM! Clean imports with proper type definitions.

The imports are well-structured, importing both the required function and type definition.

packages/astro-when/tests/fixture/hybrid-output/src/pages/on-demand.ts (3)

1-2: LGTM!

The imports are correctly defined and include all necessary dependencies for the API route implementation.


4-4: LGTM!

The prerender configuration is correctly set to false, which aligns with the purpose of testing on-demand rendering in this hybrid output test fixture.


6-8: LGTM!

The API route implementation is concise and appropriate for a test fixture, correctly returning the whenAmI value in a Response object.

packages/astro-when/tests/fixture/hybrid-output/astro.config.ts (1)

1-7: LGTM! Clean and minimal configuration.

The configuration correctly sets up server-side rendering with the astroWhen integration.

packages/astro-when/tests/fixture/hybrid-output/src/pages/prerendered.ts (1)

1-4: LGTM! Clean imports and prerender configuration.

The imports and prerender flag are correctly set up for a static API route.

packages/astro-when/tests/hybrid-output.test.ts (1)

6-6: LGTM!

The fixture path has been updated to match the new test fixture location. The test cases remain comprehensive and well-structured.

.github/workflows/preview-mode.yml (1)

30-36: LGTM! CI dependencies have been updated to their latest stable versions.

The updates align with the PR objective and follow best practices:

  • pnpm/action-setup@v4: Latest stable version
  • actions/[email protected]: Latest stable version
  • Node.js 22: Current Active LTS version
.github/workflows/release.yml (1)

41-47: LGTM! CI dependencies have been updated to their latest stable versions.

The updates align with the PR objective and follow best practices:

  • pnpm/action-setup@v4: Latest stable version
  • actions/[email protected]: Latest stable version
  • Node.js 22: Current Active LTS version
.github/workflows/ci.yml (6)

11-12: LGTM!

The change from double quotes to single quotes in path ignore patterns is a valid syntactical improvement.


33-33: LGTM!

The changes improve job identification and caching while updating the pnpm action version.

Also applies to: 58-58, 64-64


101-101: LGTM!

The changes improve job identification while updating the action versions.

Also applies to: 124-124, 127-127, 130-130


161-161: LGTM!

The action version updates are consistent with the PR objectives.

Also applies to: 164-164, 167-167


186-186: LGTM!

The action version updates and Node.js version update are consistent with the PR objectives.

Also applies to: 188-192


85-85: Verify Node.js compatibility.

The Node.js version has been updated to 22. Please ensure all dependencies and tools are compatible with Node.js 22.

Run the following script to check for potential compatibility issues:

Also applies to: 88-88, 90-91

✅ Verification successful

Node.js 22 compatibility verified

All dependencies and build tools are compatible with Node.js 22. No version constraints were found that would prevent the upgrade.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check package.json files for Node.js version requirements.

# Test: Search for engine requirements in package.json files
echo "Checking Node.js version requirements in package.json files..."
fd 'package.json' --type f --exec jq -r '.engines.node // empty'

# Test: Search for potential Node.js version specific syntax
echo "Checking for potential Node.js version specific syntax..."
rg -l 'node:|engines:|engineStrict:|volta' package.json

Length of output: 496


Script:

#!/bin/bash
# Description: Improved package.json analysis for Node.js compatibility

echo "=== Checking package.json contents ==="
fd 'package.json' --type f --exec cat {}

echo -e "\n=== Searching for Node.js version requirements ==="
rg -A 5 '"engines":|"node":' --type json

echo -e "\n=== Checking for potential compatibility issues in dependencies ==="
rg '"dependencies"|"devDependencies"|"peerDependencies"' -A 10 --type json

Length of output: 65903

.github/workflows/snapshot-release.yml (1)

68-68: Verify Node.js compatibility with snapshot release process.

The Node.js version has been updated to 22. Please ensure the snapshot release process, including changeset and npm publishing, is compatible with Node.js 22.

Run the following script to check for potential compatibility issues:

Also applies to: 71-71, 73-73

✅ Verification successful

Node.js 22 update appears safe for snapshot release process

The verification shows no compatibility concerns:

  • @changesets/cli v2.27.12 has no Node.js version restrictions
  • No explicit Node.js version constraints found in package.json
  • Node.js 22 maintains backward compatibility as an LTS release
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check compatibility of release tools with Node.js 22.

# Test: Check changeset version and compatibility
echo "Checking changeset version and compatibility..."
rg -A 5 '@changesets/cli' package.json

# Test: Check npm publishing requirements
echo "Checking npm publishing requirements..."
rg -l 'publishConfig|private:|"registry":' package.json

Length of output: 471


Script:

#!/bin/bash
# Check @changesets/cli package details and Node.js requirements
echo "Checking @changesets/cli package details..."
curl -s https://registry.npmjs.org/@changesets/cli/latest | jq -r '.engines.node, .version'

# Check if there are any explicit Node.js version requirements in package.json
echo -e "\nChecking package.json Node.js requirements..."
rg '"node":' package.json

Length of output: 338

@Fryuni Fryuni merged commit 947cb4f into main Jan 31, 2025
19 checks passed
@Fryuni Fryuni deleted the fix/races branch January 31, 2025 13:18
@coderabbitai coderabbitai bot mentioned this pull request Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant