Feature local setup#62
Conversation
- Added notes to local development. - Need to add more details on initial development.
Migration logic yet to be written
Added routes for validating the project name and unit tests for the same
|
Warning Review limit reached
Next review available in: 43 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughTasking projects now persist custom imagery and descriptions, expose workspace-scoped name validation, and validate imagery payloads. A local Docker Compose stack, setup documentation, migration, environment handling, and related tests were added. ChangesProject management updates
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant ProjectRoutes
participant ProjectRepository
participant Database
Client->>ProjectRoutes: Request project name validation
ProjectRoutes->>ProjectRepository: Check normalized workspace name
ProjectRepository->>Database: Count non-deleted matching projects
Database-->>ProjectRepository: Count result
ProjectRepository-->>ProjectRoutes: exists boolean
ProjectRoutes-->>Client: Validation response
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
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. Comment |
removed unnecessary pass statement
There was a problem hiding this comment.
Actionable comments posted: 5
🧹 Nitpick comments (2)
docker-compose.local.yml (1)
46-57: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueStandardize indentation.
The indentation for this block is deeper than the standard 2 spaces used in the rest of the file.
🧹 Proposed fix
- osm-rails-worker: - image: opensidewalksdev.azurecr.io/workspaces-osm-rails:dev - environment: - RAILS_ENV: production - SECRET_KEY_BASE: osm_secret_key - WS_OSM_DB_HOST: database - WS_OSM_DB_USER: postgres - WS_OSM_DB_PASS: testing - WS_OSM_DB_NAME: workspaces-osm-local - stdin_open: true - tty: true - command: ["bundle", "exec", "rake", "jobs:work"] + osm-rails-worker: + image: opensidewalksdev.azurecr.io/workspaces-osm-rails:dev + environment: + RAILS_ENV: production + SECRET_KEY_BASE: osm_secret_key + WS_OSM_DB_HOST: database + WS_OSM_DB_USER: postgres + WS_OSM_DB_PASS: testing + WS_OSM_DB_NAME: workspaces-osm-local + stdin_open: true + tty: true + command: ["bundle", "exec", "rake", "jobs:work"]🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docker-compose.local.yml` around lines 46 - 57, Standardize the indentation of the osm-rails-worker service block, including its image, environment, stdin_open, tty, and command entries, to match the file’s existing two-space indentation without changing any values or behavior.README.md (1)
95-101: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winConsider automating database initialization.
The manual steps to create the
workspaces-tasks-localdatabase and enable thepostgisextension can be easily automated, reducing friction for new developers.If you create an initialization script (e.g.,
data/init.sql) with the following contents:CREATE DATABASE "workspaces-tasks-local"; \c "workspaces-tasks-local"; CREATE EXTENSION IF NOT EXISTS postgis;You can then mount it in
docker-compose.local.ymlunder thedatabaseservice volumes to have it run automatically on the first launch:volumes: - ./data/db:/var/lib/postgresql/data - ./data/init.sql:/docker-entrypoint-initdb.d/init.sql🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@README.md` around lines 95 - 101, Automate local database initialization by adding an init SQL script that creates the "workspaces-tasks-local" database, connects to it, and enables the postgis extension, then mount that script under the database service’s initialization directory in docker-compose.local.yml. Remove the README’s manual setup steps and retain only the necessary startup guidance.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@api/src/tasking/projects/repository.py`:
- Around line 655-656: Update the project patch method to check body.description
and add it to the updates mapping when provided, alongside the existing
custom_imagery handling, so valid description PATCH requests are persisted.
In `@api/src/tasking/projects/routes.py`:
- Around line 132-151: Add the required # `@test`: coverage outline comments for
validate_project_name, covering workspace visibility authorization,
whitespace-only name rejection, and project-name existence responses. Place them
alongside the route and follow the repository’s established test-outline format.
In `@docker-compose.local.yml`:
- Around line 59-71: Update the backend service in docker-compose.local.yml to
use consistent two-space indentation and add the WS_OSM_HOST environment
variable pointing to the local osm-rails service, overriding the default osm-web
destination.
In `@README.md`:
- Line 109: Update the README backend URL to use port 8000, matching the host
port configured for the backend in docker-compose.local.yml; do not change the
internal osm-rails port reference.
In `@tests/unit/conftest.py`:
- Around line 178-185: Update FakeProjectRepo’s create, patch, and _response
methods to store, update, and return the custom_imagery and description
attributes, preserving existing field mappings and ensuring values are not
silently discarded.
---
Nitpick comments:
In `@docker-compose.local.yml`:
- Around line 46-57: Standardize the indentation of the osm-rails-worker service
block, including its image, environment, stdin_open, tty, and command entries,
to match the file’s existing two-space indentation without changing any values
or behavior.
In `@README.md`:
- Around line 95-101: Automate local database initialization by adding an init
SQL script that creates the "workspaces-tasks-local" database, connects to it,
and enables the postgis extension, then mount that script under the database
service’s initialization directory in docker-compose.local.yml. Remove the
README’s manual setup steps and retain only the necessary startup guidance.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 810f05e1-e135-44bf-941d-0d879f652f6c
📒 Files selected for processing (12)
.gitignoreREADME.mdalembic_osm/versions/a92361f527ef_custom_imagery_and_description.pyapi/core/config.pyapi/src/tasking/projects/dtos.pyapi/src/tasking/projects/repository.pyapi/src/tasking/projects/routes.pyapi/src/tasking/projects/schemas.pydocker-compose.local.ymltests/integration/test_projects_flow.pytests/unit/conftest.pytests/unit/test_project_routes.py
Tasks completed:
This pull request introduces two major features: support for custom imagery and long descriptions in projects, and a new API endpoint for validating project name uniqueness within a workspace. It also includes updates to the database schema, API models, and comprehensive tests to ensure correct validation and behavior. Additionally, a local development environment using Docker Compose is provided to streamline onboarding and testing.
Project Customization and Validation:
custom_imagery(as JSONB) and a longdescriptionfield (up to 10,000 characters) in thetasking_projectstable and corresponding API models, with full CRUD support and validation to ensure only JSON objects are accepted forcustom_imagery. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]/validate-nameendpoint to check if a project name already exists in a workspace, with tenancy and input validation, and added theProjectNameValidationResponsemodel. [1] [2] [3] [4] [5] [6] [7]Local Development Environment:
docker-compose.local.ymland documentation to enable running the full stack locally, including database, backend, and OSM services, with setup instructions in theREADME.md. [1] [2]Other improvements:
Testing:
These changes enhance the flexibility and reliability of project creation and management, and make local development and testing much easier.
Summary
custom_imageryJSONB and 10,000-characterdescriptionsupport across project schemas, DTOs, persistence, migrations, and validation.GET /validate-nameproject-name validation with tenancy and input checks.data/files from Git.