Skip to content

Feature local setup#62

Merged
susrisha merged 6 commits into
developfrom
feature-local-setup
Jul 14, 2026
Merged

Feature local setup#62
susrisha merged 6 commits into
developfrom
feature-local-setup

Conversation

@susrisha

@susrisha susrisha commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Tasks completed:

  • Task 4028: Implement Imagery inclusion in TM
  • Task 3984: [Frontend] Workspaces Tasking Manager: Implement Edit Project

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:

  • Added support for storing custom_imagery (as JSONB) and a long description field (up to 10,000 characters) in the tasking_projects table and corresponding API models, with full CRUD support and validation to ensure only JSON objects are accepted for custom_imagery. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]
  • Introduced a /validate-name endpoint to check if a project name already exists in a workspace, with tenancy and input validation, and added the ProjectNameValidationResponse model. [1] [2] [3] [4] [5] [6] [7]

Local Development Environment:

  • Added docker-compose.local.yml and documentation to enable running the full stack locally, including database, backend, and OSM services, with setup instructions in the README.md. [1] [2]

Other improvements:

  • Updated settings to ignore unknown environment variables for better compatibility.

Testing:

  • Added and updated integration and unit tests for the new features, including edge cases for validation and tenancy. [1] [2] [3] [4] [5]

These changes enhance the flexibility and reliability of project creation and management, and make local development and testing much easier.

Summary

  • Added custom_imagery JSONB and 10,000-character description support across project schemas, DTOs, persistence, migrations, and validation.
  • Added workspace-scoped GET /validate-name project-name validation with tenancy and input checks.
  • Added unit and integration coverage for new fields, imagery validation, name validation, and tenancy behavior.
  • Added Docker Compose local development services and README setup instructions.
  • Configured settings to ignore unknown environment variables and excluded local data/ files from Git.

susrisha added 4 commits July 14, 2026 11:24
- 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
@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@susrisha, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 43 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e5e72f70-38fa-493e-a5b6-ccc819b33262

📥 Commits

Reviewing files that changed from the base of the PR and between 49c11b6 and 1129280.

📒 Files selected for processing (3)
  • README.md
  • alembic_osm/versions/a92361f527ef_custom_imagery_and_description.py
  • api/src/tasking/projects/repository.py
📝 Walkthrough

Walkthrough

Tasking 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.

Changes

Project management updates

Layer / File(s) Summary
Project attribute contract and persistence
alembic_osm/versions/..., api/src/tasking/projects/{schemas,dtos,repository}.py
Adds nullable custom_imagery and description fields across database, DTO, response, create, patch, and mapping paths.
Project-name validation endpoint
api/src/tasking/projects/{routes,repository}.py, tests/{unit,integration}/...
Adds normalized, tenancy-checked /validate-name handling and tests for existing, missing, blank, and outsider cases.
Local development stack and setup
docker-compose.local.yml, README.md, .gitignore, api/core/config.py
Adds local service orchestration, setup instructions, data/ exclusion, and ignored unknown settings.

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
Loading

Suggested reviewers: mashb, sujata-m

Poem

A rabbit hops through fields of JSON,
With names checked bright from dusk till dawn.
Compose stacks rise, migrations sing,
Descriptions bloom on every thing.
Validation nibbles errors away—
“All clear!” says Bun at close of day.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 70.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title is too vague and does not clearly describe the main changes, which include project fields, name validation, and local development setup. Use a specific title that names the primary change, such as adding project custom imagery/description and name validation, or local development support.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Comment thread alembic_osm/versions/a92361f527ef_custom_imagery_and_description.py Fixed
Comment thread alembic_osm/versions/a92361f527ef_custom_imagery_and_description.py Fixed
Comment thread alembic_osm/versions/a92361f527ef_custom_imagery_and_description.py Dismissed
Comment thread alembic_osm/versions/a92361f527ef_custom_imagery_and_description.py Dismissed
Comment thread alembic_osm/versions/a92361f527ef_custom_imagery_and_description.py Dismissed
Comment thread alembic_osm/versions/a92361f527ef_custom_imagery_and_description.py Dismissed
sujata-m
sujata-m previously approved these changes Jul 14, 2026
removed unnecessary pass statement

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🧹 Nitpick comments (2)
docker-compose.local.yml (1)

46-57: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Standardize 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 win

Consider automating database initialization.

The manual steps to create the workspaces-tasks-local database and enable the postgis extension 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.yml under the database service 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

📥 Commits

Reviewing files that changed from the base of the PR and between d041797 and 49c11b6.

📒 Files selected for processing (12)
  • .gitignore
  • README.md
  • alembic_osm/versions/a92361f527ef_custom_imagery_and_description.py
  • api/core/config.py
  • api/src/tasking/projects/dtos.py
  • api/src/tasking/projects/repository.py
  • api/src/tasking/projects/routes.py
  • api/src/tasking/projects/schemas.py
  • docker-compose.local.yml
  • tests/integration/test_projects_flow.py
  • tests/unit/conftest.py
  • tests/unit/test_project_routes.py

Comment thread api/src/tasking/projects/repository.py
Comment thread api/src/tasking/projects/routes.py
Comment thread docker-compose.local.yml
Comment thread README.md Outdated
Comment thread tests/unit/conftest.py
@susrisha
susrisha requested a review from sujata-m July 14, 2026 11:14
@susrisha
susrisha merged commit 5b1127e into develop Jul 14, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants