- 
                Notifications
    
You must be signed in to change notification settings  - Fork 27
 
          [deps] upgrade go-infra-fx to provide Request ID
          #175
        
          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
          
WalkthroughUpdated the dependency version in  Changes
 Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
 📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 💡 Knowledge Base configuration: 
 You can enable these sources in your CodeRabbit configuration. ⛔ Files ignored due to path filters (1)
 📒 Files selected for processing (1)
 🚧 Files skipped from review as they are similar to previous changes (1)
 ⏰ 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). (4)
 ✨ 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. CodeRabbit Commands (Invoked using PR/Issue comments)Type  Other keywords and placeholders
 CodeRabbit Configuration File (
 | 
    
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: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️  Outside diff range comments (1)
go.mod (1)
7-29: Commit the updated go.sum
Runninggo mod tidymodified go.sum by 34 lines; include and commit the updated go.sum in this PR.
🧹 Nitpick comments (1)
go.mod (1)
12-12: Prefer a tagged release over a pseudo-version
The latest available tag for go-infra-fx is v0.3.0 (there is no v0.3.1 tag). Pinning to v0.3.0 improves readability and conveys upgrade intent more clearly:- github.com/capcom6/go-infra-fx v0.3.1-0.20250904104539-6f3f2b187981 + github.com/capcom6/go-infra-fx v0.3.0
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
 - Jira integration is disabled by default for public repositories
 - Linear integration is disabled by default for public repositories
 
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (1)
go.sumis excluded by!**/*.sum
📒 Files selected for processing (1)
go.mod(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
go.mod (1)
internal/sms-gateway/handlers/messages/3rdparty.go (1)
In(27-35)
⏰ 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). (4)
- GitHub Check: Test
 - GitHub Check: E2E
 - GitHub Check: lint
 - GitHub Check: Analyze (go)
 
🔇 Additional comments (2)
go.mod (2)
12-12: LGTM: dep bump to pick up Request ID supportThe upgrade to go-infra-fx looks scoped and safe at the mod level.
3-5: Ensure CI pipelines pin Go 1.23.2
No Go version pin was found in your CI configs (e.g. .github/workflows/*.yml, .travis.yml, .gitlab-ci.yml, circleci/config.yml); confirm and align your CI toolchain to Go 1.23.2 to match the go.mod declaration.
        
          
                go.mod
              
                Outdated
          
        
      | github.com/ansrivas/fiberprometheus/v2 v2.6.1 | ||
| github.com/capcom6/go-helpers v0.3.0 | ||
| github.com/capcom6/go-infra-fx v0.3.0 | ||
| github.com/capcom6/go-infra-fx v0.3.1-0.20250904104539-6f3f2b187981 | 
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.
💡 Verification agent
🧩 Analysis chain
Wire Request ID end-to-end (middleware, context, logs, response header)
The dep alone won’t expose it; ensure the app integrates it:
- Add/enable the RequestID middleware from go-infra-fx in the Fiber stack (early in chain).
 - Propagate request-scoped context from Fiber handlers into services.
 - Include the request ID in zap fields for each request log and return it via X-Request-ID header.
 - Add a smoke test asserting X-Request-ID presence and correlation in logs.
 
🏁 Script executed:
#!/bin/bash
# Quick reconnaissance to spot integration gaps
rg -n -C2 -S '\bRequestID\b|X-Request-ID|request.?id' --type go -g '!**/vendor/**'Length of output: 84
🏁 Script executed:
#!/bin/bash
# Search for go-infra-fx import usage
rg -n -C2 'github.com/capcom6/go-infra-fx' --type go -g '*.go'
# Search for Fiber app creation
rg -n -C2 'fiber.New' --type go -g '*.go'
# Search for any App instantiation if Fiber alias differs
rg -n -C2 'NewApp' --type go -g '*.go'
# Search for RequestID middleware registration or usage
rg -n -C2 'RequestID' --type go -g '*.go'Length of output: 16828
🏁 Script executed:
#!/bin/bash
# Inspect Fiber app initialization and middleware usage
sed -n '1,200p' internal/sms-gateway/app.goLength of output: 3241
Integrate RequestID end-to-end
All traces of RequestID are missing—add it now:
- In internal/sms-gateway/app.go, register the go-infra-fx RequestID middleware early in the HTTP middleware chain.
 - Ensure each Fiber handler pulls the request-scoped context (with ID) from c.Context() and passes it into downstream services.
 - Include the request ID in all zap log fields (e.g. zap.String("request_id", id)) and configure the HTTP server to emit X-Request-ID on every response.
 - Add a smoke test that issues a request, asserts the X-Request-ID header is set, and verifies that ID appears in the logs.
 
55727c2    to
    62fab94      
    Compare
  
    
Summary by CodeRabbit