Skip to content

ci(lint): add new lint job for 'attw' and update dependencies #889

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

prisis
Copy link
Member

@prisis prisis commented May 26, 2025

  • Introduced a new linting job for 'attw' in the GitHub Actions workflow.
  • Enhanced the linting process by adding steps for checking out the repository, deriving SHAs, and setting up the environment.
  • Updated the 'test-required-check' job to include the new 'attw' lint job as a dependency.

Summary by CodeRabbit

  • Chores
    • Added a new linting job to the workflow for improved code checks.
    • Updated workflow dependencies to ensure all linting jobs complete before marking checks as successful.
    • Updated documentation and linting rules to refine file type naming and matching for TypeScript declaration files.

- Introduced a new linting job for 'attw' in the GitHub Actions workflow.
- Enhanced the linting process by adding steps for checking out the repository, deriving SHAs, and setting up the environment.
- Updated the 'test-required-check' job to include the new 'attw' lint job as a dependency.
Copy link

coderabbitai bot commented May 26, 2025

Walkthrough

A new attw job was introduced to the GitHub Actions lint workflow, running conditionally based on frontend changes. The test-required-check job was updated to depend on the completion of this new job, ensuring it is included in the linting process. The ESLint configuration renamed the "d.ts" file type identifier to "types" in type declarations, glob patterns, and related rules. No other workflow jobs or steps were modified.

Changes

File Change Summary
.github/workflows/lint.yml Added new attw job for conditional frontend linting; updated test-required-check dependencies to include attw.
packages/eslint-config/README.md Renamed "d.ts" file type string to "types" in documentation for getFilesGlobs function.
packages/eslint-config/src/config/plugins/imports.ts Changed ESLint config file matching from getFilesGlobs("d.ts") to getFilesGlobs("types").
packages/eslint-config/src/utils/create-config.ts Replaced "d.ts" with "types" in FileType alias and updated getFilesGlobs to handle "types" case.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant GitHub Actions
    participant files-changed
    participant attw
    participant eslint/yaml-lint/package-json-lint
    participant test-required-check

    Developer->>GitHub Actions: Push/PR triggers workflow
    GitHub Actions->>files-changed: Determine changed files
    files-changed-->>attw: If frontend_lintable == true
    attw->>GitHub Actions: Run frontend lint steps
    GitHub Actions->>eslint/yaml-lint/package-json-lint: Run other lint jobs
    attw-->>test-required-check: Signal completion
    eslint/yaml-lint/package-json-lint-->>test-required-check: Signal completion
    test-required-check->>GitHub Actions: Complete if all dependencies finish
Loading

Poem

A new job hops into the flow,
"attw" checks the frontend, just so!
Types renamed with gentle care,
From "d.ts" to "types" fair—
Our linting dance now in a row.
🐇✨

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

packages/eslint-config/src/utils/create-config.ts

Oops! Something went wrong! :(

ESLint: 9.27.0

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/packages/eslint-config/dist/index.mjs' imported from /eslint.config.js
at finalizeResolution (node:internal/modules/esm/resolve:274:11)
at moduleResolve (node:internal/modules/esm/resolve:859:10)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:799:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:723:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:706:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:307:38)
at #link (node:internal/modules/esm/module_job:170:49)

packages/eslint-config/src/config/plugins/imports.ts

Oops! Something went wrong! :(

ESLint: 9.27.0

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/packages/eslint-config/dist/index.mjs' imported from /eslint.config.js
at finalizeResolution (node:internal/modules/esm/resolve:274:11)
at moduleResolve (node:internal/modules/esm/resolve:859:10)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:799:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:723:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:706:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:307:38)
at #link (node:internal/modules/esm/module_job:170:49)


📜 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 af4d2b8 and cd3221f.

📒 Files selected for processing (3)
  • packages/eslint-config/README.md (1 hunks)
  • packages/eslint-config/src/config/plugins/imports.ts (1 hunks)
  • packages/eslint-config/src/utils/create-config.ts (2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
packages/eslint-config/src/config/plugins/imports.ts (1)
packages/eslint-config/src/utils/create-config.ts (1)
  • getFilesGlobs (14-104)
🪛 LanguageTool
packages/eslint-config/README.md

[uncategorized] ~623-~623: Loose punctuation mark.
Context: ...tro). - "css": CSS files. - "types": TypeScript declaration files (.d.ts`, ...

(UNLIKELY_OPENING_PUNCTUATION)

⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Test (node-20.14, windows-latest)
  • GitHub Check: Lint (markdown)
  • GitHub Check: Analyze (typescript)
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (4)
packages/eslint-config/src/utils/create-config.ts (2)

4-4: LGTM! Improved naming and formatting.

The consolidation of the FileType union into a single line improves readability, and renaming "d.ts" to "types" is more descriptive and semantically clear for TypeScript declaration files.


88-90: LGTM! Consistent with the FileType refactoring.

The new "types" case correctly returns the dtsGlobal array, maintaining the same functionality as the previous "d.ts" case while using the improved naming convention.

packages/eslint-config/README.md (1)

623-623: LGTM! Documentation updated to reflect code changes.

The documentation correctly reflects the renaming of the file type identifier from "d.ts" to "types", maintaining consistency with the code changes while preserving the same file extension coverage.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~623-~623: Loose punctuation mark.
Context: ...tro). - "css": CSS files. - "types": TypeScript declaration files (.d.ts`, ...

(UNLIKELY_OPENING_PUNCTUATION)

packages/eslint-config/src/config/plugins/imports.ts (1)

343-343: LGTM! Consistent usage of the refactored file type identifier.

The change from getFilesGlobs("d.ts") to getFilesGlobs("types") is consistent with the refactoring in the utility function and maintains the same functionality for TypeScript declaration files.

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this 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

github-actions bot commented May 26, 2025

Thank you for following the naming conventions! 🙏

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

🧹 Nitpick comments (2)
.github/workflows/lint.yml (2)

107-111: Inconsistent job naming.
The job is named Lint (are the types wrong), which deviates from the concise pattern used by other lint jobs (e.g., Lint (eslint)). Consider renaming it to Lint (attw) for consistency.


154-157: Guard cache preparation on success.
The cache compression step runs even if lint attw fails, which might waste resources. Consider adding if: ${{ success() }} to skip cache prep on failure.

-      shell: "bash"
-      run: "tar -cf - .nx/cache | lz4 > /tmp/nx_cache.tar.lz4"
+      if: ${{ success() }}
+      shell: "bash"
+      run: "tar -cf - .nx/cache | lz4 > /tmp/nx_cache.tar.lz4"
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between b8f5a94 and af4d2b8.

📒 Files selected for processing (1)
  • .github/workflows/lint.yml (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Analyze (javascript)
  • GitHub Check: Analyze (typescript)
🔇 Additional comments (1)
.github/workflows/lint.yml (1)

357-360: Review test-required-check dependencies.
attw has been added to needs, which is correct. However, there's still a TODO to include markdown-lint. Please confirm whether markdown-lint should be included now or if it will be addressed in a follow-up.

Comment on lines +140 to +147
- name: "Get changed files"
id: "files"
uses: "tj-actions/changed-files@c65cd883420fd2eb864698a825fc4162dd94482c" # v44.5.7
with:
files_ignore_from_source_file: ".github/ignore-files-for-nx-affected.yml"
base_sha: "${{ steps.setSHAs.outputs.base }}"
separator: ","

Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Use the same changed-files action version.
The tj-actions/changed-files action here is pinned to v44.5.7, whereas eslint uses v46.0.5. Consistency across jobs reduces maintenance burden and ensures uniform behavior.

- uses: "tj-actions/changed-files@c65cd883420fd2eb864698a825fc4162dd94482c" # v44.5.7
+ uses: "tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c" # v46.0.5
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: "Get changed files"
id: "files"
uses: "tj-actions/changed-files@c65cd883420fd2eb864698a825fc4162dd94482c" # v44.5.7
with:
files_ignore_from_source_file: ".github/ignore-files-for-nx-affected.yml"
base_sha: "${{ steps.setSHAs.outputs.base }}"
separator: ","
- name: "Get changed files"
id: "files"
- uses: "tj-actions/changed-files@c65cd883420fd2eb864698a825fc4162dd94482c" # v44.5.7
+ uses: "tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c" # v46.0.5
with:
files_ignore_from_source_file: ".github/ignore-files-for-nx-affected.yml"
base_sha: "${{ steps.setSHAs.outputs.base }}"
separator: ","
🤖 Prompt for AI Agents
In .github/workflows/lint.yml around lines 140 to 147, the
tj-actions/changed-files action is pinned to version v44.5.7, but eslint uses
v46.0.5. Update the version of tj-actions/changed-files here to v46.0.5 to
maintain consistency across jobs and reduce maintenance complexity.

Comment on lines +118 to +126
- name: "Git checkout ${{ env.HEAD_REPOSITORY }}:${{ env.HEAD_REF }}"
uses: "actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332" # v4.1.7
env:
GIT_COMMITTER_NAME: "GitHub Actions Shell"
GIT_AUTHOR_NAME: "GitHub Actions Shell"
EMAIL: "github-actions[bot]@users.noreply.github.com"
with:
# Number of commits to fetch. 0 indicates all history for all branches and tags.
# Pulls all commits (needed for NX)
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Align checkout action version with other jobs.
This job uses actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 (v4.1.7), while other lint jobs use actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 (v4.2.2). Unify the version to avoid discrepancies.

- uses: "actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332" # v4.1.7
+ uses: "actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683" # v4.2.2
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: "Git checkout ${{ env.HEAD_REPOSITORY }}:${{ env.HEAD_REF }}"
uses: "actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332" # v4.1.7
env:
GIT_COMMITTER_NAME: "GitHub Actions Shell"
GIT_AUTHOR_NAME: "GitHub Actions Shell"
EMAIL: "github-actions[bot]@users.noreply.github.com"
with:
# Number of commits to fetch. 0 indicates all history for all branches and tags.
# Pulls all commits (needed for NX)
- name: "Git checkout ${{ env.HEAD_REPOSITORY }}:${{ env.HEAD_REF }}"
uses: "actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683" # v4.2.2
env:
GIT_COMMITTER_NAME: "GitHub Actions Shell"
GIT_AUTHOR_NAME: "GitHub Actions Shell"
EMAIL: "github-actions[bot]@users.noreply.github.com"
with:
# Number of commits to fetch. 0 indicates all history for all branches and tags.
# Pulls all commits (needed for NX)
🤖 Prompt for AI Agents
In .github/workflows/lint.yml around lines 118 to 126, the checkout action
version is set to actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
(v4.1.7), which differs from other lint jobs using
actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 (v4.2.2). Update the
checkout action version here to match the other jobs by replacing the current
version with actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683.

…s" to "types"

- Changed the file type identifier for TypeScript declaration files in the ESLint configuration from "d.ts" to "types" for consistency.
- Updated the `getFilesGlobs` function to reflect this change, ensuring proper handling of TypeScript declaration files.
- Modified related documentation in README.md to align with the new file type naming.
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