-
Notifications
You must be signed in to change notification settings - Fork 522
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
fix plausible site domain env validation #9168
fix plausible site domain env validation #9168
Conversation
WalkthroughThe changes in this pull request focus on modifying the validation schema for the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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 (
|
✅ Deploy Preview for care-ohc ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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: 0
🧹 Outside diff range and nitpick comments (1)
vite.config.mts (1)
114-119
: Consider enhancing the domain validation regex.The current regex pattern has some limitations:
- Doesn't support international domain names (IDN)
- Allows consecutive dots which might be invalid
- Allows underscores which are technically invalid in domain names per RFC
Consider using this enhanced regex pattern:
- .regex(/^[a-zA-Z0-9][a-zA-Z0-9-_.]*\.[a-zA-Z]{2,}$/) + .regex(/^[a-zA-Z0-9](?:[a-zA-Z0-9-](?!-)|\.(?!\.)){1,61}[a-zA-Z0-9]\.[a-zA-Z]{2,}$/)This pattern:
- Prevents consecutive dots and hyphens
- Removes underscore support (technically invalid in domains)
- Enforces length limits
- Still maintains the core requirement of no protocol
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
vite.config.mts
(1 hunks)
🔇 Additional comments (1)
vite.config.mts (1)
114-119
: LGTM! Please verify the domain format requirements.
The validation has been updated to enforce a stricter domain name format without protocol. This aligns with the PR objective to fix the plausible site domain validation.
LGTM |
CARE Run #3937
Run Properties:
|
Project |
CARE
|
Branch Review |
rithviknishad/fix/env-validation-plausible-site-domain
|
Run status |
Failed #3937
|
Run duration | 05m 00s |
Commit |
b7603f5335: fix plausible site domain env validation
|
Committer | Rithvik Nishad |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
1
|
Flaky |
0
|
Pending |
0
|
Skipped |
0
|
Passing |
128
|
View all changes introduced in this branch ↗︎ |
Tests for review
cypress/e2e/patient_spec/PatientPrescription.cy.ts • 1 failed test • UI-Chrome
Test | Artifacts | |
---|---|---|
Patient Medicine Administration > Add a new titrated medicine for a patient | Individual Administeration | |
Test Replay
Screenshots
|
@rithviknishad @rithviknishad Your efforts have helped advance digital healthcare and TeleICU systems. 🚀 Thank you for taking the time out to make CARE better. We hope you continue to innovate and contribute; your impact is immense! 🙌 |
Issue
Builds failing due to incorrect env validation (from #9032)
Proposed Changes
@ohcnetwork/care-fe-code-reviewers
Merge Checklist
Summary by CodeRabbit
REACT_PLAUSIBLE_SITE_DOMAIN
environment variable to enforce a specific domain name format.