Add contrib v3 migration and update contrib tooling#222
Conversation
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughAdds a new v3 migration that rewrites Go Fiber contrib package references to the v3 module path and registers that migration in the V3 migration list; updates related import-migration logic, helper constants, tests, and test expectations. Changes
Sequence Diagram(s)sequenceDiagram
participant Caller as Migration Runner
participant Migrate as MigrateContribPackages
participant Transformer as ChangeFileContent
participant Walker as Filesystem Walk
participant FS as File I/O
Caller->>Migrate: invoke with cwd
Migrate->>Transformer: scan .go files, replace imports\n(contrib/... → contrib/v3/...), skip versioned paths
Transformer-->>Migrate: report if imports changed
Migrate->>Walker: walk directories for go.mod (skip vendor)
Walker->>FS: read go.mod
FS-->>Walker: contents
Walker->>Walker: replace contrib module paths → contrib/v3
Walker->>FS: write go.mod if changed
FS-->>Walker: write result
Walker-->>Migrate: report if go.mod changed
alt any changes
Migrate->>Caller: print "Migrating contrib packages"
else
Migrate->>Caller: no output
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (1)📓 Common learnings🧬 Code graph analysis (1)cmd/internal/migrations/v3/contrib_packages.go (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)
🔇 Additional comments (4)
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. Comment |
Summary of ChangesHello @ReneWerner87, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces essential updates to the project's migration and tooling infrastructure to support the transition of Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const ( | ||
| contribModulePrefix = "github.com/gofiber/contrib/v3/" | ||
| contribRepoPrefix = "gofiber/contrib/v3" | ||
| ) |
There was a problem hiding this comment.
Use correct repo path when generating contrib pseudo versions
The new contribRepoPrefix constant now includes /v3, but refreshContrib passes this value to pseudoVersionFromHash when a hash is provided. pseudoVersionFromHash constructs the GitHub API URL from that prefix, so the request targets https://api.github.com/repos/gofiber/contrib/v3/..., which does not exist—the repository is still gofiber/contrib. As a result, running the contrib refresh command with --hash will fail to fetch commit metadata and cannot compute pseudo versions. Keep the repository prefix as gofiber/contrib while using the /v3 suffix only for import paths.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Code Review
This pull request introduces a migration for gofiber/contrib packages to the v3 module path and updates the related tooling. The changes are well-structured, and the new migration logic is covered by a good set of tests, including checks for idempotency. The updates to the contrib refresh logic and monitor middleware are consistent with the migration. I've found one issue regarding file permission preservation which I've commented on. Overall, this is a solid contribution.
Summary
Testing
https://chatgpt.com/codex/tasks/task_e_6907e5507e1c83269ab613f940ed562c
Summary by CodeRabbit
New Features
Tests
Chores
✏️ Tip: You can customize this high-level summary in your review settings.