-
Notifications
You must be signed in to change notification settings - Fork 1
refactor: update README files to reflect project name change from Qui… #38
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
…ckForge AI to nexus - Changed project title and references in both English and Chinese README files. - Updated badge links to reflect the new project name and added relevant GitHub and Discord links. - Enhanced descriptions to maintain clarity and consistency with the new branding.
…tation - Added support for an optional `extension_callback` parameter in the Google login API. - Updated OpenAPI documentation to reflect the new query parameter and improved error handling for validation errors. - Refactored related types and SDK generation to accommodate the new login data structure. - Removed unused utility exports from the client codebase for better clarity and maintainability.
Caution Review failedThe pull request is closed. WalkthroughThis update introduces consistent project rebranding from "QuickForge AI" to "nexus" in documentation, refines Google OAuth login API types and endpoint definitions, and enhances code quality through improved type exports, test utilities, and formatting. It replaces custom JWT decoding with the Changes
Sequence Diagram(s)sequenceDiagram
participant Frontend
participant SDK
participant Backend
Frontend->>SDK: googleOauthGoogleLogin({ extension_callback })
SDK->>Backend: GET /api/v1/login/google?extension_callback=...
Backend-->>SDK: 200 OK (or 422 Validation Error)
SDK-->>Frontend: Response (success or error)
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🪧 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🔭 Outside diff range comments (1)
backend/app/core/config.py (1)
210-210
:⚠️ Potential issueFix duplicate FRONTEND_HOST declaration.
The
FRONTEND_HOST
variable is defined twice - once on line 47 and again on line 210. This is causing a linting error.- FRONTEND_HOST: str = "http://localhost:3000" + # Use a different variable name to avoid duplication with line 47 + GOOGLE_OAUTH_FRONTEND_HOST: str = "http://localhost:3000"You'll also need to update any references to this variable elsewhere in the code.
🧰 Tools
🪛 GitHub Actions: Lint Backend
[error] 210-210: mypy error: Name "FRONTEND_HOST" already defined on line 47 (no-redef)
♻️ Duplicate comments (1)
backend/app/tests/scripts/test_test_pre_start.py (1)
5-5
: Same issue as intest_backend_pre_start.py
: the test importsinit
fromapp.db.init_db
(expects aSession
) but still callsinit(engine_mock)
and patchessqlmodel.Session
, which is not invoked. Please update the test accordingly.
🧹 Nitpick comments (3)
backend/app/tests/test_initial_data.py (1)
119-119
: Fix typo in comment.There's a typo in the comment - "scrip" should be "script".
- # Write the temporary scrip + # Write the temporary scriptbackend/app/tests/api/test_google_oauth.py (1)
89-89
: Fix typo in test comment.
The comment is truncated ("reques" instead of "request"), leading to a minor typo. Please correct it:- # Configure the mock to return a different user than the reques + # Configure the mock to return a different user than the requestbackend/app/tests/utils/test_db.py (1)
246-257
: Consider refactoring duplicated driver detection logicThe driver detection logic is duplicated between
setup_test_db()
andtest_database_connection()
. Consider extracting this into a helper function to avoid duplication and simplify maintenance.+def detect_postgres_driver() -> str: + """Detect available PostgreSQL driver and return appropriate SQLAlchemy prefix.""" + if importlib.util.find_spec("psycopg2"): + logger.info("Using psycopg2 driver for database connection") + return "postgresql+psycopg2" + elif importlib.util.find_spec("psycopg"): + logger.info("Using psycopg (v3) driver for database connection") + return "postgresql+psycopg" + else: + logger.error("Neither psycopg nor psycopg2 is available. Please install one of them.") + raise ImportError( + "Database driver not available. Install either psycopg2-binary or psycopg[binary]" + )Then use this function in both places:
# In setup_test_db(): driver_name = detect_postgres_driver() # In test_database_connection(): try: driver_name = detect_postgres_driver() except ImportError: return False # If neither driver is available
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
📒 Files selected for processing (22)
README.md
(2 hunks)README_zh-CN.md
(3 hunks)admin/src/client/index.ts
(1 hunks)admin/src/client/sdk.gen.ts
(2 hunks)admin/src/client/types.gen.ts
(1 hunks)backend/app/api/routes/__init__.py
(1 hunks)backend/app/core/config.py
(1 hunks)backend/app/tests/api/routes/test_users.py
(1 hunks)backend/app/tests/api/test_google_oauth.py
(1 hunks)backend/app/tests/conftest.py
(3 hunks)backend/app/tests/scripts/test_backend_pre_start.py
(1 hunks)backend/app/tests/scripts/test_test_pre_start.py
(1 hunks)backend/app/tests/test_initial_data.py
(4 hunks)backend/app/tests/utils/test_db.py
(9 hunks)backend/app/tests_pre_start.py
(1 hunks)frontend/app/layout.tsx
(1 hunks)frontend/app/login/page.tsx
(1 hunks)frontend/app/openapi-client/sdk.gen.ts
(2 hunks)frontend/app/openapi-client/types.gen.ts
(1 hunks)frontend/app/page.tsx
(1 hunks)frontend/app/password-recovery/confirm/page.tsx
(1 hunks)frontend/openapi.json
(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (8)
backend/app/tests/scripts/test_test_pre_start.py (2)
backend/app/core/db.py (1)
init_db
(57-87)backend/app/tests_pre_start.py (1)
init
(23-30)
admin/src/client/types.gen.ts (1)
frontend/app/openapi-client/types.gen.ts (1)
GoogleOauthGoogleLoginData
(331-335)
frontend/app/password-recovery/confirm/page.tsx (1)
website/src/components/ui/card-hover-effect.tsx (1)
CardDescription
(76-94)
backend/app/tests_pre_start.py (1)
backend/app/tests/utils/test_db.py (1)
get_test_db_url
(37-62)
backend/app/tests/conftest.py (2)
backend/app/tests/utils/test_db.py (1)
setup_test_db
(162-207)backend/app/core/db.py (1)
init_db
(57-87)
admin/src/client/sdk.gen.ts (2)
admin/src/client/types.gen.ts (2)
GoogleOauthGoogleLoginData
(135-137)GoogleOauthGoogleLoginResponse
(139-139)admin/src/client/core/CancelablePromise.ts (1)
CancelablePromise
(20-126)
frontend/app/openapi-client/sdk.gen.ts (1)
frontend/app/openapi-client/types.gen.ts (1)
GoogleOauthGoogleLoginData
(331-335)
frontend/app/openapi-client/types.gen.ts (1)
admin/src/client/types.gen.ts (3)
GoogleOauthGoogleLoginData
(135-137)GoogleOauthGoogleLoginResponse
(139-139)HTTPValidationError
(43-45)
🪛 GitHub Actions: Lint Backend
backend/app/core/config.py
[error] 210-210: mypy error: Name "FRONTEND_HOST" already defined on line 47 (no-redef)
backend/app/tests/test_initial_data.py
[error] 129-129: mypy error: "CompletedProcess[str]" has no attribute "stdou"; maybe "stdout"? (attr-defined)
⏰ Context from checks skipped due to timeout of 90000ms (5)
- GitHub Check: test-playwright (3, 4)
- GitHub Check: test-playwright (4, 4)
- GitHub Check: test-playwright (2, 4)
- GitHub Check: test-playwright (1, 4)
- GitHub Check: test-backend
🔇 Additional comments (39)
frontend/app/password-recovery/confirm/page.tsx (1)
52-52
: Refine JSX formatting for CardDescription
Collapsing the<CardDescription>
into a single line enhances readability and aligns with the style of adjacent components.README.md (3)
1-1
: Branding update: Title updated to 'nexus'
Header correctly reflects the new project name.
286-286
: AI Integration section updated with new branding
The phrase now correctly states “nexus makes it simple to integrate various AI services:”.
5-5
:⚠️ Potential issueBadge URL mismatch—update shields URL
The alt text has been updated tonexus
, but the badge URL still referencesQuickForge-AI
, which contradicts the PR summary and causes confusion. Please update the shields.io URL to reflectnexus
.Apply this diff:
- +Likely an incorrect or invalid review comment.
README_zh-CN.md (4)
6-6
: Branding update: Title updated to 'nexus'
Chinese title correctly reflects the new project name.
10-14
: Badge section updated for nexus repository
Badges now point totelepace/nexus
with appropriate labels and links, replacing the old QuickForge-AI badges.
24-24
: Project description updated with new branding
The Chinese project description has been correctly updated tonexus
without altering the original meaning.
435-435
: AI Integration section updated with new branding
The sentence now readsnexus使集成各种AI服务变得简单:
, matching the English version.backend/app/api/routes/__init__.py (1)
4-4
: LGTM! Clean formatting changes.The addition of blank lines after the imports groups improves readability and follows standard Python spacing conventions.
Also applies to: 9-9
admin/src/client/types.gen.ts (1)
135-137
: LGTM! New type for Google OAuth extension callback.The new type
GoogleOauthGoogleLoginData
provides proper type support for the optional extension callback parameter in the Google OAuth login flow.backend/app/core/config.py (1)
99-99
: LGTM! Whitespace cleanup.Removed trailing spaces improves code formatting.
Also applies to: 105-105
backend/app/tests/test_initial_data.py (2)
14-15
: LGTM! Simplified mocking approach.The updated mock is cleaner and more straightforward, patching
sqlmodel.Session
directly.
71-72
: LGTM! Improved test function name and docstring.The new name
test_initial_data_has_entry_point
is more descriptive of what the test is checking.backend/app/tests/scripts/test_backend_pre_start.py (1)
5-5
:❌ Incorrect review comment
Test import mismatch for
init
function.
The test now importsinit
fromapp.db.init_db
, which expects aSession
object, but the test still callsinit(engine_mock)
and patchessqlmodel.Session
, whichinit_db
does not invoke. This mismatch means the test does not exercise the intended code path andsession_mock_class
is never used. Please update the test to construct or pass a mockedSession
instance. For example:-from app.db.init_db import init +from app.db.init_db import init as init_db ... - init(engine_mock) + init_db(session_mock) # Pass the mocked session instead of engine
🏁 Script executed:
#!/bin/bash # Show definition of init in app/db/init_db.py rg "def init" -A20 -n app/db/init_db.py echo "--------------------------------------------------" # Show contents of the test file cat backend/app/tests/scripts/test_backend_pre_start.pyLength of output: 782
🏁 Script executed:
#!/bin/bash # Locate all init_db.py files echo "Searching for init_db.py..." find . -type f -name init_db.py # Display the definition of init in each found file echo echo "Extracting init definitions..." for file in $(find . -type f -name init_db.py); do echo "===== $file =====" rg "def init" -A20 -n "$file" || echo "No match in $file" doneLength of output: 212
🏁 Script executed:
#!/bin/bash # List all Python files under backend/app to locate init definitions echo "Listing all .py files under backend/app/:" find backend/app -type f -name "*.py"Length of output: 2394
🏁 Script executed:
#!/bin/bash # Check for init definitions in core modules echo "Searching for 'def init' in core modules..." for file in backend/app/core/db.py backend/app/core/db_factory.py; do echo "===== $file =====" rg "def init" -n "$file" || echo "No init found in $file" done # If still not found, search entire repository echo echo "Searching entire codebase for 'def init('..." rg "def init\\(" -nLength of output: 980
🏁 Script executed:
#!/bin/bash # Display the init function in backend_pre_start.py echo "===== backend/app/backend_pre_start.py =====" sed -n '1,200p' backend/app/backend_pre_start.py | sed -n '1,50p'Length of output: 1083
🏁 Script executed:
#!/bin/bash # Show contents of backend/app/tests_pre_start.py around init tests echo "===== backend/app/tests_pre_start.py =====" sed -n '1,200p' backend/app/tests_pre_start.pyLength of output: 1544
Update import in test_backend_pre_start.py to target the correct
init
functionThe test is exercising the
init
defined inapp.backend_pre_start
(which takes anEngine
and invokessqlmodel.Session
), but it’s currently importing from the non-existentapp.db.init_db
. Update the import so your patch onsqlmodel.Session
actually applies to the right function.• In backend/app/tests/scripts/test_backend_pre_start.py
-from app.db.init_db import init +from app.backend_pre_start import initLikely an incorrect or invalid review comment.
frontend/app/page.tsx (1)
11-11
: Trivial whitespace removal; no functional impact.frontend/app/layout.tsx (1)
21-24
: Only quote style formatting change; no functional impact.backend/app/tests/api/routes/test_users.py (1)
231-231
: Whitespace cleanup looks good.This change removes an unnecessary blank line, improving the code formatting consistency.
backend/app/tests_pre_start.py (2)
35-43
: Import organization improvements look good.The changes reorganize imports in a more logical order (standard library imports first, then third-party libraries like SQLModel, then application-specific imports), which follows Python conventions and improves readability.
50-50
: Whitespace cleanup looks good.This change removes an unnecessary blank line, improving the code formatting consistency.
frontend/app/login/page.tsx (1)
39-43
: Whitespace cleanup looks good.This change removes unnecessary blank lines in the
CallbackUrlHandler
component, improving code formatting consistency.admin/src/client/index.ts (1)
7-7
: New type exports are a good addition.This change adds the export of types from the
./types
module, which is necessary to make the new Google OAuth related types (such asGoogleOauthGoogleLoginData
) available to consumers of this API. This properly supports the enhancement of the Google OAuth login functionality.frontend/app/openapi-client/types.gen.ts (2)
331-335
: Good type definition for Google OAuth login data.Adding the
GoogleOauthGoogleLoginData
type with an optional query parameter forextension_callback
improves type safety for the Google OAuth login flow. This properly aligns with the corresponding changes in the admin client and backend API.
339-339
: Improved error type specification.Changing
GoogleOauthGoogleLoginError
fromunknown
toHTTPValidationError
provides more specific type information, which enhances error handling capabilities and aligns with other API error types in the codebase.frontend/openapi.json (2)
800-807
: Well-implemented new query parameter for the Google OAuth login endpointThe addition of the optional
extension_callback
parameter to the Google OAuth login endpoint is properly defined with all required OpenAPI specification properties.
813-820
: Good addition of explicit validation error handlingAdding explicit 422 validation error response documentation improves the API contract definition and ensures consistent error handling across endpoints.
backend/app/tests/conftest.py (2)
6-6
: Correctly streamlined importsRemoving unused imports (
os
andcreate_engine
fromsqlmodel
) improves code cleanliness.
17-70
: Improved code readability and organizationThe fixes for comment typos and whitespace issues enhance code readability without altering functionality. The explicit import of
app.core.db
inside the fixture (line 31) is a good practice for ensuring proper dependency management.frontend/app/openapi-client/sdk.gen.ts (2)
79-79
: Proper type import for enhanced type safetyAdding the
GoogleOauthGoogleLoginData
type import ensures type safety for the updated function signature.
536-537
: Updated function signature with proper typingThe
googleOauthGoogleLogin
function now correctly accepts an optional parameters object typed asGoogleOauthGoogleLoginData
, allowing for the newextension_callback
parameter to be passed in a type-safe manner.admin/src/client/sdk.gen.ts (4)
6-6
: Complete import list with new typeThe import statement is updated to include the
GoogleOauthGoogleLoginData
type, ensuring type safety for the updated method signature.
34-35
: Clear documentation for new parameterThe JSDoc comments are properly updated to document the new parameter, helping developers understand how to use the extended API.
39-39
: Well-structured method signature updateThe method signature is updated to accept an optional data parameter with a sensible default empty object, maintaining backward compatibility.
42-48
: Comprehensive implementation of API extensionThe implementation correctly:
- Maps the camelCase
extensionCallback
property to the snake_caseextension_callback
query parameter- Adds proper error handling for the 422 validation error response
This ensures the client SDK properly interacts with the updated API.
backend/app/tests/utils/test_db.py (6)
17-17
: Good use of importlib.util for driver detectionUsing
importlib.util.find_spec
for checking module availability is more elegant than try-except blocks for import errors. This approach improves code readability and performance.
42-60
: Improved URL construction with comprehensive PostgreSQL prefix handlingThe updated URL construction logic is more robust and handles different PostgreSQL URL formats correctly. This will help prevent connection issues that could arise from mismatched driver prefixes.
169-194
: Good implementation of driver detection with proper error handlingThe driver detection logic in
setup_test_db()
is well-implemented with:
- Clear logging for which driver is being used
- Descriptive error messages when no driver is available
- Proper URL adjustment based on the detected driver
This improves reliability when running tests in different environments.
272-274
: Improved error handling with logging in database connection testAdding logging for connection failures is a good practice. It provides valuable information for debugging test setup issues without having to add debug statements manually.
86-89
: Better SQL query formattingThe improved SQL query formatting with proper indentation enhances readability. Consistent formatting makes the code easier to maintain and review.
92-95
: Enhanced logging messagesThe more detailed logging messages provide better context about database operations. This is particularly helpful when debugging test environment issues.
- Simplified event types for pull requests and push triggers in the workflow configuration. - Updated Git user configuration to use global settings for better consistency. - Enhanced change detection logic before committing and pushing generated client files. - Removed unnecessary comments and improved overall readability of the workflow file.
- Enhanced logic for detecting changes in generated client files for both same-repo and fork PRs. - Added warnings for fork PRs to prompt users to generate and commit changes locally. - Streamlined commit and push process for same-repo events to avoid conflicts. - Improved overall clarity and organization of the workflow file.
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)
.github/workflows/generate-client.yml (2)
93-96
: Enhance Commit & Push robustness
- Adding
git pull --rebase
reduces merge conflicts when CI and manual changes overlap.- You may consider using
--no-verify
ongit commit
or leveraging a dedicated action likepeter-evans/create-pull-request
for a more resilient CI-driven PR update workflow.
109-109
: Add a newline at end of file
YAMLLint reports a missing newline at EOF. Please add a trailing newline to conform with POSIX standards.🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 109-109: no new line character at the end of file
(new-line-at-end-of-file)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
📒 Files selected for processing (1)
.github/workflows/generate-client.yml
(3 hunks)
🧰 Additional context used
🪛 actionlint (1.7.7)
.github/workflows/generate-client.yml
88-88: "github.head_ref" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions for more details
(expression)
🪛 YAMLlint (1.37.1)
.github/workflows/generate-client.yml
[error] 109-109: no new line character at the end of file
(new-line-at-end-of-file)
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: test-playwright (4, 4)
- GitHub Check: test-playwright (1, 4)
- GitHub Check: test-playwright (3, 4)
- GitHub Check: test-playwright (2, 4)
🔇 Additional comments (5)
.github/workflows/generate-client.yml (5)
6-8
: Clean upon
event triggers
The inline array syntax forpull_request.types
andpush.branches
is concise and improves readability.
11-11
: Grant write permission forcontents
Settingpermissions.contents: write
is required so the workflow can commit and push the generated client files.
40-41
: Introduce UV CLI installation step
Usingastral-sh/setup-uv@v1
with caching streamlines the installation of theuv
tool needed for backend dependency sync.
78-79
: Set global Git identity for CI
Configuringgit config --global user.*
ensures that the autogenerated commits are correctly attributed to GitHub Actions.
81-84
: Stage both frontend and admin client files
Renaming to “Stage Generated Files” and addingadmin/src/client
alongsidefrontend/app/openapi-client
ensures all generated SDK artifacts are included in the commit.
BRANCH_NAME="${{ github.head_ref || github.ref_name }}" | ||
if ! git diff --quiet || ! git diff --staged --quiet; then |
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.
🛠️ Refactor suggestion
Avoid using ${{ github.head_ref }}
directly in shell scripts
Actionlint flags direct use of github.head_ref
in inline scripts as potentially untrusted. Instead, pass it through an environment variable.
Apply this diff:
jobs:
generate-client:
+ env:
+ HEAD_REF: ${{ github.head_ref }}
+ REF_NAME: ${{ github.ref_name }}
steps:
- name: Commit and Push Changes (Same Repo)
run: |
- BRANCH_NAME="${{ github.head_ref || github.ref_name }}"
+ BRANCH_NAME="${HEAD_REF:-$REF_NAME}"
if ! git diff --quiet || ! git diff --staged --quiet; then
🤖 Prompt for AI Agents
In .github/workflows/generate-client.yml at lines 89-90, avoid using `${{
github.head_ref }}` directly in the shell script due to security concerns
flagged by Actionlint. Instead, define an environment variable in the workflow
that captures `github.head_ref` or `github.ref_name`, then reference that
environment variable within the shell script. This ensures safer and cleaner
access to the branch name in the script.
- Added pnpm installation step in the GitHub Actions workflow for improved dependency management. - Updated JWT token decoding in the extension authentication routes to use the jwt library directly. - Refactored user retrieval logic to utilize session.get for better clarity and performance. - Modified Google OAuth login parameter type for improved type safety. - Updated database connection utilities to use the psycopg driver instead of psycopg2 for better compatibility.
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
🧹 Nitpick comments (5)
backend/app/api/routes/extension_auth.py (1)
49-50
: Consider consistent error handling across functionsWhile
get_extension_token
now uses specific exception handling withInvalidTokenError
, this function still uses a genericException
catch. Consider making the error handling consistent across both functions for better maintainability.- except Exception as e: + except (InvalidTokenError, Exception) as e:.github/workflows/generate-client.yml (4)
16-16
: Remove redundant blank line
There’s an extra blank line afterruns-on: ubuntu-latest
. Consider removing it for consistent spacing throughout the workflow.
48-48
: Remove trailing blank line
There’s an unnecessary blank line after theworking-directory: frontend
step. Cleaning up these trailing blanks can improve readability.
94-95
: Clean up commented-out pull command
The commentedgit pull --ff-only
lines can be removed or documented with a clear TODO if they’re intended for future use. Leaving orphaned comments may confuse maintainers.
121-121
: Add newline at end of file
YAMLLint reports a missing newline at EOF. Please add a final newline to comply with POSIX standards and avoid CI warnings.🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 121-121: no new line character at the end of file
(new-line-at-end-of-file)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
📒 Files selected for processing (8)
.github/workflows/generate-client.yml
(5 hunks).github/workflows/playwright.yml
(1 hunks)backend/app/api/routes/extension_auth.py
(4 hunks)backend/app/api/routes/google_oauth.py
(1 hunks)backend/app/core/config.py
(1 hunks)backend/app/core/supabase_service.py
(1 hunks)backend/app/tests/test_initial_data.py
(3 hunks)backend/app/tests/utils/test_db.py
(9 hunks)
✅ Files skipped from review due to trivial changes (2)
- backend/app/core/supabase_service.py
- backend/app/api/routes/google_oauth.py
🚧 Files skipped from review as they are similar to previous changes (2)
- backend/app/core/config.py
- backend/app/tests/test_initial_data.py
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/generate-client.yml
[error] 121-121: no new line character at the end of file
(new-line-at-end-of-file)
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: test-playwright (4, 4)
- GitHub Check: test-playwright (3, 4)
- GitHub Check: test-playwright (2, 4)
- GitHub Check: test-playwright (1, 4)
🔇 Additional comments (23)
backend/app/tests/utils/test_db.py (6)
17-17
: Improved module detection with importlibAdding
importlib.util
is a good improvement as it will be used to check for database driver availability withfind_spec
instead of relying on try-except blocks, making the code more explicit and maintainable.
42-62
: Well-structured database URL handling with improved driver compatibilityThe URL construction logic has been significantly improved to:
- Standardize on the
psycopg
driver- Handle different URL formats systematically
- Provide a clear fallback strategy
This change makes the test database setup more robust across different environments.
75-112
: Enhanced formatting and readability of database operationsThe SQL query formatting and logging messages have been improved with proper indentation and parameterization, making the code more readable and maintainable.
171-186
: Robust driver detection with clear error messagingThe implementation of
importlib.util.find_spec
for driver detection is better than using try-except blocks as it:
- Explicitly checks for module availability before attempting to use it
- Provides clear error messages when required drivers are missing
- Logs which driver is being used
This improves both the reliability and debuggability of the test setup process.
250-256
: Consistent driver detection pattern applied throughoutThe same driver detection pattern is correctly applied in the
test_database_connection
function, maintaining consistency across the module. This is good practice for code maintenance.
272-274
: Improved error handling with detailed loggingAdding explicit error logging when database connection fails will make debugging much easier. Previously, connection failures would happen silently, now they're properly logged with the specific error message.
backend/app/api/routes/extension_auth.py (9)
4-6
: Dependencies updated for direct JWT handlingThe imports have been appropriately updated to use the
jwt
library directly and include specific exception handling withInvalidTokenError
. This follows best practices by leveraging standard libraries and enabling more precise error handling.
11-11
: Type imports organized correctlyAdding the
User
model import alongside existing model imports improves consistency and makes the direct session access pattern more clear.
28-30
: Improved token decoding implementationReplacing the custom
security.decode_access_token
with directjwt.decode
calls eliminates an unnecessary abstraction layer and makes the code more explicit. The parameters are correctly specified to maintain consistent behavior.
32-32
: More efficient user retrievalUsing
session.get(User, user_id)
instead of a custom CRUD function is more direct and leverages SQLAlchemy's capabilities efficiently.
39-41
: Consistent JWT decoding approachThis second instance of token decoding follows the same improved pattern, ensuring consistency throughout the file.
43-43
: Consistent user retrieval patternThe user retrieval method has been updated consistently with the earlier instance.
64-66
: JWT decoding consistency maintainedThe JWT decoding approach has been applied consistently throughout the file, which is good for maintainability.
68-68
: User retrieval consistencyThe user retrieval method has been updated consistently throughout the file.
80-80
: Enhanced error handling with specific exceptionCatching the specific
InvalidTokenError
instead of a genericException
is a significant improvement that provides more precise error handling and better debugging..github/workflows/playwright.yml (2)
112-116
: Added explicit pnpm setup for merge-playwright-reports job
Introducing thepnpm/action-setup@v3
step with a pinned version (9.9.0) ensures that the merge job aligns with thetest-playwright
job’s environment. This promotes consistency and reliable dependency management across jobs.
116-119
: Enable pnpm caching in Node.js setup
The addition ofcache: 'pnpm'
under the Node.js setup ensures that frontend dependencies are cached between runs, which will improve workflow performance. This matches the caching strategy used in the test job..github/workflows/generate-client.yml (6)
6-7
: Simplified pull_request and push triggers
Switching to inline array syntax fortypes: [opened, synchronize]
andbranches: [main]
makes the event configuration more concise and readable, without altering behavior.
11-12
: Grant write permissions on contents
Explicitly settingpermissions.contents: write
ensures that the workflow can commit and push generated client files. This is a necessary permission scope for the commit step.
23-27
: Pinned pnpm version for consistent client generation
Settingpnpm/action-setup@v3
withversion: 9.9.0
mirrors other workflows and avoids unexpected breaks due to pnpm upgrades.
40-41
: Verify UV setup action version
The workflow usesastral-sh/setup-uv@v1
, while the Playwright job usesastral-sh/setup-uv@v6
. Please confirm that@v1
is intentional here, or consider aligning versions across workflows.
78-79
: Global Git user configuration is appropriate
Usinggit config --global
inside GitHub Actions is safe (it only affects the runner). This ensures commits are properly attributed.
81-85
: Renamed staging step and file paths updated
Renaming to Stage Generated Files and updating the paths tofrontend/app/openapi-client
andadmin/src/client
accurately reflects the new project structure after rebranding.
- Compressed OpenAPI JSON structure for better readability and performance. - Modified the `extension_callback` parameter type in the Google OAuth login data to allow null values for improved type safety. - Ensured consistency in API response schemas across various endpoints.
- Changed the GitHub token used in the workflow from GITHUB_TOKEN to BOT_GITHUB_TOKEN for improved access control. - Removed outdated comments regarding the use of a personal access token (PAT) for triggering workflows.
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
🧹 Nitpick comments (4)
.github/workflows/generate-client.yml (4)
10-11
: Consider tightening the workflow’s permissions
Currently, the workflow grantscontents: write
at the top level. To follow the principle of least privilege, you could scope write permissions more narrowly (e.g., limit to specific jobs or paths).
40-41
: Pin thesetup-uv
action to a specific version
You’re currently usingastral-sh/setup-uv@v1
, which will float to the latest v1 release. For stronger reproducibility, consider pinning to a specific patch release (e.g.,@v1.2.3
) or a commit SHA.
94-95
: Remove commented-out pull logic if obsolete
The commentedgit pull --ff-only
lines can be removed if they’re no longer needed. Keeping dead code may confuse future maintainers.
119-119
: Add a newline at end of file
YAMLLint flags a missing newline at end-of-file. Please add an empty line after thisfi
to satisfy POSIX and linting standards.🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 119-119: no new line character at the end of file
(new-line-at-end-of-file)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
📒 Files selected for processing (1)
.github/workflows/generate-client.yml
(5 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/generate-client.yml
[error] 119-119: no new line character at the end of file
(new-line-at-end-of-file)
🔇 Additional comments (5)
.github/workflows/generate-client.yml (5)
6-8
: Good modernization of event triggers
Using inline array syntax forpull_request.types
andpush.branches
improves readability and consistency.
48-48
: Correctly scoped install step for Admin dependencies
Addingworking-directory: admin
ensures dependencies are installed in the right folder, aligning with the frontend and backend steps.
78-79
: Global Git configuration is fine in CI
Switching to--global
foruser.email
anduser.name
in the ephemeral runner is reasonable and simplifies setup without side effects beyond the workflow run.
81-81
: Step description updated for clarity
Renaming to "Stage Generated Files" accurately reflects that both frontend and admin client files are being staged.
103-103
: Use dedicated bot token
Switching from the defaultGITHUB_TOKEN
tosecrets.BOT_GITHUB_TOKEN
is a good isolation practice. Please verify thatBOT_GITHUB_TOKEN
has the necessarycontents: write
scope configured in repository settings.
- Added psycopg2-binary as a fallback driver in pyproject.toml for better compatibility. - Enhanced test database setup to prioritize psycopg driver and provide installation fallback for missing drivers. - Updated logging messages for clarity regarding database configuration in test mode.
- Added psycopg2-binary as a fallback driver in the test database creation process for better compatibility. - Improved error handling during test database creation, including detailed logging and recovery attempts. - Updated test scripts to use the new database initialization method for consistency across tests.
- Updated import paths for ItemPublic to use the custom client module across multiple components. - Adjusted related imports in EditItem, ItemActionsMenu, and layout files for consistency. - Modified useCustomToast to align with the new import structure.
- Deleted the Google OAuth route implementation, configuration settings, and security utilities as they are no longer in use. - This cleanup helps streamline the codebase and remove unnecessary dependencies.
- Refactored import statements for ItemPublic in EditItem and items layout files to use the new type import syntax. - Improved code clarity and consistency across components by standardizing the import style.
- Reduced the size of the OpenAPI JSON file by compressing its structure, enhancing performance and clarity. - Ensured that the API response schemas remain consistent across various endpoints.
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: 3
♻️ Duplicate comments (1)
.github/workflows/generate-client.yml (1)
94-97
: Avoid direct use of${{ github.head_ref }}
in scripts
As previously flagged, defining environment variables forgithub.head_ref
andgithub.ref_name
improves security and readability.Apply this diff:
jobs: generate-client: env: + HEAD_REF: ${{ github.head_ref }} + REF_NAME: ${{ github.ref_name }} ... # Pull before pushing to avoid conflicts if possible (optional) - git pull --ff-only origin ${{ github.head_ref || github.ref_name }} + git pull --ff-only origin ${HEAD_REF:-$REF_NAME} ... - git push origin HEAD:${{ github.head_ref || github.ref_name }} + git push origin HEAD:${HEAD_REF:-$REF_NAME}
🧹 Nitpick comments (6)
.github/workflows/generate-client.yml (2)
5-8
: Consider including additional event triggers
You’ve constrainedpull_request
to only theopened
andsynchronize
types. For completeness, consider addingreopened
(and/orworkflow_dispatch
) so the workflow triggers when a PR is reopened or manually invoked.
119-119
: Add newline at end of file
YAMLlint flagged a missing newline at EOF. Please add a line break to satisfy YAML conventions.🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 119-119: no new line character at the end of file
(new-line-at-end-of-file)
scripts/generate-admin-client.sh (1)
57-60
: Add pre-check for the fix script’s existence
Currently the script blindly invokesfix-admin-client.sh
. To fail more gracefully when the fix script is missing or not executable, consider adding a pre-check before execution.Proposed diff:
+if [ ! -x "$PROJECT_ROOT/scripts/fix-admin-client.sh" ]; then + echo "Error: fix-admin-client.sh not found or not executable at $PROJECT_ROOT/scripts/fix-admin-client.sh" + exit 1 +fi "$PROJECT_ROOT/scripts/fix-admin-client.sh"Makefile (1)
616-618
: Align help grouping with new ENV MANAGEMENT section
The help output now highlights ENV MANAGEMENT, but only lists a subset of the related commands. Exposingcheck-root-env
,check-admin-env
,check-frontend-env
, andcheck-extension-env
in the help can improve discoverability.backend/app/tests_pre_start.py (1)
52-61
: Avoid double creation & redundant connection attempts
setup_test_db()
internally callscreate_test_database()
again, so when the first call inside thetry
fails we end up running the same logic twice (potentially dropping/re-creating the DB a second time).
Instead, delegate the whole responsibility immediately:- try: - logger.info("Creating test database if it doesn't exist...") - create_test_database() - except Exception as e: - logger.error(f"Failed to create test database: {e}") - # 如果失败,尝试使用 setup_test_db,它会尝试重新创建 - logger.info("Trying alternative setup approach...") - test_engine = setup_test_db() - init(test_engine) - return + try: + test_engine = setup_test_db() # handles creation & engine building + except Exception as e: + logger.error("Test DB setup failed: %s", e, exc_info=True) + raise + + init(test_engine) + returnLess duplication, fewer edge-cases, clearer control flow.
(If keeping both helpers is necessary,setup_test_db(create_if_missing=False)
could be introduced to clarify intent.)backend/app/tests/utils/test_db.py (1)
37-63
: Safer URL manipulation viasqlalchemy.engine.url.URL
String replacement (
main_url.split("/")[-1]
) fails when the original URL contains query parameters or a pathname segment containing “/”. Using SQLAlchemy’s URL parser prevents such edge-cases:from sqlalchemy.engine import make_url def get_test_db_url() -> str: main_url = make_url(str(settings.SQLALCHEMY_DATABASE_URI)) main_url = main_url.set(database=get_test_db_name()) # enforce driver if main_url.drivername.endswith("+psycopg2"): main_url = main_url.set(drivername=main_url.drivername.replace("+psycopg2", "+psycopg")) elif "+psycopg" not in main_url.drivername: main_url = main_url.set(drivername="postgresql+psycopg") return str(main_url)Reduces chances of malformed URLs and keeps credentials intact.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
⛔ Files ignored due to path filters (3)
backend/uv.lock
is excluded by!**/*.lock
package-lock.json
is excluded by!**/package-lock.json
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (20)
.github/workflows/generate-client.yml
(5 hunks)Makefile
(8 hunks)admin/src/client/custom.ts
(1 hunks)admin/src/client/index.ts
(1 hunks)admin/src/components/Common/ItemActionsMenu.tsx
(1 hunks)admin/src/components/Items/EditItem.tsx
(1 hunks)admin/src/hooks/useCustomToast.ts
(1 hunks)admin/src/routes/_layout/items.tsx
(1 hunks)app/api/routes/google_oauth.py
(0 hunks)app/core/config.py
(0 hunks)app/core/security.py
(0 hunks)backend/app/tests/scripts/test_backend_pre_start.py
(1 hunks)backend/app/tests/scripts/test_test_pre_start.py
(1 hunks)backend/app/tests/utils/test_db.py
(9 hunks)backend/app/tests_pre_start.py
(1 hunks)backend/pyproject.toml
(1 hunks)docker-compose.nole.yml
(0 hunks)package.json
(0 hunks)scripts/fix-admin-client.sh
(1 hunks)scripts/generate-admin-client.sh
(1 hunks)
💤 Files with no reviewable changes (5)
- docker-compose.nole.yml
- app/api/routes/google_oauth.py
- app/core/security.py
- package.json
- app/core/config.py
✅ Files skipped from review due to trivial changes (7)
- admin/src/components/Common/ItemActionsMenu.tsx
- admin/src/routes/_layout/items.tsx
- backend/app/tests/scripts/test_test_pre_start.py
- admin/src/hooks/useCustomToast.ts
- backend/pyproject.toml
- admin/src/components/Items/EditItem.tsx
- admin/src/client/custom.ts
🚧 Files skipped from review as they are similar to previous changes (2)
- admin/src/client/index.ts
- backend/app/tests/scripts/test_backend_pre_start.py
🧰 Additional context used
🧬 Code Graph Analysis (1)
backend/app/tests_pre_start.py (1)
backend/app/tests/utils/test_db.py (3)
create_test_database
(71-136)get_test_db_url
(37-62)setup_test_db
(183-240)
🪛 YAMLlint (1.37.1)
.github/workflows/generate-client.yml
[error] 119-119: no new line character at the end of file
(new-line-at-end-of-file)
🪛 Ruff (0.11.9)
backend/app/tests/utils/test_db.py
196-196: psycopg
imported but unused; consider using importlib.util.find_spec
to test for availability
(F401)
201-201: psycopg2
imported but unused; consider using importlib.util.find_spec
to test for availability
(F401)
🪛 GitHub Actions: Lint Backend
backend/app/tests/utils/test_db.py
[error] 196-196: ESLint: psycopg
imported but unused; consider using importlib.util.find_spec
to test for availability (F401). Remove unused import: psycopg
.
[error] 201-201: ESLint: psycopg2
imported but unused; consider using importlib.util.find_spec
to test for availability (F401). Remove unused import: psycopg2
.
🔇 Additional comments (10)
.github/workflows/generate-client.yml (4)
10-11
: Permissions follow least privilege principle
Grantingcontents: write
is sufficient for staging and pushing generated files, minimizing risk.
40-44
: Install UV step with caching looks good
Theastral-sh/setup-uv@v1
action is pinned and cache is enabled, which should speed up Python environment setup.
78-80
: Global Git configuration is appropriate
Switching from local to global config for the Git user makes the commit step more reliable in CI contexts.
101-104
: Verify BOT_GITHUB_TOKEN permissions
You’ve switched theGITHUB_TOKEN
tosecrets.BOT_GITHUB_TOKEN
. Please confirm this token hascontents: write
permission and is correctly configured in the repository secrets.Makefile (4)
62-70
: Introduce Doppler-based environment management
The newDOPPLER_EXISTS
variable andenv-init
target lay the groundwork for consistent.env
initialization across services. This addition provides clear instructions for both example-based and Doppler-based workflows.
649-655
: Add setup target for streamlined onboarding
Thesetup
target combines environment initialization and tool installation, offering a convenient entry point for new contributors.
409-413
: Ensure admin dev target verifies .env
Addingcheck-admin-env
to theadmin
target guarantees an admin.env
file is present before starting the development server, reducing runtime errors.
532-536
: Ensure extension dev target verifies .env
Includingcheck-extension-env
in theextension
target mirrors the admin and frontend patterns, ensuring the extension.env
is initialized.backend/app/tests_pre_start.py (1)
64-65
: Align engine creation parameters with helper defaults
setup_test_db()
builds the engine withpool_pre_ping=True
, timeouts, etc., but the “happy-path” (create_test_database
succeeded) creates an engine with none of those options. This produces two different configurations for the same test environment.Either always call
setup_test_db()
(see previous comment) or replicate the same keyword arguments here to keep behaviour consistent.backend/app/tests/utils/test_db.py (1)
248-270
: Consider quoting identifiers when dropping/creating databases
DROP DATABASE IF EXISTS {test_db_name}
andCREATE DATABASE {test_db_name}
interpolate the name directly.
Whiletest_db_name
is internal, quoting withsql.Identifier
(or wrapping inpsycopg.sql
) eliminates any risk of injection and handles special-char names.from psycopg import sql cur.execute( sql.SQL("DROP DATABASE IF EXISTS {}").format(sql.Identifier(test_db_name)) )
- Deleted the lint-backend GitHub Actions workflow as it is no longer needed. - Added a step in the Playwright workflow to create a symlink for pnpm-lock.yaml to the root directory for better dependency management.
- Updated the check-root-env target to first attempt generating the .env file from Doppler if available, improving the setup process. - Added conditional checks to ensure a smoother fallback to copying from .env.example if Doppler is not configured or available.
…cript - Introduced tolerant boolean parsing using distutils.util.strtobool for improved environment variable handling. - Updated test mode detection logic to handle various input formats and ensure robustness against invalid values. - Refactored the admin client fix script to check and append missing export statements for better modularity.
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
🧹 Nitpick comments (2)
Makefile (2)
200-202
: Ensure modern Docker Compose availability.
Thedev
target now leveragesdocker compose up
(CLI plugin) instead of the deprecateddocker-compose
. Confirm that your CI/dev environments have the v2 plugin installed; otherwise, adding a fallback check could improve DX.
621-623
: Enhance help listing for env commands.
The regex only capturesenv
,check-doppler
, anddoppler
targets; it omitscheck-root-env
,env-doppler
,doppler-login-check
, etc. Consider broadening the pattern to surface these commands inmake help
.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
📒 Files selected for processing (3)
.github/workflows/playwright.yml
(2 hunks).github/workflows/use-make-test.yml
(2 hunks)Makefile
(8 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- .github/workflows/playwright.yml
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: test-playwright (4, 4)
- GitHub Check: test-playwright (3, 4)
- GitHub Check: test-playwright (2, 4)
- GitHub Check: test-playwright (1, 4)
🔇 Additional comments (6)
.github/workflows/use-make-test.yml (2)
1-1
: Workflow name updated appropriately.
The display name has been changed to “Use Make All Test,” which accurately conveys the step being executed.
27-28
: Verify Makefile availability in thebackend
directory.
Withworking-directory: backend
, the runner will expect a Makefile insidebackend/
defining theall
andtest
targets. Please confirm that such a Makefile exists there; otherwise, this step will fail.Makefile (4)
62-62
: Add Doppler CLI presence check.
IntroducingDOPPLER_EXISTS
ensures subsequent env management targets can gracefully handle a missing Doppler CLI. Nice enhancement for robustness.
64-70
: Structure environment management targets.
The new ENV MANAGEMENT header andenv-init
phony target clearly document and enforce.env
initialization across all components. This aligns well with the project’s need for consistent environment setup.
195-195
: Verify omission oftest
from theall
target.
The# test
comment suggests tests are intentionally excluded frommake all
. Please confirm this matches CI expectations—if you want tests run by default, consider including thetest
target here.
654-660
: Addsetup
target for streamlined onboarding.
Introducing thesetup
phony target to runenv-init
andinstall-tools
provides a one-step initialization for new contributors—great for improving developer experience.
…make commands - Added a step to install pnpm using the pnpm/action-setup@v3 action for better package management. - Modified the make command execution to simplify the workflow by directly running 'make all' without specifying the working directory.
…ectories - Added a step to run pnpm install for the frontend, admin, and extension directories, improving package management. - This change enhances the workflow by ensuring all necessary dependencies are installed before executing make commands.
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
🧹 Nitpick comments (3)
.github/workflows/use-make-test.yml (3)
27-34
: Review pnpm setup step and dependency installationThe
pnpm/action-setup
action’srun_install
input is intended as a boolean flag to automatically runpnpm install
after setup. Passing a multiline string of install commands may not be interpreted correctly. Consider splitting this into:
- A dedicated setup step for pnpm (with
run_install: false
).- Separate steps to install dependencies in each directory.
Example refactor:
- - name: Install pnpm - uses: pnpm/action-setup@v3 - with: - run_install: | - - pnpm install --dir frontend - - pnpm install --dir admin - - pnpm install --dir extension + - name: Setup pnpm + uses: pnpm/action-setup@v3 + with: + version: "7" # or your chosen pnpm version + run_install: false # skip auto install + + - name: Install frontend dependencies + run: pnpm install --dir frontend + + - name: Install admin dependencies + run: pnpm install --dir admin + + - name: Install extension dependencies + run: pnpm install --dir extensionThis clarifies intent and ensures each install command runs as expected.
🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 34-34: trailing spaces
(trailing-spaces)
34-34
: Remove trailing spaces
Line 34 contains trailing whitespace which triggers a YAML lint error. Please remove the extra spaces.🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 34-34: trailing spaces
(trailing-spaces)
36-36
: Add newline at end of file
The file currently lacks a terminating newline, causing a lint warning. Please ensure there’s a blank line at EOF.🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 36-36: no new line character at the end of file
(new-line-at-end-of-file)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
📒 Files selected for processing (3)
.github/workflows/use-make-test.yml
(2 hunks)backend/app/tests_pre_start.py
(2 hunks)scripts/fix-admin-client.sh
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- scripts/fix-admin-client.sh
- backend/app/tests_pre_start.py
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/use-make-test.yml
[error] 34-34: trailing spaces
(trailing-spaces)
[error] 36-36: no new line character at the end of file
(new-line-at-end-of-file)
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: test-playwright (3, 4)
- GitHub Check: test-playwright (4, 4)
- GitHub Check: test-playwright (1, 4)
- GitHub Check: test-playwright (2, 4)
…ment and rebase strategy - Modified the generate-client workflow to use rebase instead of pull for better conflict resolution. - Added a step in the test-backend workflow to install backend dependencies before running migrations and tests. - Updated the test-docker-compose workflow to include a health check for the admin service. - Enhanced the use-make-test workflow to install dependencies for frontend, admin, and extension directories separately, ensuring all necessary packages are available before executing make commands.
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
♻️ Duplicate comments (1)
.github/workflows/generate-client.yml (1)
94-95
: Avoid direct use of GitHub context in scripts
Directly interpolating${{ github.head_ref || github.ref_name }}
can be flagged by Actionlint as untrusted. As per prior reviews, define environment variables (e.g.,HEAD_REF
,REF_NAME
) at the job level and reference those instead.
🧹 Nitpick comments (4)
.github/workflows/test-backend.yml (1)
46-47
: Specify Python dependency installation in UV environment
To ensurepip install -e .
runs inside the UV-managed virtual environment, consider invoking it viauv run pip install -e .
instead ofuv pip install -e .
.- run: docker compose --project-name $STACK_NAME run --rm backend uv pip install -e . + run: docker compose --project-name $STACK_NAME run --rm backend uv run pip install -e ..github/workflows/generate-client.yml (1)
40-41
: Unify UV GitHub Action version
This step usesastral-sh/setup-uv@v1
, whereas other workflows (e.g.,test-backend.yml
) use@v6
. For consistency and improved caching, consider aligning the version across workflows..github/workflows/use-make-test.yml (2)
28-41
: Remove trailing whitespace
Several lines (e.g., 28, 33, 37, 41) contain trailing spaces, which can trigger YAMLlint warnings. Please remove these to comply with lint rules.🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 28-28: trailing spaces
(trailing-spaces)
[error] 33-33: trailing spaces
(trailing-spaces)
[error] 37-37: trailing spaces
(trailing-spaces)
[error] 41-41: trailing spaces
(trailing-spaces)
43-43
: Ensure newline at end of file
Add a newline at the end of this file to satisfy thenew-line-at-end-of-file
rule in YAMLlint.🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 43-43: no new line character at the end of file
(new-line-at-end-of-file)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
📒 Files selected for processing (4)
.github/workflows/generate-client.yml
(6 hunks).github/workflows/test-backend.yml
(1 hunks).github/workflows/test-docker-compose.yml
(1 hunks).github/workflows/use-make-test.yml
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- .github/workflows/test-docker-compose.yml
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/use-make-test.yml
[error] 28-28: trailing spaces
(trailing-spaces)
[error] 33-33: trailing spaces
(trailing-spaces)
[error] 37-37: trailing spaces
(trailing-spaces)
[error] 41-41: trailing spaces
(trailing-spaces)
[error] 43-43: no new line character at the end of file
(new-line-at-end-of-file)
.github/workflows/generate-client.yml
[error] 119-119: no new line character at the end of file
(new-line-at-end-of-file)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: test-playwright (3, 4)
🔇 Additional comments (13)
.github/workflows/generate-client.yml (8)
6-8
: Adopt inline YAML list syntax for event triggers
Using[opened, synchronize]
forpull_request.types
and[main]
forpush.branches
improves readability and aligns with GitHub Actions best practices.
11-11
: Grant explicit write permission for contents
Addingcontents: write
underpermissions
ensures the workflow can commit and push the generated files.
27-27
: Clean up pnpm setup step
Specifyingversion: 9.9.0
and removing commented‐out options makes the step concise and predictable.
48-48
: Verify working-directory for frontend install
Specifyingworking-directory: frontend
ensures dependencies install in the correct context. This matches the intended project structure.
52-52
: Verify working-directory for admin install
Specifyingworking-directory: admin
ensures dependencies install in the correct context.
78-79
: Set Git user globally in runner
Usinggit config --global
is fine in an ephemeral runner and ensures user identity persists across subsequent git commands.
81-84
: Stage generated output paths
The step correctly stages the updated client files in bothfrontend/app/openapi-client
andadmin/src/client
.
103-103
: Validate BOT_GITHUB_TOKEN permissions
Switching tosecrets.BOT_GITHUB_TOKEN
grants elevated scopes. Please confirm that this token has the necessary write permissions and follows your rotation policy..github/workflows/use-make-test.yml (5)
1-11
: Define workflow triggers with inline syntax
Thepush
andpull_request
events use clear inline list notation for branches and event types, ensuring precise CI invocation.
12-15
: Configure lint-backend job
Naming the joblint-backend
and running onubuntu-latest
aligns with your other CI workflows and provides a consistent environment.
16-27
: Set up environment tools
Steps for checking out code, setting up Python 3.10, installinguv
, and pinningpnpm
to version 8 are well-structured and consistent with other workflows.
29-41
: Optimize dependency installation viahashFiles
Installing dependencies only when the respectivepackage.json
changes (forfrontend
,admin
,extension
) is an excellent optimization to reduce CI runtime.🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 33-33: trailing spaces
(trailing-spaces)
[error] 37-37: trailing spaces
(trailing-spaces)
[error] 41-41: trailing spaces
(trailing-spaces)
42-43
: Run aggregated build/test via Makefile
Usingmake all
centralizes build and test commands. Ensure the Makefile covers all necessary targets (lint, test, build).🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 43-43: no new line character at the end of file
(new-line-at-end-of-file)
- Changed the commit command to include the `-a` flag, ensuring all changes are staged before committing. - This adjustment improves the workflow by preventing potential issues with untracked changes during the client generation process.
- Adjusted the order of targets in the 'all' command to prioritize backend, frontend, and admin builds before formatting and linting. - This change enhances the build process by ensuring that core components are built first, followed by checks and generation tasks.
This pull request includes a rebranding of the project from "QuickForge AI" to "nexus," along with several code changes to enhance functionality, improve test configurations, and clean up the codebase. Below is a breakdown of the most significant changes:
Rebranding
README.md
andREADME_zh-CN.md
, including badges, descriptions, and examples. [1] [2] [3] [4] [5]Frontend Enhancements
types
inadmin/src/client/index.ts
to improve type management.GoogleOauthService
inadmin/src/client/sdk.gen.ts
to include support forextensionCallback
in thegoogleLogin
method. [1] [2]GoogleOauthGoogleLoginData
inadmin/src/client/types.gen.ts
.Backend Improvements
backend/app/api/routes/__init__.py
for better organization.test_google_oauth.py
,conftest.py
, andtest_initial_data.py
. [1] [2] [3]Test and Database Configuration
test_db.py
to enhance logging and handle PostgreSQL connections more robustly. [1] [2]test_backend_pre_start.py
andtest_test_pre_start.py
. [1] [2]These changes collectively improve the branding, functionality, and maintainability of the project while ensuring a smoother development experience.
Summary by CodeRabbit
New Features
Documentation
Bug Fixes
Style
Tests
Chores