-
Notifications
You must be signed in to change notification settings - Fork 17
ci: New Go workfow for linting, testing and building the Capture #61
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
Conversation
Signed-off-by: Mert Şişmanoğlu <[email protected]>
Warning Rate limit exceeded@mertssmnoglu has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 19 minutes and 54 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 (1)
WalkthroughA new GitHub Actions workflow file, Changes
Sequence Diagram(s)sequenceDiagram
participant GitHub PR
participant go.yml Workflow
participant Lint Job
participant Test Job
GitHub PR->>go.yml Workflow: PR opened/updated (main/develop)
go.yml Workflow->>Lint Job: Start lint job
Lint Job->>Lint Job: Checkout code\nRun golangci-lint
go.yml Workflow->>Test Job: Start test job
Test Job->>Test Job: Checkout code\nSetup Go\nRun go test
Poem
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:
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 (
|
Signed-off-by: Mert Şişmanoğlu <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
.github/workflows/go.yml (2)
10-20
: Consider caching dependencies in lint job
To improve CI performance, you can cache Go modules (and golangci-lint’s cache) between runs. This is an optional enhancement but often yields significant speed-ups.Proposed diff:
lint: runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 0 + - name: Cache Go modules for lint + uses: actions/cache@v3 + with: + path: | + ~/.cache/go-build + ~/go/pkg/mod + key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go-mod- - name: Golangci-lint uses: golangci/[email protected]
21-32
: Verify test scope and consider caching
Currently the test step runs only againstg.yxqyang.asia/bluewave-labs/capture/test
. If you intended to run all packages’ tests, switch togo test ./...
. You may also cache Go modules in the test job to speed up runs.Example diff:
test: runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 0 - uses: actions/setup-go@v5 with: go-version-file: 'go.mod' + - name: Cache Go modules + uses: actions/cache@v3 + with: + path: | + ~/.cache/go-build + ~/go/pkg/mod + key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go-mod- - run: | - go test -v -timeout 30s github.com/bluewave-labs/capture/test + go test -v -timeout 30s ./...
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/go.yml
(1 hunks).github/workflows/lint.yml
(0 hunks)
💤 Files with no reviewable changes (1)
- .github/workflows/lint.yml
🔇 Additional comments (2)
.github/workflows/go.yml (2)
1-2
: Workflow naming is clear
No concerns with naming the workflow “go” as it succinctly reflects its purpose.
3-8
: Triggers correctly configured for PR validation
The workflow will run on pull requests targeting bothmain
anddevelop
branches, which aligns with the repository’s branching strategy.
- github.com/mstrYoda/go-arctest/pkg/arctest Signed-off-by: Mert Şişmanoğlu <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
test/arch_test.go (2)
26-35
: LGTM, with a suggestion for future expansionThe validation logic looks good. As the codebase grows, consider extending this test to include additional architectural rules.
In the future, you might want to structure this to make adding new rules easier, perhaps by creating a slice of rules at the beginning of the test function and appending to it, rather than having to modify the ValidateDependenciesWithRules call each time.
1-36
: Consider adding documentation about the architectural patternThe test effectively enforces architectural boundaries, but it would be helpful to include more context about the overall architectural pattern being enforced.
Consider adding a comment at the top of the file explaining the high-level architectural approach of the project and why these specific boundaries are important. This would be valuable documentation for new contributors.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
go.sum
is excluded by!**/*.sum
📒 Files selected for processing (2)
go.mod
(2 hunks)test/arch_test.go
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- go.mod
🔇 Additional comments (3)
test/arch_test.go (3)
1-8
: Good choice using the go-arctest library for architecture testing!The inclusion of architecture testing is a valuable addition to ensure the codebase maintains proper separation of concerns and dependency management. The go-arctest library is a good choice for this purpose.
9-19
: LGTM on initial setup and error handlingThe initialization of the architecture testing framework is well-structured with appropriate error handling for both the initial setup and package parsing steps.
20-24
: Good architectural boundary enforcementThis rule enforces a clean separation between the command layer and internal handlers, which is a sound architectural principle. This helps maintain a clear dependency direction and prevents circular dependencies.
Signed-off-by: Mert Şişmanoğlu <[email protected]>
Summary by CodeRabbit