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

chore: Add support for go1.23 and golangci-lint v1.60.1 #3101

Merged
merged 3 commits into from
Aug 14, 2024

Conversation

gaby
Copy link
Member

@gaby gaby commented Aug 14, 2024

Description

  • Bump minimum go version to 1.22
  • Bump golangci-lint to v1.60.1
    • Fix all issues exposed by golangci-lint
  • Add go1.23 to CI
  • Add msgp command to Makefile
  • Regenerate all msgp files with tests files.
  • I found the issue with the msgp files because of the following:
    • // go:generate msgp, this is broken
    • //go:generate msgp, this is correct

Type of change

  • Documentation update (changes to documentation)
  • Performance improvement (non-breaking change which improves efficiency)
  • Code consistency (non-breaking change which improves code reliability and robustness)

@gaby gaby requested a review from a team as a code owner August 14, 2024 02:52
@gaby gaby requested review from sixcolors, ReneWerner87 and efectn and removed request for a team August 14, 2024 02:52
Copy link
Contributor

coderabbitai bot commented Aug 14, 2024

Caution

Review failed

The pull request is closed.

Walkthrough

The recent changes primarily focus on updating the Fiber framework's documentation and configurations to reflect the new minimum required Go version of 1.22. Enhancements span various files, ensuring compatibility with the latest Go features. Additionally, test and benchmark functions have been refined for clarity and performance, particularly through improved serialization and deserialization methods via the MessagePack library.

Changes

File(s) Change Summary
.github/README.md, docs/intro.md, docs/whats_new.md Updated documentation to reflect that Fiber now requires Go version 1.22 or higher.
.github/workflows/*.yml Changed go-version to 1.22.x in workflows for linter, benchmark, and testing.
Makefile Incremented linting tool version; added a new target for generating message pack files.
client/*.go, client/*_test.go, ctx_test.go Simplified condition checks and added comments for clarity in tests.
middleware/cache/*.go, middleware/csrf/*.go, middleware/limiter/*.go, middleware/session/*.go Enhanced serialization methods for MessagePack; updated comments and added tests.
middleware/*_msgp.go, *_msgp_test.go Introduced new methods for encoding and decoding MessagePack data, alongside corresponding tests.
path_test.go, prefork_test.go Refined error message formatting in assertions and added comments to suppress linting errors.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CLI
    participant Fiber
    participant Go

    User->>CLI: Install Fiber
    CLI->>Fiber: Fetch latest version
    Fiber->>Go: Check version compatibility
    Go-->>Fiber: Confirm Go version >= 1.22
    Fiber-->>CLI: Installation successful
Loading

🐰 "In the meadow, bright and clear,
Changes hop, oh what cheer!
Go's new version, we embrace,
Fiber's journey, a lively race!
With tests refined, and docs anew,
Let's code and play, in fields so true!"
🌼


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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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

codecov bot commented Aug 14, 2024

Codecov Report

Attention: Patch coverage is 36.87943% with 356 lines in your changes missing coverage. Please review.

Project coverage is 80.84%. Comparing base (e437633) to head (05ac0d0).

Files Patch % Lines
middleware/cache/manager_msgp.go 34.52% 78 Missing and 32 partials ⚠️
middleware/session/data_msgp.go 33.85% 69 Missing and 15 partials ⚠️
middleware/idempotency/response_msgp.go 30.35% 63 Missing and 15 partials ⚠️
middleware/csrf/storage_manager_msgp.go 42.35% 41 Missing and 8 partials ⚠️
middleware/limiter/manager_msgp.go 40.67% 24 Missing and 11 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3101      +/-   ##
==========================================
- Coverage   83.60%   80.84%   -2.76%     
==========================================
  Files         115      116       +1     
  Lines        8342     8850     +508     
==========================================
+ Hits         6974     7155     +181     
- Misses       1042     1298     +256     
- Partials      326      397      +71     
Flag Coverage Δ
unittests 80.84% <36.87%> (-2.76%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between e437633 and 854b918.

Files ignored due to path filters (1)
  • go.mod is excluded by !**/*.mod
Files selected for processing (32)
  • .github/README.md (3 hunks)
  • .github/workflows/benchmark.yml (1 hunks)
  • .github/workflows/linter.yml (1 hunks)
  • .github/workflows/test.yml (2 hunks)
  • Makefile (2 hunks)
  • client/client.go (1 hunks)
  • client/client_test.go (1 hunks)
  • client/request_test.go (2 hunks)
  • ctx_test.go (3 hunks)
  • docs/intro.md (1 hunks)
  • docs/whats_new.md (1 hunks)
  • helpers_test.go (2 hunks)
  • listen.go (1 hunks)
  • middleware/cache/cache_test.go (2 hunks)
  • middleware/cache/manager.go (1 hunks)
  • middleware/cache/manager_msgp.go (5 hunks)
  • middleware/cache/manager_msgp_test.go (5 hunks)
  • middleware/csrf/storage_manager.go (1 hunks)
  • middleware/csrf/storage_manager_msgp.go (2 hunks)
  • middleware/csrf/storage_manager_msgp_test.go (1 hunks)
  • middleware/idempotency/response.go (1 hunks)
  • middleware/idempotency/response_msgp.go (6 hunks)
  • middleware/idempotency/response_msgp_test.go (5 hunks)
  • middleware/limiter/manager.go (1 hunks)
  • middleware/limiter/manager_msgp.go (1 hunks)
  • middleware/limiter/manager_msgp_test.go (5 hunks)
  • middleware/session/data.go (1 hunks)
  • middleware/session/data_msgp.go (1 hunks)
  • middleware/session/data_msgp_test.go (1 hunks)
  • middleware/static/config.go (1 hunks)
  • path_test.go (5 hunks)
  • prefork_test.go (1 hunks)
Files skipped from review due to trivial changes (7)
  • .github/README.md
  • client/client.go
  • helpers_test.go
  • middleware/cache/cache_test.go
  • middleware/limiter/manager.go
  • middleware/session/data_msgp.go
  • path_test.go
Additional context used
golangci-lint
prefork_test.go

98-98: directive //nolint:tenv // Ignore error is unused for linter "tenv"

(nolintlint)


104-104: directive //nolint:tenv // Ignore error is unused for linter "tenv"

(nolintlint)

listen.go

354-354: directive //nolint:errcheck,revive,govet // ignore error is unused for linter "govet"

(nolintlint)

client/client_test.go

1425-1425: directive //nolint: staticcheck // not needed for tests is unused for linter "staticcheck"

(nolintlint)

client/request_test.go

87-87: directive //nolint: staticcheck // not needed for tests is unused for linter "staticcheck"

(nolintlint)

ctx_test.go

870-870: directive //nolint: staticcheck // not needed for tests is unused for linter "staticcheck"

(nolintlint)


883-883: directive //nolint: staticcheck // not needed for tests is unused for linter "staticcheck"

(nolintlint)


903-903: directive //nolint: staticcheck // not needed for tests is unused for linter "staticcheck"

(nolintlint)

GitHub Check: codecov/patch
middleware/cache/manager_msgp.go

[warning] 16-17: middleware/cache/manager_msgp.go#L16-L17
Added lines #L16 - L17 were not covered by tests


[warning] 23-24: middleware/cache/manager_msgp.go#L23-L24
Added lines #L23 - L24 were not covered by tests


[warning] 31-32: middleware/cache/manager_msgp.go#L31-L32
Added lines #L31 - L32 were not covered by tests


[warning] 37-38: middleware/cache/manager_msgp.go#L37-L38
Added lines #L37 - L38 were not covered by tests


[warning] 42-48: middleware/cache/manager_msgp.go#L42-L48
Added lines #L42 - L48 were not covered by tests


[warning] 50-53: middleware/cache/manager_msgp.go#L50-L53
Added lines #L50 - L53 were not covered by tests


[warning] 55-55: middleware/cache/manager_msgp.go#L55
Added line #L55 was not covered by tests


[warning] 60-61: middleware/cache/manager_msgp.go#L60-L61
Added lines #L60 - L61 were not covered by tests


[warning] 66-67: middleware/cache/manager_msgp.go#L66-L67
Added lines #L66 - L67 were not covered by tests


[warning] 72-73: middleware/cache/manager_msgp.go#L72-L73
Added lines #L72 - L73 were not covered by tests


[warning] 78-79: middleware/cache/manager_msgp.go#L78-L79
Added lines #L78 - L79 were not covered by tests


[warning] 84-85: middleware/cache/manager_msgp.go#L84-L85
Added lines #L84 - L85 were not covered by tests


[warning] 90-91: middleware/cache/manager_msgp.go#L90-L91
Added lines #L90 - L91 were not covered by tests


[warning] 93-97: middleware/cache/manager_msgp.go#L93-L97
Added lines #L93 - L97 were not covered by tests


[warning] 110-110: middleware/cache/manager_msgp.go#L110
Added line #L110 was not covered by tests


[warning] 114-115: middleware/cache/manager_msgp.go#L114-L115
Added lines #L114 - L115 were not covered by tests


[warning] 118-121: middleware/cache/manager_msgp.go#L118-L121
Added lines #L118 - L121 were not covered by tests


[warning] 123-126: middleware/cache/manager_msgp.go#L123-L126
Added lines #L123 - L126 were not covered by tests


[warning] 132-132: middleware/cache/manager_msgp.go#L132
Added line #L132 was not covered by tests


[warning] 136-137: middleware/cache/manager_msgp.go#L136-L137
Added lines #L136 - L137 were not covered by tests


[warning] 142-142: middleware/cache/manager_msgp.go#L142
Added line #L142 was not covered by tests


[warning] 146-147: middleware/cache/manager_msgp.go#L146-L147
Added lines #L146 - L147 were not covered by tests


[warning] 152-152: middleware/cache/manager_msgp.go#L152
Added line #L152 was not covered by tests


[warning] 156-157: middleware/cache/manager_msgp.go#L156-L157
Added lines #L156 - L157 were not covered by tests


[warning] 162-162: middleware/cache/manager_msgp.go#L162
Added line #L162 was not covered by tests


[warning] 166-167: middleware/cache/manager_msgp.go#L166-L167
Added lines #L166 - L167 were not covered by tests


[warning] 172-172: middleware/cache/manager_msgp.go#L172
Added line #L172 was not covered by tests


[warning] 176-177: middleware/cache/manager_msgp.go#L176-L177
Added lines #L176 - L177 were not covered by tests


[warning] 182-182: middleware/cache/manager_msgp.go#L182
Added line #L182 was not covered by tests


[warning] 186-187: middleware/cache/manager_msgp.go#L186-L187
Added lines #L186 - L187 were not covered by tests

Additional comments not posted (69)
middleware/idempotency/response.go (1)

6-6: LGTM! Enhanced testing capabilities.

The addition of the -tests=true flag in the go:generate directive improves the testing capabilities of the generated code.

middleware/session/data.go (2)

7-8: LGTM! Improved code generation setup.

The go:generate directive has been updated to include tests, enhancing the testing capabilities of the generated code.


12-12: LGTM! Proper exclusion of sync.RWMutex.

The addition of the msg:"-" tag to sync.RWMutex ensures it is excluded from serialization, which is a best practice.

.github/workflows/linter.yml (2)

33-33: LGTM! Updated Go version.

The Go version has been updated to 1.22.x, ensuring compatibility with newer features.


40-40: LGTM! Updated golangci-lint version.

The golangci-lint version has been updated to v1.60.1, incorporating improvements and bug fixes.

.github/workflows/test.yml (1)

18-18: LGTM! Updates to Go versions and coverage upload conditions are appropriate.

The changes to the Go version matrix and the conditional statement for uploading coverage reports align with the PR objectives of supporting Go 1.23.

Also applies to: 34-34

middleware/csrf/storage_manager.go (2)

12-12: LGTM! Updated go:generate directive is correct.

The change from // go:generate msgp to the specific command ensures proper code generation.


19-21: LGTM! Struct field annotations and linter comments are appropriate.

The msg:"-" annotations correctly exclude fields from serialization, and the nolint:revive comments suppress warnings for unexported types.

Makefile (2)

38-38: LGTM! Linter version update is appropriate.

Updating to v1.60.1 ensures the latest linter features and fixes are applied.


60-67: LGTM! New msgp target is well-defined.

The msgp target facilitates message pack generation for multiple files, improving serialization processes.

middleware/static/config.go (1)

89-89: Verify cfg.IndexNames is never nil.

The condition now assumes cfg.IndexNames will not be nil. Ensure that the rest of the codebase guarantees this to prevent potential nil pointer dereferences.

Verification successful

cfg.IndexNames is never nil.

The IndexNames field in the Config struct is initialized with a default value of []string{"index.html"}, ensuring it is not nil. Additionally, there are no assignments in the codebase that set IndexNames to nil. Thus, the condition if len(cfg.IndexNames) == 0 is safe and does not risk a nil pointer dereference.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that `cfg.IndexNames` is never `nil` before calling `configDefault`.

# Test: Search for instances where `configDefault` is called. Expect: `cfg.IndexNames` is initialized.
rg --type go -A 5 $'configDefault'

Length of output: 16218


Script:

#!/bin/bash
# Search for the definition of the `Config` struct to check how `IndexNames` is initialized.
ast-grep --lang go --pattern 'type Config struct { $$$ }'

Length of output: 71614


Script:

#!/bin/bash
# Search for assignments to `cfg.IndexNames` to ensure it is not set to `nil`.
rg --type go 'IndexNames\s*=\s*nil'

Length of output: 37

middleware/cache/manager_msgp_test.go (1)

Line range hint 12-92:
LGTM! Improved clarity and test coverage.

The renaming of functions for clarity and the addition of new test and benchmark functions enhance the code quality and functionality.

Also applies to: 94-123

middleware/limiter/manager_msgp_test.go (7)

Line range hint 12-34: Review of TestMarshalUnmarshalitem function.

The function tests the marshal and unmarshal operations for the item struct. The renaming improves clarity. The test logic is sound, ensuring no leftover bytes after unmarshalling and skipping.


Line range hint 35-43: Review of BenchmarkMarshalMsgitem function.

The benchmark measures the performance of the MarshalMsg method for the item struct. The renaming improves clarity. The function is correctly set up to report allocations and reset timers.


Line range hint 44-55: Review of BenchmarkAppendMsgitem function.

This benchmark tests the performance of appending a marshalled message. The renaming improves clarity. The setup correctly handles byte slices and reports allocations.


Line range hint 56-68: Review of BenchmarkUnmarshalitem function.

The benchmark evaluates the performance of the UnmarshalMsg method. The renaming improves clarity. The function correctly handles error checking and reports allocations.


70-92: Review of TestEncodeDecodeitem function.

The new test function enhances coverage by testing encoding and decoding operations. It checks the accuracy of Msgsize() and ensures no errors during decoding. The warning log is useful for debugging.


94-106: Review of BenchmarkEncodeitem function.

This new benchmark measures the performance of encoding operations. The setup is correct with buffer management and allocation reporting. The function is well-structured for performance testing.


108-123: Review of BenchmarkDecodeitem function.

The benchmark tests decoding performance. The setup is correct with buffer management and allocation reporting. The function is well-structured and handles errors appropriately.

middleware/idempotency/response_msgp_test.go (6)

Line range hint 35-68: Review of BenchmarkMarshalMsgresponse function.

The benchmark measures the performance of the MarshalMsg method for the response struct. The renaming improves clarity. The function is correctly set up to report allocations and reset timers.


Line range hint 44-55: Review of BenchmarkAppendMsgresponse function.

This benchmark tests the performance of appending a marshalled message. The renaming improves clarity. The setup correctly handles byte slices and reports allocations.


Line range hint 56-68: Review of BenchmarkUnmarshalresponse function.

The benchmark evaluates the performance of the UnmarshalMsg method. The renaming improves clarity. The function correctly handles error checking and reports allocations.


70-92: Review of TestEncodeDecoderesponse function.

The new test function enhances coverage by testing encoding and decoding operations. It checks the accuracy of Msgsize() and ensures no errors during decoding. The warning log is useful for debugging.


94-106: Review of BenchmarkEncoderesponse function.

This new benchmark measures the performance of encoding operations. The setup is correct with buffer management and allocation reporting. The function is well-structured for performance testing.


108-123: Review of BenchmarkDecoderesponse function.

The benchmark tests decoding performance. The setup is correct with buffer management and allocation reporting. The function is well-structured and handles errors appropriately.

middleware/session/data_msgp_test.go (7)

12-33: Review of TestMarshalUnmarshaldata function.

The function tests the marshal and unmarshal operations for the data struct. It ensures no leftover bytes after unmarshalling and skipping. The logic is sound and comprehensive.


35-42: Review of BenchmarkMarshalMsgdata function.

The benchmark measures the performance of the MarshalMsg method for the data struct. The setup is correct with allocation reporting and timer resetting.


44-54: Review of BenchmarkAppendMsgdata function.

This benchmark tests the performance of appending a marshalled message. The setup correctly handles byte slices and reports allocations.


56-68: Review of BenchmarkUnmarshaldata function.

The benchmark evaluates the performance of the UnmarshalMsg method. The function correctly handles error checking and reports allocations.


70-92: Review of TestEncodeDecodedata function.

The test function enhances coverage by testing encoding and decoding operations. It checks the accuracy of Msgsize() and ensures no errors during decoding. The warning log is useful for debugging.


94-106: Review of BenchmarkEncodedata function.

This benchmark measures the performance of encoding operations. The setup is correct with buffer management and allocation reporting. The function is well-structured for performance testing.


108-123: Review of BenchmarkDecodedata function.

The benchmark tests decoding performance. The setup is correct with buffer management and allocation reporting. The function is well-structured and handles errors appropriately.

middleware/cache/manager.go (1)

11-13: Enabling test generation for msgp is a positive change.

The modification to the msgp directive to generate tests will enhance the reliability and maintainability of the generated code.

middleware/limiter/manager_msgp.go (1)

9-90: The implementation of DecodeMsg and EncodeMsg enhances serialization capabilities.

The new methods for encoding and decoding item instances using MessagePack format improve the structure's functionality. The error handling is robust and provides clear context, which is beneficial for debugging.

.github/workflows/benchmark.yml (1)

34-34: Updating Go version to 1.22.x is a beneficial change.

The update to the Go version in the GitHub Actions workflow ensures that the project benefits from the latest features and improvements available in Go 1.22.x.

middleware/csrf/storage_manager_msgp.go (9)

9-35: Verify handling of map keys in DecodeMsg.

The DecodeMsg method currently defaults to skipping all keys. Ensure that this is intentional and that no fields need to be decoded.


38-47: LGTM!

The EncodeMsg method correctly appends a map header with size 0 for an empty struct.


48-53: LGTM!

The MarshalMsg method is consistent with EncodeMsg and correctly handles an empty struct.


Line range hint 54-92:
Verify handling of map keys in UnmarshalMsg.

The UnmarshalMsg method currently skips all keys. Ensure that this is intentional and that no fields need to be unmarshaled.


93-93: LGTM!

The Msgsize method correctly returns 1 for an empty struct.


94-120: Verify handling of map keys in DecodeMsg.

The DecodeMsg method currently skips all keys. Ensure that this is intentional and that no fields need to be decoded for storageManager.


123-132: LGTM!

The EncodeMsg method correctly appends a map header with size 0 for an empty struct.


143-171: Verify handling of map keys in UnmarshalMsg.

The UnmarshalMsg method currently skips all keys. Ensure that this is intentional and that no fields need to be unmarshaled for storageManager.


173-177: LGTM!

The Msgsize method correctly returns 1 for an empty struct.

docs/intro.md (1)

15-15: LGTM!

The Go version requirement update to 1.22 is consistent with the PR objectives.

middleware/csrf/storage_manager_msgp_test.go (14)

12-33: LGTM!

The TestMarshalUnmarshalitem function correctly tests the marshal and unmarshal operations for item.


35-42: LGTM!

The BenchmarkMarshalMsgitem function correctly benchmarks the MarshalMsg operation for item.


44-54: LGTM!

The BenchmarkAppendMsgitem function correctly benchmarks the append operation for item.


56-68: LGTM!

The BenchmarkUnmarshalitem function correctly benchmarks the UnmarshalMsg operation for item.


70-92: LGTM!

The TestEncodeDecodeitem function correctly tests the encode and decode operations for item.


94-106: LGTM!

The BenchmarkEncodeitem function correctly benchmarks the EncodeMsg operation for item.


108-123: LGTM!

The BenchmarkDecodeitem function correctly benchmarks the DecodeMsg operation for item.


125-146: LGTM!

The TestMarshalUnmarshalstorageManager function correctly tests the marshal and unmarshal operations for storageManager.


148-155: LGTM!

The BenchmarkMarshalMsgstorageManager function correctly benchmarks the MarshalMsg operation for storageManager.


157-167: LGTM!

The BenchmarkAppendMsgstorageManager function correctly benchmarks the append operation for storageManager.


169-181: LGTM!

The BenchmarkUnmarshalstorageManager function correctly benchmarks the UnmarshalMsg operation for storageManager.


183-205: LGTM!

The TestEncodeDecodestorageManager function correctly tests the encode and decode operations for storageManager.


207-219: LGTM!

The BenchmarkEncodestorageManager function correctly benchmarks the EncodeMsg operation for storageManager.


221-236: LGTM!

The BenchmarkDecodestorageManager function correctly benchmarks the DecodeMsg operation for storageManager.

middleware/idempotency/response_msgp.go (5)

9-91: Enhancements to DecodeMsg look good.

The function now correctly handles additional fields and improves error handling by wrapping errors with contextual information.


93-145: Enhancements to EncodeMsg look good.

The function now correctly encodes additional fields and improves error handling by wrapping errors with contextual information.


Line range hint 147-167:
Update to MarshalMsg aligns with new encoding structure.

The function now appends StatusCode at the end, ensuring consistency with the updated encoding structure.


Line range hint 169-243:
Update to UnmarshalMsg ensures complete field processing.

The function now includes the StatusCode field, ensuring all fields are decoded correctly with proper error handling.


Line range hint 258-269:
Update to Msgsize ensures accurate size estimation.

The function now accounts for the new encoding structure, ensuring the estimated size reflects the actual size accurately.

middleware/cache/manager_msgp.go (3)

191-202: Update to MarshalMsg aligns with encoding structure.

The function correctly marshals fields into a byte slice, consistent with the EncodeMsg structure.


Line range hint 204-301:
Update to UnmarshalMsg aligns with decoding structure.

The function correctly unmarshals fields from a byte slice, consistent with the DecodeMsg structure.


322-330: Update to Msgsize ensures accurate size estimation.

The function now accounts for the new encoding structure, ensuring the estimated size reflects the actual size accurately.

docs/whats_new.md (1)

41-41: Documentation Update Approved.

The update correctly reflects the new minimum Go version requirement for Fiber v3.

client/request_test.go (1)

1606-1607: Approved: Simplification of assertions.

The simplification of assertions in the benchmark enhances readability without altering functionality.

client/client_test.go Show resolved Hide resolved
client/request_test.go Show resolved Hide resolved
ctx_test.go Show resolved Hide resolved
ctx_test.go Show resolved Hide resolved
ctx_test.go Show resolved Hide resolved
middleware/cache/manager_msgp.go Show resolved Hide resolved
middleware/cache/manager_msgp.go Show resolved Hide resolved
prefork_test.go Show resolved Hide resolved
listen.go Show resolved Hide resolved
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.50.

Benchmark suite Current: 05ac0d0 Previous: e437633 Ratio
Benchmark_Compress_Levels/Brotli_LevelBestCompression - B/op 5 B/op 0 B/op +∞

This comment was automatically generated by workflow using github-action-benchmark.

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 854b918 and 8fd116d.

Files selected for processing (5)
  • .github/workflows/test.yml (2 hunks)
  • middleware/limiter/limiter_fixed.go (3 hunks)
  • middleware/limiter/limiter_sliding.go (2 hunks)
  • middleware/limiter/limiter_test.go (2 hunks)
  • prefork.go (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/test.yml
Additional context used
golangci-lint
middleware/limiter/limiter_fixed.go

[warning] 30-30: var-naming: don't use underscores in Go names; var max_requests should be maxRequests

(revive)


30-30: ST1003: should not use underscores in Go names; var max_requests should be maxRequests

(stylecheck)

middleware/limiter/limiter_sliding.go

[warning] 31-31: var-naming: don't use underscores in Go names; var max_requests should be maxRequests

(revive)


31-31: ST1003: should not use underscores in Go names; var max_requests should be maxRequests

(stylecheck)

prefork.go

79-79: ST1003: should not use underscores in Go names; var max_procs should be maxProcs

(stylecheck)


[warning] 79-79: var-naming: don't use underscores in Go names; var max_procs should be maxProcs

(revive)

middleware/limiter/limiter_test.go

[warning] 100-100: var-naming: don't use underscores in Go names; var mas_requests should be masRequests

(revive)


100-100: ST1003: should not use underscores in Go names; var mas_requests should be masRequests

(stylecheck)

GitHub Check: lint
middleware/limiter/limiter_fixed.go

[failure] 30-30:
var-naming: don't use underscores in Go names; var max_requests should be maxRequests (revive)


[failure] 30-30:
ST1003: should not use underscores in Go names; var max_requests should be maxRequests (stylecheck)

middleware/limiter/limiter_sliding.go

[failure] 31-31:
var-naming: don't use underscores in Go names; var max_requests should be maxRequests (revive)


[failure] 31-31:
ST1003: should not use underscores in Go names; var max_requests should be maxRequests (stylecheck)

prefork.go

[failure] 79-79:
var-naming: don't use underscores in Go names; var max_procs should be maxProcs (revive)


[failure] 79-79:
ST1003: should not use underscores in Go names; var max_procs should be maxProcs (stylecheck)

middleware/limiter/limiter_test.go

[failure] 100-100:
var-naming: don't use underscores in Go names; var mas_requests should be masRequests (revive)


[failure] 100-100:
ST1003: should not use underscores in Go names; var mas_requests should be masRequests (stylecheck)

middleware/limiter/limiter_test.go Outdated Show resolved Hide resolved
middleware/limiter/limiter_test.go Outdated Show resolved Hide resolved
middleware/limiter/limiter_test.go Outdated Show resolved Hide resolved
middleware/limiter/limiter_fixed.go Outdated Show resolved Hide resolved
middleware/limiter/limiter_fixed.go Outdated Show resolved Hide resolved
middleware/limiter/limiter_sliding.go Outdated Show resolved Hide resolved
middleware/limiter/limiter_sliding.go Outdated Show resolved Hide resolved
prefork.go Outdated Show resolved Hide resolved
prefork.go Outdated Show resolved Hide resolved
prefork.go Outdated Show resolved Hide resolved
@ReneWerner87 ReneWerner87 merged commit 25e3992 into main Aug 14, 2024
14 of 17 checks passed
@ReneWerner87 ReneWerner87 added this to the v3 milestone Aug 14, 2024
@efectn efectn deleted the chore-updates branch September 1, 2024 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants