feat: add pilot database and router - #570
Merged
aldbr merged 34 commits intoAug 5, 2026
Merged
Conversation
Robin-Van-de-Merghel
force-pushed
the
robin-pilot-management
branch
2 times, most recently
from
June 13, 2025 11:19
8c655b0 to
2cfe44a
Compare
Robin-Van-de-Merghel
marked this pull request as draft
June 13, 2025 11:36
Robin-Van-de-Merghel
force-pushed
the
robin-pilot-management
branch
from
June 13, 2025 11:41
2cfe44a to
ce03dc2
Compare
Robin-Van-de-Merghel
force-pushed
the
robin-pilot-management
branch
from
June 15, 2025 06:10
65abf0c to
64aece6
Compare
Robin-Van-de-Merghel
marked this pull request as ready for review
June 15, 2025 06:13
fstagni
reviewed
Jun 17, 2025
Robin-Van-de-Merghel
force-pushed
the
robin-pilot-management
branch
from
June 18, 2025 08:38
da86dca to
109525e
Compare
fstagni
reviewed
Jun 18, 2025
aldbr
reviewed
Jun 23, 2025
Contributor
Author
Where an issue?Whether we have a base router with PossibilitiesSplittingLet's start with the routers themselves. We can separate pilots and users endpoints : That brings us:
Using another approachWe could have a bare base router without dependency injection, with sub routers with # Authenticated parent router
protected_router = APIRouter(dependencies=[Depends(verify_dirac_access_token)])
@protected_router.get("/secure")
def secure_route():
return {"msg": "secure"}
# Public sub-router (no auth)
public_router = APIRouter()
@public_router.get("/public")
def public_route():
return {"msg": "public"}Its goal would be to replacer |
Robin-Van-de-Merghel
force-pushed
the
robin-pilot-management
branch
from
June 25, 2025 09:47
4009683 to
60fb4e6
Compare
Robin-Van-de-Merghel
force-pushed
the
robin-pilot-management
branch
from
June 30, 2025 13:12
0181496 to
315a77b
Compare
Robin-Van-de-Merghel
force-pushed
the
robin-pilot-management
branch
from
July 3, 2025 07:45
dae7268 to
95cf9b4
Compare
Robin-Van-de-Merghel
force-pushed
the
robin-pilot-management
branch
2 times, most recently
from
July 4, 2025 11:48
a9b353d to
4ba2c9b
Compare
fstagni
force-pushed
the
robin-pilot-management
branch
from
July 10, 2026 16:02
070de3e to
afe2c12
Compare
…uters Follows the error-boundary convention introduced in DIRACGrid#988: core exceptions no longer carry http_status_code; the pilot routers catch PilotAlreadyExistsError (409) and PilotNotFoundError (404) instead.
3 tasks
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
JobToPilotMapping has no foreign key in the legacy schema, so the IntegrityError branch mapping FK violations to PilotNotFoundError could never fire. Existence checking stays in the logic layer; the branch can be reintroduced once a FK lands on the DIRAC side (DIRAC#8097). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Remove the PilotStamp index (absent from legacy DIRAC; adding it must go through a DIRAC-side migration with an update-guide entry) and add idx_dest_queue_status, present in legacy since DIRAC v9.1.0. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
POST /api/jobs/jdl and POST /api/pilots/ now return 201 instead of 200, per RFC 9110. Clients regenerated (diracx + gubbins). Breaking for previously released clients, whose generated operations only accept 200 from submit_jdl_jobs. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
HTTP-level tests stub the access policy, so read scoping cannot be exercised through the routes; seed a second VO directly in the DB and assert the logic layer's vo_constraint filters search and summary. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
No route passes job_db/job_ids in this PR; the branch belongs with the future job-to-pilot assignment route (pilot token work) and was untested here. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Mirror the PilotAgents column sizes as max_length on the pilot models so oversized values are rejected with a 422 instead of a backend-dependent database error (strict MySQL raises DataError, SQLite silently accepts). Clients regenerated. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
aldbr
approved these changes
Aug 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Split of #421 , first part : pilot management
closes #960