feat : static analysis for GO and JS #155
Merged
khareyash05 merged 2 commits intokeploy:dev-review-setupfrom Jun 27, 2025
Merged
feat : static analysis for GO and JS #155khareyash05 merged 2 commits intokeploy:dev-review-setupfrom
khareyash05 merged 2 commits intokeploy:dev-review-setupfrom
Conversation
|
Keploy failed to create test cases for this PR. For retrying, please click here |
khareyash05
approved these changes
Jun 27, 2025
This was referenced Jun 27, 2025
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(ci): Optimize Static Analysis Workflow for Monorepo
This pull request overhauls our static analysis CI workflow (
go-static-analysis.yml) with a dynamic, path-aware matrix, improving performance, cost-efficiency, and maintainability in a large monorepo environment.Summary of Improvements
dorny/paths-filter.go.mod,package.json, andeslint.config.mjsif missing.Example Code
🧪 Real-world Verification
Below are tested examples confirming correct behavior for both error and error-free cases, even for nested subdirectories.
Automatic Setup Details
go mod init,go mod tidypackage.json,eslint.config.mjs📈 Optimized for Large Monorepos
Benefits:
🧰 Tech Used
dorny/paths-filter: For diff-based folder detection.goandjstool setup.flowchart TD %% === Trigger === START([🚀 Pull Request Trigger]) --> TRIGGER{📋 Check Conditions} TRIGGER -->|✅ Matched| CONCURRENCY[🔒 Concurrency Control] TRIGGER -->|❌ Skipped| SKIP([🚫 Exit Workflow]) %% === Filter Changed Paths === CONCURRENCY --> FILTER[🔍 Run dorny/paths-filter] FILTER --> MATRIX{🔧 Build Matrix from Changed Paths} MATRIX -->|Go| GO_MATRIX[📁 Changed Go Dirs] MATRIX -->|JS| JS_MATRIX[📁 Changed JS Dirs] MATRIX -->|None| END_NO_CHANGES([✅ No Changes Found]) %% === Go Linting === GO_MATRIX --> GO_JOB{🐹 Run Go Lint?} GO_JOB -->|Yes| GO_LINT[🔍 GolangCI-Lint via Reviewdog] GO_JOB -->|No| SKIP_GO([⏭️ Skip Go]) %% === JS Linting === JS_MATRIX --> JS_JOB{🟨 Run JS Lint?} JS_JOB -->|Yes| JS_LINT[🔍 ESLint via Reviewdog] JS_JOB -->|No| SKIP_JS([⏭️ Skip JS]) %% === Results === GO_LINT --> RESULTS JS_LINT --> RESULTS SKIP_GO --> RESULTS SKIP_JS --> RESULTS END_NO_CHANGES --> RESULTS RESULTS -->|✅ All Passed| SUCCESS([🎉 Workflow Success]) RESULTS -->|❌ Issues Found| FAILURE([🔴 Fix Issues]) %% === Styling with Better Contrast === classDef startEnd fill:#e3f2fd,stroke:#1976d2,stroke-width:3px,color:#000000 classDef decision fill:#fff3e0,stroke:#f57c00,stroke-width:2px,color:#000000 classDef linting fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px,color:#000000 classDef skip fill:#f5f5f5,stroke:#616161,stroke-width:2px,color:#424242 classDef result fill:#e8f5e8,stroke:#2e7d32,stroke-width:3px,color:#000000 classDef error fill:#ffebee,stroke:#c62828,stroke-width:3px,color:#000000 class START,SKIP startEnd class TRIGGER,MATRIX,GO_JOB,JS_JOB decision class CONCURRENCY,FILTER,GO_LINT,JS_LINT linting class SKIP_GO,SKIP_JS,END_NO_CHANGES skip class RESULTS,SUCCESS result class FAILURE error