Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@devkiran
Copy link
Collaborator

@devkiran devkiran commented Aug 13, 2025

Summary by CodeRabbit

  • New Features
    • Partner onboarding now accepts logos from multiple sources: uploaded files, pasted image data, hosted image links, and supported favicon URLs.
    • Improved validation ensures a valid image is provided, with a clear “Image is required” message when missing.
    • More flexible image input options streamline setup and reduce friction when adding partner logos.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 13, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Introduces partnerImageSchema to validate partner images from multiple sources (base64, R2 stored URL, public hosted URL, or Google Favicon URL). Updates onboardPartnerSchema.image to use partnerImageSchema, imports required constants and schemas, and enforces non-empty images with transformation of falsy inputs to an empty string.

Changes

Cohort / File(s) Summary
Partners Zod Schemas
apps/web/lib/zod/schemas/partners.ts
Added partnerImageSchema supporting base64ImageSchema, storedR2ImageUrlSchema, publicHostedImageSchema, or GOOGLE_FAVICON_URL-prefixed URL; transforms falsy to ""; enforces non-empty with "Image is required". Replaced onboardPartnerSchema.image from uploadedImageSchema to partnerImageSchema; imported necessary constants/schemas.

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant OnboardForm
  participant Zod as Zod: partnerImageSchema

  Client->>OnboardForm: Submit partner data (image)
  OnboardForm->>Zod: Validate image
  alt base64 image
    Zod-->>OnboardForm: Accept via base64ImageSchema
  else stored R2 URL
    Zod-->>OnboardForm: Accept via storedR2ImageUrlSchema
  else public hosted URL
    Zod-->>OnboardForm: Accept via publicHostedImageSchema
  else Google Favicon URL
    Zod-->>OnboardForm: Accept if startsWith(GOOGLE_FAVICON_URL)
  else falsy
    Zod-->>OnboardForm: Transform to "" and fail "Image is required"
  end
  OnboardForm-->>Client: Validation result
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested reviewers

  • steven-tey

Poem

I hop through schemas, ears held high,
Four image paths beneath one sky.
Base64, R2, public streams—
Even favicons join our dreams.
With a twitch and tidy rule,
Empty pics won’t clear this school.
Thump-thump—validation jewel! 🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2941163 and 66901b9.

📒 Files selected for processing (1)
  • apps/web/lib/zod/schemas/partners.ts (3 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch allow-image-url

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.

❤️ 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>, please review it.
    • 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.
  • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

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

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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.

@devkiran devkiran requested a review from steven-tey August 13, 2025 18:56
@vercel
Copy link
Contributor

vercel bot commented Aug 13, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Project Deployment Preview Updated (UTC)
dub 🔄 Building Preview Aug 13, 2025 6:57pm

@steven-tey steven-tey merged commit bf40e4b into main Aug 13, 2025
5 of 7 checks passed
@steven-tey steven-tey deleted the allow-image-url branch August 13, 2025 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants