-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[newcomers-form] fix: accept Google Drive links in profile picture validation #7041
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
l5io
commented
Oct 16, 2025
🚀 Preview for commit 0bc92e9 at: https://68f13121a6457b84033b3eb4--layer5.netlify.app
@Fireentity
Fireentity
left a comment
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.
Hi, thanks for this contribution! The logic is looking good.
We can simplify the validation by using a single regular expression. This makes the intent clearer and is easier to maintain than multiple includes() checks.
const validGoogleDrivePattern = /drive\.google\.com\/file\/d\/.+\/(view|uc\?)/; if (value.includes('drive.google.com') && !validGoogleDrivePattern.test(value)) { error = "Please provide a direct Google Drive file link."; } else { // ... }
I also noticed the DCO check is failing. This happens when commits are not signed off. https://docs.meshery.io/project/contributing
FreemanBoss
commented
Oct 17, 2025
This is a very important to work on as I faced this issue through while filling the form. Between, the DCO checks is failing.
hudazaan
commented
Oct 17, 2025
Thankyou for the feedback. I'll simplify the validation and also fix the DCO check issue.
Namanv0509
commented
Oct 18, 2025
@hudazaan thanks for your contribution , you can check https://github.com/layer5io/layer5/pull/7041/checks?check_run_id=53083532468 to fix the DCO error
l5io
commented
Oct 18, 2025
🚀 Preview for commit a4dcc18 at: https://68f3b03153e83cd59ef816d1--layer5.netlify.app
Rajesh-Nagarajan-11
commented
Oct 24, 2025
DCO Failed
Rajesh-Nagarajan-11
commented
Oct 27, 2025
Thank you for your contribution!
Let's discuss this during the website call today at 5:30 PM IST | 7 AM CT
Add it as an agenda item to the meeting minutes, if you would 😄
Rajesh-Nagarajan-11
commented
Nov 2, 2025
Thank you for your contribution!
Let’s discuss this during the website call tomorrow (November 3) at 5:30 PM IST | 7:00 AM CT.
Please add it as an agenda item to the meeting minutes
😊
l5io
commented
Nov 9, 2025
🚀 Preview for commit 6a3ff67 at: https://6910b1998306858f758ebaee--layer5.netlify.app
leecalcote
commented
Dec 1, 2025
@hudazaan, you will need to add your sign off on your commit.
kishore08-07
commented
Dec 1, 2025
@hudazaan
To add your Signed-off-by line to every commit in this branch:
- Ensure you have a local copy of your branch by checking out the pull request locally via command line.
- In your local branch, run:
git rebase HEAD~3 --signoff - Force push your changes to overwrite the branch:
git push --force-with-lease origin fix/profile-picture-validation
l5io
commented
Dec 1, 2025
🚀 Preview for commit 61cd707 at: https://692d3f50fe3a2e97233a6df2--layer5.netlify.app
l5io
commented
Dec 1, 2025
🚀 Preview for commit aba1488 at: https://692d46de73dabd993bafbeba--layer5.netlify.app
l5io
commented
Dec 1, 2025
🚀 Preview for commit c25cc46 at: https://692d8639d8a8d80213e2035c--layer5.netlify.app
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.
Pull request overview
This PR fixes validation logic for profile picture URLs to accept Google Drive links in addition to direct image file URLs. Previously, users could not use Google Drive links as profile pictures due to the extension-based validation that rejected URLs without standard image file extensions.
Key Changes:
- Added special handling for Google Drive URLs in the picture validation function
- Implemented validation to ensure Google Drive links are properly formatted file links
- Updated the user-facing help text to clarify acceptable Google Drive link formats
Copilot
AI
Dec 1, 2025
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.
The validation logic is incorrect. It requires BOTH /file/d/ AND either /view OR /uc? to be present, but Google Drive file links typically have the format drive.google.com/file/d/{ID}/view where /view and /uc? don't appear together. The condition !isFileLink || (!isViewLink && !isDownloadLink) will reject valid links like drive.google.com/file/d/abc123/view. Change to if (!isFileLink || !(isViewLink || isDownloadLink)).
Copilot
AI
Dec 1, 2025
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.
The guidance text contradicts the code logic. It states Google Drive links should 'end with .jpg, .png, etc.', but the validation code accepts Google Drive links without checking file extensions. This misleading instruction may confuse users. Either remove the extension requirement from the text or update the code to validate Google Drive link extensions.
Fireentity
commented
Dec 7, 2025
@hudazaan Thank you for your contribution! Let's discuss this during the website call tomorrow at 6:30 PM IST | 8 AM CT Add it as an agenda item to the meeting minutes, if you would 🙂
@hudazaan
Lack of response will lead to this PR being closed.
hudazaan
commented
Dec 24, 2025
@hudazaan Lack of response will lead to this PR being closed.
Apologies for the long delay. I'll update this PR today and will be consistent going forward.
hudazaan
commented
Dec 24, 2025
@kishore08-07 I need your help. I squashed my signed commits but facing some tracking references issues now and git push --force-with-lease is failing. what should I do in such case? If you can clear my confusion, I'll update the work accordingly.
Description
This PR fixes #6986
Fixed the profile picture validation to accept Google Drive links. Previously, when users tried to paste Google Drive links as profile pictures, the form showed the error "URL must point to an image file (jpg, jpeg, png, svg, webp or gif)".
Notes for Reviewers
Signed commits