fix(gitlab): Properly handle auth for Gitlab project avatars#345
fix(gitlab): Properly handle auth for Gitlab project avatars#345msukkari merged 1 commit intosourcebot-dev:mainfrom
Conversation
WalkthroughThe changes update how GitLab repository avatar URLs are constructed and handled in both backend and frontend utilities. The backend now computes the avatar URL based on the repository's ID and self-link, while the frontend removes 'gitlab.com' from its list of public hostnames, altering how image URLs are proxied. Changes
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches
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. 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 (
|
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
packages/backend/src/repoCompileUtils.ts(2 hunks)packages/web/src/lib/utils.ts(0 hunks)
💤 Files with no reviewable changes (1)
- packages/web/src/lib/utils.ts
🔇 Additional comments (1)
packages/backend/src/repoCompileUtils.ts (1)
138-138: Confirm schema supportsnullavatar values
imageUrlcan now benull. Verify the Prisma model & DB column allowNULL
to prevent insertion failures.
870e48c to
baba319
Compare
|
Thanks for the fix Gabriel! |
Hey 👋
Context
We've noticed that our Gitlab project avatars were not loading properly, even in 4.2.0.
Proposed fix
I believe it's because the URL in project.avatarUrl does not accept Gitlab tokens anymore.
Gitlab provides a ~new API to get a project's avatar, supporting the same authentication modes as other APIs. This API does not require authentication for public projects.
I've also removed
gitlab.comfrom the list of domains never needing auth - to properly support private projects on Gitlab.com.Validation
I've only tested this change on an internal Gitlab with public/private projects and on gitlab.com with public/private projects.
Have a great day!
Summary by CodeRabbit