Skip to content

feature/projects-to-core#1325

Open
geoffjay wants to merge 23 commits into
mainfrom
feature/projects-to-core
Open

feature/projects-to-core#1325
geoffjay wants to merge 23 commits into
mainfrom
feature/projects-to-core

Conversation

@geoffjay

Copy link
Copy Markdown
Owner

No description provided.

@geoffjay geoffjay force-pushed the feature/projects-to-core branch from 09ef249 to 855d41f Compare June 19, 2026 19:18
@geoffjay

geoffjay commented Jun 19, 2026

Copy link
Copy Markdown
Owner Author

This change is part of the following stack:

Change managed by git-spice.

@codecov

codecov Bot commented Jun 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 69.44444% with 110 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.93%. Comparing base (7a644c2) to head (2517ec6).

Files with missing lines Patch % Lines
crates/cli/src/commands/admin.rs 50.40% 61 Missing ⚠️
crates/orchestrator/src/client.rs 59.09% 27 Missing ⚠️
crates/mcp/src/tools/orchestrator_debug.rs 0.00% 6 Missing ⚠️
crates/cli/src/main.rs 0.00% 5 Missing ⚠️
crates/core/src/api/projects.rs 95.50% 4 Missing ⚠️
crates/common/src/config.rs 50.00% 2 Missing ⚠️
crates/mcp/src/client.rs 0.00% 2 Missing ⚠️
ui/src/services/core.ts 33.33% 2 Missing ⚠️
ui/src/components/knowledge/ProjectPicker.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1325      +/-   ##
==========================================
+ Coverage   49.19%   49.93%   +0.74%     
==========================================
  Files         468      472       +4     
  Lines       31606    31777     +171     
  Branches     3121     3171      +50     
==========================================
+ Hits        15547    15867     +320     
+ Misses      16027    15878     -149     
  Partials       32       32              
Flag Coverage Δ
frontend 69.13% <25.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

geoffjay added 10 commits June 21, 2026 09:30
Adds the canonical `projects` entity to the core crate following the
existing `organizations` pattern:

- `entity/project.rs`: SeaORM Model with id, name, description,
  organization_id, created_at, updated_at fields
- `migration/m20260616_000004_create_projects_table.rs`: creates the
  projects table with unique index on name and index on organization_id
- `project_storage.rs`: ProjectStorage with create/get_by_id/get_by_name/
  list/list_org/list_paginated/update/delete; list_org includes NULL
  org rows for tenant-transition compatibility
- Registers project in entity/mod.rs, migration/mod.rs, storage.rs,
  and lib.rs

Closes #1308
Add AuthUser extractor to all five handlers to enforce authentication
on every endpoint. Without it any unauthenticated caller could read,
create, update, and delete projects.

Also add empty-name validation to update_project_handler (mirrors the
guard already present in create_project_handler) so whitespace-only
names are rejected with 400 on PUT as well as POST.

Update all 19 tests to include Bearer tokens obtained via /auth/register
and add explicit 401-unauthenticated tests for each HTTP method.

Note: in-memory pagination in list_projects_handler (list_org + skip/take)
is a known scaling cliff flagged by the reviewer; a follow-up
list_org_paginated storage method is needed.

Closes #1309
- Delete ProjectStorage struct and all methods from storage.rs
- Delete model_to_project helper
- Remove project_entity import from storage.rs
- Remove project_storage() accessor from manager.rs
- Remove GET/POST /projects and GET/PUT/DELETE /projects/{id} routes
- Remove list_projects, create_project, get_project, update_project, delete_project handlers
- Remove ps.get() existence checks from all association handlers
- Remove pub mod project from entity/mod.rs (unused after dropping checks)
- Add allow(dead_code) to project types in types.rs (kept for client.rs compat until #1311 lands)
- Update CLI admin SCOPED_TABLES: move projects from orchestrator to core
@geoffjay geoffjay force-pushed the feature/projects-to-core branch from 37d5c9d to 421b064 Compare June 21, 2026 16:33
geoffjay and others added 6 commits June 22, 2026 09:58
feat: repoint MCP tools and UI project calls to core
- Fix delete_project docstring: core does not enforce association
  constraints server-side, so add a client-side pre-check that queries
  list_project_agents and list_project_workflows before deleting
- Replace core_url(path) helper with url_for(path, use_core: bool) to
  reduce duplication; extract URL-based implementations (get_url,
  post_url, put_url, delete_url, delete_with_response_url) that both
  *_core and regular wrappers delegate to
- Add unit tests for url_for fallback logic using a struct-literal
  url_only_client helper to avoid reqwest TLS init in test threads

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
feat: repoint Rust client and CLI project commands to core
epic: Phase 4 - Repoint project consumers to core (#1307)
Core handler tests:
- Add test_list_projects_with_tenant_header_scopes_results to verify
  X-Tenant-ID scoping on GET /api/v1/projects (org-filtered + NULL rows
  vs. unscoped list returning all)

Orchestrator association tests (new file):
- crates/orchestrator/tests/project_associations_http.rs: 9 tests
  covering POST/DELETE agent and workflow associations, 404 on missing
  agent/workflow, and behavior when project ID does not exist in core

CLI integration tests:
- Add project_tests module to crates/cli/tests/integration_test.rs
  with mockito tests verifying CRUD routes to core URL, association
  routes to orchestrator URL, and delete_project pre-check behavior

Documentation:
- README: add agentd-core to port table (17000/7000), update description
  to mention project management, add project management CLI entry, add
  v0.15.0 migration status section with operator upgrade note
- docs/storage.md: add service-to-table ownership table with note that
  projects moved from orchestrator to core in v0.15.0

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
feat: add project migration tests and update documentation
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.

1 participant