Skip to content

fix(ui): processing service details link and endpoint URL in form#1198

Merged
mihow merged 5 commits into
mainfrom
feat/processing-service-ui-tweaks
Apr 1, 2026
Merged

fix(ui): processing service details link and endpoint URL in form#1198
mihow merged 5 commits into
mainfrom
feat/processing-service-ui-tweaks

Conversation

@mihow

@mihow mihow commented Apr 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Pass projectId to useProcessingServiceDetails hook for project-scoped queries
  • Make endpoint_url optional in processing service creation form (pull-mode services register themselves)
  • Fix async service status display: show ONLINE when lastSeenLive is true instead of always UNKNOWN -- Still has the problem that all processing services that share an auth token will share the same online/offline state.
  • Normalize empty endpoint_url to null across frontend, serializer, and DB
    • Frontend: "" → null in form submit handler
    • Serializer: allow_null=True, allow_blank=False rejects empty strings at the API boundary
    • Data migration converts any existing "" rows to NULL
    • QuerySet filters simplified to endpoint_url__isnull only

Extracted from #1194 — standalone UI and data-consistency improvements.

Screenshots

Pull & push services showing online status
image

Endpoint no longer required
image

How to test

Processing service details dialog:

  1. Navigate to a project → Processing Services
  2. Click a processing service name to open the details dialog
  3. Verify the dialog loads correctly and shows service info

Optional endpoint URL (pull-mode services):

  1. Create a new processing service, leave "Endpoint URL" blank
  2. Save — should succeed (field sent as null, not "")
  3. Edit the service, confirm the endpoint field is empty, save again

Async service status:

  1. If you have an async/pull-mode service that has checked in recently, verify it shows "ONLINE" status
  2. A pull-mode service that has never checked in should show "UNKNOWN"

Migration:

docker compose run --rm django python manage.py migrate ml 0028

Tests:

docker compose -f docker-compose.ci.yml run --rm django python manage.py test ami.ml --keepdb

Co-Authored-By: Claude noreply@anthropic.com

…nal endpoint URL

- Add projectId parameter support to useProcessingServiceDetails hook
- Pass project context when fetching service details in dialog
- Make endpoint_url field optional with updated description for pull-mode services
- Fix async service status display logic to check lastSeenLive instead of always returning UNKNOWN

Co-Authored-By: Claude <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 1, 2026 17:39
@netlify

netlify Bot commented Apr 1, 2026

Copy link
Copy Markdown

Deploy Preview for antenna-ssec ready!

Name Link
🔨 Latest commit 14e92c7
🔍 Latest deploy log https://app.netlify.com/projects/antenna-ssec/deploys/69cd75fcf0820e0008da6d1f
😎 Deploy Preview https://deploy-preview-1198--antenna-ssec.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Apr 1, 2026

Copy link
Copy Markdown

Deploy Preview for antenna-preview ready!

Name Link
🔨 Latest commit 14e92c7
🔍 Latest deploy log https://app.netlify.com/projects/antenna-preview/deploys/69cd75fc5081ba0008297918
😎 Deploy Preview https://deploy-preview-1198--antenna-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 73 (🟢 up 7 from production)
Accessibility: 97 (🟢 up 17 from production)
Best Practices: 92 (🔴 down 8 from production)
SEO: 100 (🟢 up 8 from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Apr 1, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Processing service handling is enhanced with project-scoped queries via an optional projectId parameter in the details hook. Async service status detection now reflects heartbeat state. Endpoint URL validation is relaxed for pull-mode services, and form configuration is updated accordingly.

Changes

Cohort / File(s) Summary
Hook Enhancement
ui/src/data-services/hooks/processing-services/useProcessingServiceDetails.ts, ui/src/pages/processing-service-details/processing-service-details-dialog.tsx
Added optional projectId parameter to hook signature; query key now includes projectId; request URL conditionally appends ?project_id=<projectId>; updated hook invocation to pass projectId.
Service Status Logic
ui/src/data-services/models/processing-service.ts
Async service status now returns 'ONLINE' when lastSeenLive is true, otherwise 'UNKNOWN', instead of always returning 'UNKNOWN'.
Form Validation
ui/src/pages/project/entities/details-form/processing-service-details-form.tsx
Removed required: true from endpoint_url field and updated its description to allow empty value for pull-mode self-registering services.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I hop with a query in paw, bright and spry,
I scope projects and listen when heartbeats cry,
I welcome services that pull and arrive,
I loosen the leash on an endpoint's shy drive,
I nibble on changes — a joyful rabbit's sigh.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The PR title 'fix(ui): processing service details link and endpoint URL in form' directly describes the main changes: fixing processing service details linking with project context and making endpoint URL optional.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The PR description includes all key sections: Summary with clear bullet points, detailed descriptions of changes, How to Test section with specific instructions, Screenshots, and Migration steps.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/processing-service-ui-tweaks

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 and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR makes small UI improvements around processing services: it scopes the processing service details query by project, allows creating pull-mode services without an endpoint URL, and corrects async service status display based on heartbeat.

Changes:

  • Pass projectId into useProcessingServiceDetails to support project-scoped processing service detail queries.
  • Make endpoint_url optional in the processing service details form for pull-mode services.
  • Fix async processing service status to show ONLINE when lastSeenLive is true.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
ui/src/pages/project/entities/details-form/processing-service-details-form.tsx Removes required validation for endpoint_url and updates helper text for pull-mode services.
ui/src/pages/processing-service-details/processing-service-details-dialog.tsx Passes projectId into the details hook from route params.
ui/src/data-services/models/processing-service.ts Derives async status from lastSeenLive (heartbeat) instead of always UNKNOWN.
ui/src/data-services/hooks/processing-services/useProcessingServiceDetails.ts Adds optional projectId support via ?project_id=... and includes it in the query key.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@ui/src/data-services/hooks/processing-services/useProcessingServiceDetails.ts`:
- Around line 24-25: Prettier formatting is failing in
useProcessingServiceDetails.ts; run the project's formatter (e.g., npm/yarn
prettier --write) or your editor's format command on the file and commit the
changes so lines like the queryKey: [API_ROUTES.PROCESSING_SERVICES,
processingServiceId, projectId], and url:
`${API_URL}/${API_ROUTES.PROCESSING_SERVICES}/${processingServiceId}/${params}`,
conform to the repo's prettier rules; ensure the hook
useProcessingServiceDetails.ts is saved after formatting and no lint/CI warnings
remain.

In
`@ui/src/pages/processing-service-details/processing-service-details-dialog.tsx`:
- Around line 17-18: Prettier formatting issues in
processing-service-details-dialog.tsx are causing CI to fail; run your project's
formatter (e.g., npm run format or npx prettier --write) on
ui/src/pages/processing-service-details/processing-service-details-dialog.tsx
(or run your editor's format command) to fix whitespace/linebreaks around the
useProcessingServiceDetails import/usage and save the file so the CI Prettier
check passes.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3952f96b-b2c8-4518-bd84-d5d772783d07

📥 Commits

Reviewing files that changed from the base of the PR and between ed8f857 and 037ef14.

📒 Files selected for processing (4)
  • ui/src/data-services/hooks/processing-services/useProcessingServiceDetails.ts
  • ui/src/data-services/models/processing-service.ts
  • ui/src/pages/processing-service-details/processing-service-details-dialog.tsx
  • ui/src/pages/project/entities/details-form/processing-service-details-form.tsx

Comment thread ui/src/data-services/hooks/processing-services/useProcessingServiceDetails.ts Outdated
Comment thread ui/src/pages/processing-service-details/processing-service-details-dialog.tsx Outdated
@mihow mihow changed the title feat(ui): processing service details project context and optional endpoint URL fix(ui): processing service details link and endpoint URL in form Apr 1, 2026
mihow and others added 4 commits April 1, 2026 12:10
Co-Authored-By: Claude <noreply@anthropic.com>
The form, serializer, and model now all enforce a single convention:
endpoint_url is either a valid URL string or NULL, never an empty string.

- Frontend: normalize "" → null in form submit handler
- Serializer: allow_null=True, allow_blank=False rejects "" at API boundary
- Model: save() guard converts "" → None for admin/shell usage
- QuerySet: simplified async/sync filters to use isnull only

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
@mihow mihow merged commit b8133cd into main Apr 1, 2026
9 of 11 checks passed
@mihow mihow deleted the feat/processing-service-ui-tweaks branch April 1, 2026 23:53
@mihow mihow added the PSv2 Async & distributed ML backend (PSv2): job state, NATS dispatch, result handling. Umbrella #515. label Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PSv2 Async & distributed ML backend (PSv2): job state, NATS dispatch, result handling. Umbrella #515.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants