feat: add linting jobs for JavaScript and CSS/SCSS in CI configuration#14
feat: add linting jobs for JavaScript and CSS/SCSS in CI configuration#14konradmichalik merged 3 commits intomainfrom
Conversation
|
Warning Rate limit exceeded@jackd248 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 7 minutes and 49 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (3)
WalkthroughTwo new CI linting jobs for JavaScript/TypeScript and CSS/SCSS were added via dedicated YAML templates and included in the main CI configuration. The README was updated to document these new templates and to correct cache warmup YAML paths. No changes were made to exported or public entities in code. Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer
participant GitLabCI as GitLab CI
participant NodeBuild as build:node job
participant JSJob as analyze:js:lint
participant StyleJob as analyze:style:lint
Dev->>GitLabCI: Push/trigger pipeline
GitLabCI->>NodeBuild: Run build:node
NodeBuild-->>GitLabCI: build:node complete
GitLabCI->>JSJob: Run if .js/.ts changed (and rules met)
GitLabCI->>StyleJob: Run if .scss changed (and rules met)
JSJob-->>GitLabCI: JS lint results
StyleJob-->>GitLabCI: Style lint results
Estimated code review effort🎯 2 (Simple) | ⏱️ ~7 minutes Poem
✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 5
🧹 Nitpick comments (1)
.gitlab-ci.yml.dist (1)
10-15: Doc / config drift: README uses.yaml,.gitlab-ci.yml.distmixes.yaml&.ymlNew includes use
.yamlextension, while existing ones still reference.yml.
Pick one convention to avoid broken links on future renames and keep the list alphabetically sorted for easier diffing.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
.gitlab-ci.yml.dist(1 hunks)README.md(2 hunks)analyze/analyze-js-lint.yaml(1 hunks)analyze/analyze-style-lint.yaml(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: yamllint
| analyze:js:lint: | ||
| image: | ||
| name: ${DEFAULT_IMAGE_BUILD_NODE} | ||
| stage: analyze | ||
| needs: | ||
| - build:node | ||
| script: | ||
| - npm run lint:js |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Missing dependency/artifact handshake with build:node job
The job declares
needs:
- build:nodebut does not declare dependencies: or an artifacts:/cache: section to actually re-use the node_modules artefact that build:node presumably produces.
Without it the job will install its own modules (or—worse—fail when the directory is absent), losing the caching benefit and doubling pipeline time.
analyze:js:lint:
...
needs:
- build:node
+ dependencies:
+ - build:node # reuse artefacts
+ artifacts:
+ reports: { } # keep default
+ paths:
+ - node_modules/ # adjust to your build:node paths🤖 Prompt for AI Agents
In analyze/analyze-js-lint.yaml around lines 7 to 14, the job declares a
dependency on build:node using needs but does not specify dependencies or
artifacts to reuse the node_modules produced by build:node. To fix this, add a
dependencies or artifacts section to explicitly fetch the node_modules artifact
from build:node, ensuring the lint job reuses the installed modules and benefits
from caching, preventing redundant installations and reducing pipeline time.
analyze/analyze-js-lint.yaml
Outdated
| rules: | ||
| - if: $CI_PIPELINE_SOURCE == "web" | ||
| when: always | ||
| - if: $CI_COMMIT_TAG || $CI_PIPELINE_SOURCE == "schedule" || $CI_PIPELINE_SOURCE == "pipeline" || $CI_PIPELINE_SOURCE == "merge_request_event" | ||
| when: never | ||
| - if: $CI_COMMIT_TAG == null | ||
| changes: | ||
| - "**/*.js" | ||
| - "**/*.ts" |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Change-trigger glob is too narrow & rules ordering may disable MR feedback
- Only
**/*.js&**/*.tsare watched – real-world repos often contain
.jsx,.tsx,.mjs,.cjs, or config files (*.eslintrc, etc.). - The earlier rule sets
when: neverformerge_request_event; developers lose lint feedback before merging.
Consider:
- - if: $CI_COMMIT_TAG || $CI_PIPELINE_SOURCE == "schedule" || $CI_PIPELINE_SOURCE == "pipeline" || $CI_PIPELINE_SOURCE == "merge_request_event"
+ - if: $CI_COMMIT_TAG || $CI_PIPELINE_SOURCE == "schedule" || $CI_PIPELINE_SOURCE == "pipeline"
when: neverand broaden the glob:
- - "**/*.js"
- - "**/*.ts"
+ - "**/*.{js,jsx,mjs,cjs,ts,tsx}"
+ - ".eslintrc*"📝 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.
| rules: | |
| - if: $CI_PIPELINE_SOURCE == "web" | |
| when: always | |
| - if: $CI_COMMIT_TAG || $CI_PIPELINE_SOURCE == "schedule" || $CI_PIPELINE_SOURCE == "pipeline" || $CI_PIPELINE_SOURCE == "merge_request_event" | |
| when: never | |
| - if: $CI_COMMIT_TAG == null | |
| changes: | |
| - "**/*.js" | |
| - "**/*.ts" | |
| rules: | |
| - if: $CI_PIPELINE_SOURCE == "web" | |
| when: always | |
| - if: $CI_COMMIT_TAG || $CI_PIPELINE_SOURCE == "schedule" || $CI_PIPELINE_SOURCE == "pipeline" | |
| when: never | |
| - if: $CI_COMMIT_TAG == null | |
| changes: | |
| - "**/*.{js,jsx,mjs,cjs,ts,tsx}" | |
| - ".eslintrc*" |
🤖 Prompt for AI Agents
In analyze/analyze-js-lint.yaml around lines 15 to 23, the file change trigger
globs only watch for .js and .ts files, missing other relevant extensions like
.jsx, .tsx, .mjs, .cjs, and config files such as .eslintrc. Also, the rule
ordering disables lint feedback on merge_request_event by setting when: never
too early. To fix this, broaden the file globs to include these additional
extensions and reorder or adjust the rules so that lint feedback is enabled
during merge_request_event pipelines.
| analyze:style:lint: | ||
| image: | ||
| name: ${DEFAULT_IMAGE_BUILD_NODE} | ||
| stage: analyze | ||
| needs: | ||
| - build:node | ||
| script: | ||
| - npm run lint:style |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Same artefact-reuse gap as JS lint job
Add dependencies: / artifacts: to reuse node_modules from build:node, mirroring the suggestion for the JS lint job.
🤖 Prompt for AI Agents
In analyze/analyze-style-lint.yaml around lines 7 to 14, the job is missing the
dependencies and artifacts configuration to reuse node_modules from the
build:node job. Add a dependencies section listing build:node and an artifacts
section specifying the path to node_modules to enable artifact reuse, similar to
the JS lint job setup.
| Includes: | ||
| - `test/cache-feature-warmup.yaml` | ||
| - `test/cache-prod-warmup.yaml` | ||
| - `cache/cache-feature-warmup.yaml` | ||
| - `cache/cache-prod-warmup.yaml` | ||
|
|
There was a problem hiding this comment.
README and CI config out of sync for cache warm-up templates
README lists
- cache/cache-feature-warmup.yaml
- cache/cache-prod-warmup.yaml
but .gitlab-ci.yml.dist still includes
test/cache-feature-warmup.yaml
test/cache-prod-warmup.yaml
Either the path change is incomplete or the docs are wrong – one of them must be updated to avoid broken includes and user confusion.
🤖 Prompt for AI Agents
In README.md around lines 110 to 113, the listed cache warm-up template paths do
not match those in the .gitlab-ci.yml.dist file, causing inconsistency. Verify
the correct paths for the cache warm-up templates and update either the README
or the .gitlab-ci.yml.dist file so both reference the same, correct file paths
to prevent broken includes and confusion.
Summary by CodeRabbit
New Features
Documentation