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

(fix) GitHub Actions fixes from repo refactor #14723

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dylburger
Copy link
Contributor

@dylburger dylburger commented Nov 23, 2024

Summary by CodeRabbit

  • Documentation

    • Updated documentation for the Git diff on components action to clarify input requirements and build instructions.
  • New Features

    • Transitioned package management from npm to pnpm across various workflows for improved efficiency.
  • Bug Fixes

    • Enhanced spellcheck and lint jobs in the pull request checks workflow for better clarity and functionality.
  • Chores

    • Updated Node.js version from 14 to 18 in relevant workflows to ensure compatibility with newer features.

Revving Node version
Copy link

vercel bot commented Nov 23, 2024

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

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs-v2 ⬜️ Ignored (Inspect) Nov 23, 2024 10:42pm
pipedream-docs ⬜️ Ignored (Inspect) Nov 23, 2024 10:42pm
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) Nov 23, 2024 10:42pm

Copy link
Contributor

coderabbitai bot commented Nov 23, 2024

Walkthrough

The pull request includes updates to several GitHub Actions workflows and documentation for the git-diff-on-components action. Key changes involve transitioning from npm to pnpm as the preferred package manager, modifying build commands accordingly, and clarifying documentation regarding input requirements. Additionally, the Node.js version has been updated from 14 to 18 in specific workflows. The overall structure and logic of the workflows remain consistent, focusing on enhancing clarity and standardizing the build process.

Changes

File Path Change Summary
.github/actions/git-diff-on-components/README.md Updated documentation for input requirements and usage; changed installation command to pnpm.
.github/actions/git-diff-on-components/package.json Updated build script to use pnpm instead of npm.
.github/workflows/components-pr.yaml Updated build commands from npm to pnpm for TypeScript compilation; no structural changes.
.github/workflows/publish-components.yaml Updated Node.js version from 14 to 18; changed build command to pnpm.
.github/workflows/publish-packages.yaml Replaced npm with pnpm in build commands; adjusted caching conditions for non-master branches.
.github/workflows/publish-platform-package.yaml Changed build command from npm to pnpm; no other modifications.
.github/workflows/pull-request-checks.yaml Updated spellcheck and lint jobs; simplified Node version; added comments and refined linting steps.

Possibly related PRs

Suggested reviewers

  • GTFalcao

Poem

🐰 In the meadow where code does play,
We’ve shifted to pnpm today!
With clearer docs and builds that shine,
Our workflows now align just fine.
So hop along, let’s build with glee,
For every change brings harmony! 🌼


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 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: 2

🧹 Outside diff range and nitpick comments (8)
.github/workflows/publish-platform-package.yaml (1)

Line range hint 1-40: Consider enhancing build reliability and safety

While reviewing the workflow context, I noticed two potential improvements:

  1. Consider using --frozen-lockfile with pnpm install to ensure consistent builds:
-        run: pnpm install -r --no-frozen-lockfile
+        run: pnpm install -r --frozen-lockfile
  1. The --no-git-checks flag in the publish command bypasses important safety checks. Consider removing it unless absolutely necessary:
-        run: pnpm publish platform --no-git-checks
+        run: pnpm publish platform
.github/actions/git-diff-on-components/README.md (2)

18-24: Add language specifier to the code block

The code block should specify yaml as the language for proper syntax highlighting.

-```
+```yaml
 ...
 with:
   format: json

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 Markdownlint (0.35.0)</summary>

19-19: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

</details>

</details>

---

`42-45`: **Improve command block formatting**

The command block should follow markdown best practices:
1. Specify the language as `bash` or `shell`
2. Remove `$` signs from commands as per markdown guidelines

```diff
-```
-$ cd .github/actions/git-diff-on-components/
-$ pnpm i && pnpm run build
-```
+```bash
+cd .github/actions/git-diff-on-components/
+pnpm i && pnpm run build
+```
🧰 Tools
🪛 Markdownlint (0.35.0)

43-43: null
Dollar signs used before commands without showing output

(MD014, commands-show-output)


44-44: null
Dollar signs used before commands without showing output

(MD014, commands-show-output)


42-42: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

.github/workflows/publish-packages.yaml (1)

Line range hint 29-31: Update deprecated set-output command

The workflow uses the deprecated set-output command which will be removed in a future version of GitHub Actions.

Update the command to use the new syntax:

-          echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
+          echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT

Reference: GitHub Actions: Deprecating save-state and set-output commands

.github/workflows/pull-request-checks.yaml (2)

81-81: Consider pinning to a specific Node.js version

Using only the major version (18) could lead to unexpected behavior if minor versions introduce breaking changes. Consider pinning to a specific version (e.g., 18.18.0) for better reproducibility.

-          node-version: 18
+          node-version: 18.18.0

Line range hint 84-94: Optimize changed files retrieval

The workflow currently calls get-changed-files action twice with different formats. Consider consolidating into a single step and transforming the format as needed in the subsequent steps.

Example optimization:

-      - name: Get Changed Files (space-separated)
-        id: changed_files_space
-        uses: Ana06/[email protected]
-        with:
-          format: 'space-delimited'
-      - name: Lint changed files
-        run: pnpm exec eslint ${{ steps.changed_files_space.outputs.added_modified }} ${{ steps.changed_files_space.outputs.renamed }}
-      - name: Get Changed Files (comma-separated)
-        id: changed_files
+      - name: Get Changed Files
+        id: changed_files
         uses: Ana06/[email protected]
         with:
           format: 'csv'
+      - name: Lint changed files
+        run: pnpm exec eslint $(echo "${{ steps.changed_files.outputs.added_modified }},${{ steps.changed_files.outputs.renamed }}" | tr ',' ' ')
.github/workflows/components-pr.yaml (1)

Line range hint 1-1: Consider consolidating duplicate workflows.

The TODO comment at the top of the file suggests combining this with publish-components.yml. This would be a good follow-up task to reduce duplication and maintenance overhead.

Would you like me to help create a GitHub issue to track the workflow consolidation task?

.github/workflows/publish-components.yaml (1)

Line range hint 11-11: Consider pinning GitHub Actions to exact commit hashes.

For enhanced security, consider pinning the GitHub Actions to exact commit hashes instead of version tags:

This prevents potential supply chain attacks through compromised action versions.

Also applies to: 72-72, 139-139

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between bb5906c and 5bece16.

📒 Files selected for processing (7)
  • .github/actions/git-diff-on-components/README.md (2 hunks)
  • .github/actions/git-diff-on-components/package.json (1 hunks)
  • .github/workflows/components-pr.yaml (2 hunks)
  • .github/workflows/publish-components.yaml (3 hunks)
  • .github/workflows/publish-packages.yaml (1 hunks)
  • .github/workflows/publish-platform-package.yaml (1 hunks)
  • .github/workflows/pull-request-checks.yaml (2 hunks)
🧰 Additional context used
🪛 Markdownlint (0.35.0)
.github/actions/git-diff-on-components/README.md

19-19: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


43-43: null
Dollar signs used before commands without showing output

(MD014, commands-show-output)


44-44: null
Dollar signs used before commands without showing output

(MD014, commands-show-output)


42-42: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🔇 Additional comments (12)
.github/actions/git-diff-on-components/package.json (2)

8-8: LGTM! Verify pnpm availability in workflows

The change from npm to pnpm is consistent with the PR objectives. However, let's verify the setup in the workflows that use this action.

✅ Verification successful

LGTM! The pnpm setup is properly configured in workflows

The change from npm to pnpm in the git-diff-on-components action's build script is safe. The workflows that use this action have proper pnpm setup:

  • All relevant workflows include pnpm/[email protected] with version 9.14.2
  • They properly configure pnpm caching
  • Node.js setup is configured with pnpm cache
  • The workflows install dependencies using pnpm commands
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if workflows using this action have pnpm setup steps
rg -l "uses: .*/git-diff-on-components@" | xargs rg "pnpm|actions/setup-node"

Length of output: 3255


Script:

#!/bin/bash
# Let's check the workflow files specifically
fd "workflow" .github/workflows/ | xargs rg "pnpm|actions/setup-node|git-diff-on-components"

Length of output: 3268


Script:

#!/bin/bash
# Let's try a more specific search in the workflows directory
find .github/workflows -type f -exec cat {} \;

Length of output: 30113


8-8: Verify documentation updates for pnpm

Since we're changing the build system to pnpm, ensure that the action's documentation (README.md, contribution guidelines) reflects this change.

✅ Verification successful

Let me verify if there are any other documentation files or contribution guidelines that might need updating.


Let me correct the command to properly search for documentation files.


Let me check the content of the README.md file to verify if it needs updating regarding the build system.


Documentation is already up to date with pnpm

The README.md already includes the correct pnpm build instructions in the "Build" section:

$ cd .github/actions/git-diff-on-components/
$ pnpm i && pnpm run build

No updates are needed as the documentation accurately reflects the current build system using pnpm.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if documentation mentions npm vs pnpm
fd README.md .github/actions/git-diff-on-components | xargs rg -i "npm|pnpm"

Length of output: 105


Script:

#!/bin/bash
# Check for any documentation files and contribution guidelines
fd -e md .github/actions/git-diff-on-components

# Also check if there are any other files that might contain documentation
fd CONTRIBUTING DEVELOP DEVELOPMENT SETUP .github/actions/git-diff-on-components

Length of output: 754


Script:

#!/bin/bash
# Search for markdown files in the component directory
fd -e md . .github/actions/git-diff-on-components

# Also check for any setup or contribution related files
fd -i "contributing|develop|setup|readme" . .github/actions/git-diff-on-components

Length of output: 75890


Script:

#!/bin/bash
# Check the content of the README.md file
cat .github/actions/git-diff-on-components/README.md

Length of output: 1227

.github/workflows/publish-platform-package.yaml (1)

27-27: LGTM! Build command correctly updated to use pnpm

The change from npm to pnpm aligns with the workflow's setup and the broader repository refactor.

.github/actions/git-diff-on-components/README.md (1)

39-41: LGTM! Important note about dist files

Good addition of the note about pushing dist files. This is crucial information for action development and testing.

.github/workflows/publish-packages.yaml (1)

48-48: LGTM! Build command updated to use pnpm

The change from npm run build to pnpm run build is correct and consistent with the workflow's use of pnpm as the package manager.

.github/workflows/pull-request-checks.yaml (2)

53-60: Well-documented configuration for git history

The comments clearly explain why full history is needed for proper git diff functionality. This is the correct approach for accurately determining changed files.


62-63: Verify pnpm version

Let's verify if 9.14.2 is the latest stable version of pnpm.

✅ Verification successful

pnpm version is up to date

The installed pnpm version 9.14.2 matches the latest stable version from the npm registry.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check latest stable version of pnpm
curl -s https://registry.npmjs.org/pnpm/latest | jq '.version'

Length of output: 71

.github/workflows/components-pr.yaml (2)

76-76: LGTM! Build command updated for pnpm.

The change from npm to pnpm is consistent with the PR objectives to standardize package management.


165-165: LGTM! Build command updated for pnpm.

The change from npm to pnpm is consistent with the PR objectives to standardize package management.

.github/workflows/publish-components.yaml (3)

38-38: LGTM: Build command updated consistently with pnpm transition.

The change to pnpm run build aligns with the workflow's pnpm setup and caching configuration.


140-142: LGTM: Node.js version upgrade is consistent across jobs.

The upgrade to Node.js 18 maintains consistency with the publish-components job.


157-157: LGTM: Build command updated with proper output handling.

The change to pnpm run build with output redirection to files.txt maintains the workflow's TypeScript component processing functionality.

Let's verify the build script configuration:

✅ Verification successful

LGTM: Build output redirection is correctly used for TypeScript component publishing

The output redirection to files.txt is essential for the TypeScript component publishing workflow as it captures the compiled file paths which are later used to match and publish the corresponding TypeScript components. The workflow reads this file to identify which compiled .mjs files correspond to the changed .ts files, making the redirection a critical part of the publishing process.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if the build script is properly configured in package.json
fd package.json --exec jq -r 'select(.scripts != null) | select(.scripts.build != null) | .scripts.build'

Length of output: 242


Script:

#!/bin/bash
# Let's check the package.json files to understand which one corresponds to the TypeScript components
fd package.json --exec sh -c 'echo "=== $1 ==="; cat "$1" | jq -r "select(.name != null) | {name, scripts}"' sh {}

Length of output: 100123


Script:

#!/bin/bash
# Let's check the workflow file to understand the context of the build command
cat .github/workflows/publish-components.yaml

Length of output: 12439

$ pnpm i && pnpm run build
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Package manager inconsistency detected

The repository currently has mixed package manager configuration:

  • Both package-lock.json and pnpm-lock.yaml files are present
  • Multiple workflow files still use npm commands:
    • .github/workflows/publish-packages.yaml
    • .github/workflows/publish-platform-package.yaml
    • .github/workflows/publish-components.yaml
    • .github/workflows/components-pr.yaml
    • .github/workflows/pipedream-sdk-test.yaml
    • .github/workflows/publish-marketplace-content.yaml
    • .github/workflows/pull-request-checks.yaml
🔗 Analysis chain

Verify package manager transition

The change from npm to pnpm should be consistent across the repository.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify package manager configuration and lock files

# Check for remaining npm references in workflow files
echo "Checking for npm references in workflows:"
rg -l 'npm (install|ci|run|build)' .github/workflows/

# Check for package manager lock files
echo -e "\nChecking lock files:"
ls -la package-lock.json pnpm-lock.yaml 2>/dev/null

Length of output: 687

🧰 Tools
🪛 Markdownlint (0.35.0)

44-44: null
Dollar signs used before commands without showing output

(MD014, commands-show-output)

Comment on lines +34 to 36
node-version: 18
registry-url: https://registry.npmjs.org/
cache: 'pnpm'
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

⚠️ Node.js version inconsistency detected in workflows

The Node.js 18 upgrade is appropriate, but there's an inconsistency in the workflow files:

  • All workflows are using Node.js 18 except publish-marketplace-content.yaml which is still on Node.js 14
  • Package.json indicates >=18.0.0 as the Node.js requirement
🔗 Analysis chain

LGTM: Node.js version upgrade is necessary and well-timed.

The upgrade from Node.js 14 to 18 is essential as v14 has reached end-of-life. Node.js 18 is currently in Active LTS status, making it a stable choice.

Let's verify Node.js version compatibility across the codebase:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for any Node.js version constraints in package.json files
fd package.json --exec jq -r 'select(.engines != null) | .engines.node'

Length of output: 87


Script:

#!/bin/bash
# Let's check for any specific Node.js version references in the workflow files
rg "node-version:" .github/workflows/ -A 2

Length of output: 2101

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