Skip to content

refactor(wording): rename collection → capture set in public-facing strings#1245

Merged
mihow merged 5 commits intomainfrom
worktree-backend-wording
Apr 17, 2026
Merged

refactor(wording): rename collection → capture set in public-facing strings#1245
mihow merged 5 commits intomainfrom
worktree-backend-wording

Conversation

@mihow
Copy link
Copy Markdown
Collaborator

@mihow mihow commented Apr 17, 2026

Summary

Aligns backend-surfaced terminology with the UI's "Capture Set" rename. Only public-facing strings are changed; internal identifiers stay as "collection" to avoid breaking API clients and to skip migrations.

What changed

  • Log messages (ami/tasks.py, ami/main/models.py, ami/jobs/models.py)
  • Auto-generated job names — e.g. Populate captures for capture set {pk}, Post-processing: SmallSizeFilter on Capture Set {pk}, Export occurrences for capture set {pk} (ami/main/api/views.py, ami/main/admin.py, ami/exports/views.py, ami/jobs/models.py)
  • SourceImageCollectionPopulateJob.name displayed as job type in UI
  • API/OpenAPI docstrings on SourceImageCollectionViewSet, its populate/add/remove actions, star/unstar actions, and filter classes (OccurrenceCollectionFilter, TaxonCollectionFilter)
  • DRF field label source_image_collection_id → "Capture Set"
  • Error/validation messagesValueError, ValidationError, admin messages, 400 responses in exports

What intentionally did NOT change

  • Python class names (SourceImageCollection, SourceImageCollectionPopulateJob, etc.)
  • Variable, method, field, and related-name identifiers
  • DB schema and migrations
  • JobType.key = "populate_captures_collection" (stored as DB identifier)
  • Query param names (collection_id, collection) and response keys ("collection") — would break UI/API consumers
  • Permission codenames and verbose names — would require a migration for the verbose-name change, and per-discussion the codenames are fine as internal references
  • Test fixtures and CLI helper text

Incidental

Includes one small chore commit fixing a pre-existing flake8 E202 in ami/tasks.py (stray space inside an f-string) so the pre-commit hook passes.

Test plan

  • Verify new job-type name "Populate capture set" appears correctly in the Jobs UI
  • Trigger the populate / add / remove endpoints and confirm log output and auto-generated job names use "capture set"
  • Trigger an export with and without a capture-set filter — confirm 400 error messages read correctly and the auto-named export job uses "capture set"
  • Run the Django admin actions on SourceImageCollection (populate, populate async, Small Size Filter) — confirm flash messages read correctly
  • Regenerate the OpenAPI schema and spot-check the collection_id param description and affected viewset docstrings

mihow and others added 2 commits April 16, 2026 23:43
Co-Authored-By: Claude <noreply@anthropic.com>
…trings

Updates user-visible strings to match the "Capture Set" terminology used in
the UI. Covers log messages, auto-generated job names, API/OpenAPI docstrings,
DRF field labels, admin action messages, and error/validation messages.

Internal identifiers (class names, variables, DB fields, JobType keys, query
param names, response keys, permission codenames) are unchanged to avoid
breaking API clients or requiring migrations.

Co-Authored-By: Claude <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 17, 2026 06:44
@netlify
Copy link
Copy Markdown

netlify bot commented Apr 17, 2026

Deploy Preview for antenna-preview canceled.

Name Link
🔨 Latest commit 8486771
🔍 Latest deploy log https://app.netlify.com/projects/antenna-preview/deploys/69e1df129104c9000827f4f1

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 17, 2026

Deploy Preview for antenna-ssec canceled.

Name Link
🔨 Latest commit 8486771
🔍 Latest deploy log https://app.netlify.com/projects/antenna-ssec/deploys/69e1df12aa33b10008f6680d

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 17, 2026

Warning

Rate limit exceeded

@mihow has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 56 minutes and 27 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 56 minutes and 27 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1921d51e-f78b-4bee-96cd-6f488a668ad2

📥 Commits

Reviewing files that changed from the base of the PR and between 201cfa7 and 8486771.

📒 Files selected for processing (7)
  • ami/exports/views.py
  • ami/jobs/models.py
  • ami/jobs/serializers.py
  • ami/main/admin.py
  • ami/main/api/views.py
  • ami/main/models.py
  • ami/tasks.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch worktree-backend-wording

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
Copy Markdown
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 PR updates backend public-facing terminology from “collection” to “capture set” to align with the UI rename, while keeping internal identifiers unchanged to avoid API and schema breakage.

Changes:

  • Updated user-visible strings in logs, admin messages, error/validation responses, and auto-generated job names to say “capture set”.
  • Updated API/OpenAPI docstrings and parameter descriptions to use “capture set” wording.
  • Updated DRF field label for source_image_collection_id to display as “Capture Set”.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
ami/tasks.py Updates task log strings; includes a small formatting cleanup in an f-string.
ami/main/models.py Updates a log message for default collection creation to “capture set”.
ami/main/api/views.py Updates action/viewset docstrings, job names, validation message text, and filter descriptions to “capture set”.
ami/main/admin.py Updates Django admin action flash messages and queued job names to “capture set”.
ami/jobs/serializers.py Updates the browsable API label for source_image_collection_id to “Capture Set”.
ami/jobs/models.py Updates SourceImageCollectionPopulateJob display name and related log/error strings to “capture set”.
ami/exports/views.py Updates 400 error messages and export job naming to “capture set”.

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

Comment thread ami/tasks.py Outdated
Comment thread ami/main/api/views.py Outdated
Comment thread ami/tasks.py Outdated
mihow and others added 3 commits April 17, 2026 00:14
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
populate_collection and regroup_events called Manager.get() and then checked
if the result was truthy — but Manager.get() raises DoesNotExist for a missing
ID, so the else branches were unreachable and the tasks crashed with an
uncaught exception instead of logging a clean not-found message. Switch to
try/except DoesNotExist.

Co-Authored-By: Claude <noreply@anthropic.com>
… docstrings

Follow-on to the collection → capture set rename. Updates the API/OpenAPI
docstrings this PR already touched so the full sentence matches UI
terminology. Also fixes a missing possessive ("their detections'") in the
OccurrenceCollectionFilter docstring, caught in review.

Co-Authored-By: Claude <noreply@anthropic.com>
@mihow mihow merged commit 585cd55 into main Apr 17, 2026
7 checks passed
@mihow mihow deleted the worktree-backend-wording branch April 17, 2026 07:24
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