-
-
Notifications
You must be signed in to change notification settings - Fork 888
chore: moved setup.ts to src/setup and written tests for it #3568
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
chore: moved setup.ts to src/setup and written tests for it #3568
Conversation
WalkthroughThis pull request introduces new documentation entries for the Changes
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (3)
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
Documentation and Community
|
Our Pull Request Approval ProcessThanks for contributing! Testing Your CodeRemember, your PRs won't be reviewed until these criteria are met:
Our policies make our code better. ReviewersDo not assign reviewers. Our Queue Monitors will review your PR and assign them.
Reviewing Your CodeYour reviewer(s) will have the following roles:
CONTRIBUTING.mdRead our CONTRIBUTING.md file. Most importantly:
Other
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop-postgres #3568 +/- ##
====================================================
+ Coverage 85.57% 85.92% +0.35%
====================================================
Files 358 358
Lines 8968 8968
Branches 1932 1932
====================================================
+ Hits 7674 7706 +32
+ Misses 935 903 -32
Partials 359 359 ☔ View full report in Codecov by Sentry. |
Please fix the failing tests and make coderabbit.ai approve your work |
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: 1
🧹 Nitpick comments (2)
src/setup/setup.ts (1)
12-44
: Consider adding input validation for the reCAPTCHA site key format.While the function correctly validates the reCAPTCHA key using validateRecaptcha, consider adding a basic format check before making the validation call to provide faster feedback to users.
validate: (input: string): boolean | string => { + if (!input || input.trim().length < 20) { + return 'reCAPTCHA site key must be at least 20 characters long'; + } return ( validateRecaptcha(input) || 'Invalid reCAPTCHA site key. Please try again.' ); },src/setup/setup.spec.ts (1)
48-95
: Consider adding edge cases to the test suite.While the basic test cases are well covered, consider adding tests for:
- Invalid environment file content
- Empty or malformed Docker configuration
- Network timeouts during reCAPTCHA validation
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
docs/docs/auto-docs/setup/setup/functions/askAndSetRecaptcha.md
(1 hunks)docs/docs/auto-docs/setup/setup/functions/main.md
(1 hunks)package.json
(1 hunks)src/setup/setup.spec.ts
(1 hunks)src/setup/setup.ts
(1 hunks)
✅ Files skipped from review due to trivial changes (2)
- docs/docs/auto-docs/setup/setup/functions/main.md
- docs/docs/auto-docs/setup/setup/functions/askAndSetRecaptcha.md
🧰 Additional context used
🪛 GitHub Actions: PR Workflow
package.json
[error] 1-1: Unauthorized change/delete attempt on package.json.
🔇 Additional comments (4)
src/setup/setup.ts (2)
4-9
: LGTM! Clean import path updates.The import paths have been correctly updated to use relative paths, which is more maintainable after moving the file to src/setup.
62-92
: LGTM! Well-structured main function with proper error handling.The main function is well-organized with:
- Proper environment file checks
- Clear user feedback
- Conditional Docker-based setup
- Comprehensive error handling
src/setup/setup.spec.ts (2)
24-46
: LGTM! Well-structured test setup with proper cleanup.The test setup is thorough with:
- Clear mock initialization
- Proper spy setup for process.exit and console.error
- Clean afterEach cleanup
165-179
: LGTM! Comprehensive error handling test.The error handling test properly verifies:
- Error message formatting
- Console error logging
- Prevention of environment file updates
i didnt got any issue here @palisadoes |
|
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.
Please fix the failing test
@abbi4code Your changes haven't affected vitest, pull this PR into your code, it will be fixed. |
Yes sir! All tests are passing now |
68a69ed
into
PalisadoesFoundation:develop-postgres
What kind of change does this PR introduce?
Issue Number:
Fixes #3521
Snapshots/Videos:

Summary by CodeRabbit
askAndSetRecaptcha
andmain
functions.askAndSetRecaptcha
function accessible for use in other modules.