Skip to content

Comments

fix: include pipeline_slug in MinimalJobSerializer#1148

Merged
mihow merged 2 commits intomainfrom
fix/minimal-job-serializer-pipeline-slug
Feb 21, 2026
Merged

fix: include pipeline_slug in MinimalJobSerializer#1148
mihow merged 2 commits intomainfrom
fix/minimal-job-serializer-pipeline-slug

Conversation

@mihow
Copy link
Collaborator

@mihow mihow commented Feb 21, 2026

Summary

  • The MinimalJobSerializer (used for ids_only=1 job list responses) was returning only ["id"]
  • ADC workers fetch jobs with ids_only=1 and expect pipeline_slug in the response to know which pipeline to run
  • Without it, Pydantic validation fails on the worker side and the job is skipped — images sit in NATS with no pickup

Adds pipeline_slug (sourced from pipeline.slug) to the minimal response.

Test plan

  • Verify GET /api/v2/jobs/?ids_only=1&project_id=84 returns pipeline_slug for each job
  • Confirm ADC worker successfully registers and pulls tasks after deploy

Summary by CodeRabbit

  • Enhancements
    • Job API responses now include pipeline slug information, allowing clients to directly identify and reference the associated pipeline. This improves data clarity and makes it easier to link jobs to their pipelines in UIs and integrations without changing existing identifiers.

The ADC worker fetches jobs with ids_only=1 and expects pipeline_slug in
the response to know which pipeline to run. Without it, Pydantic
validation fails and the worker skips the job.

Co-Authored-By: Claude <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings February 21, 2026 04:42
@netlify
Copy link

netlify bot commented Feb 21, 2026

Deploy Preview for antenna-ssec canceled.

Name Link
🔨 Latest commit 4019f28
🔍 Latest deploy log https://app.netlify.com/projects/antenna-ssec/deploys/699938af9cdae900089ddd56

@netlify
Copy link

netlify bot commented Feb 21, 2026

Deploy Preview for antenna-preview canceled.

Name Link
🔨 Latest commit 4019f28
🔍 Latest deploy log https://app.netlify.com/projects/antenna-preview/deploys/699938af57bf450008149b67

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 21, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

The MinimalJobSerializer in ami/jobs/serializers.py was extended with a read-only pipeline_slug field sourced from pipeline.slug, and the serializer's Meta.fields was updated from ["id"] to ["id", "pipeline_slug"].

Changes

Cohort / File(s) Summary
Serializer Field Enhancement
ami/jobs/serializers.py
Added pipeline_slug read-only field to MinimalJobSerializer sourced from pipeline.slug; updated Meta.fields from ["id"] to ["id", "pipeline_slug"].

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A slug from the pipeline we now reveal,
One tiny field makes data more ideal,
Simple and clean, our serializer grows,
Just a touch more—that's how it goes! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding pipeline_slug to MinimalJobSerializer, which is the core modification in the changeset.
Description check ✅ Passed The description covers key required sections including Summary, context for the change, and a Test plan; though some optional sections like Detailed Description and Deployment Notes are minimal, the essential information is present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/minimal-job-serializer-pipeline-slug

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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds pipeline_slug to the MinimalJobSerializer to enable ADC (Antenna Data Collection) workers to identify which pipeline to run when fetching jobs with the ids_only=1 parameter. The workers were experiencing Pydantic validation failures because this field was missing from the minimal response.

Changes:

  • Adds pipeline_slug field to MinimalJobSerializer (sourced from pipeline.slug)
  • Updates the serializer's Meta.fields to include the new field
  • Removes an outdated comment about adding fields when needed

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

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@mihow mihow merged commit e06dd22 into main Feb 21, 2026
6 checks passed
@mihow mihow deleted the fix/minimal-job-serializer-pipeline-slug branch February 21, 2026 04:47
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

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

Inline comments:
In `@ami/jobs/serializers.py`:
- Line 161: The pipeline_slug CharField (source="pipeline.slug", read_only=True)
is being skipped when pipeline is null because DRF raises SkipField during
dotted attribute traversal; update the field to accept nulls so the key is
emitted (e.g., add allow_null=True, and optionally set default=None) on the
pipeline_slug serializers.CharField to ensure jobs with no pipeline return
"pipeline_slug": null instead of omitting the key.

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