pyronear / pyronear/pyro-annotator

feat(scripts): read-only clone mode — add --skip-source-stage-update to import.py (pull-sequences)

Open Beginner friendly
#152 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
0
Forks
1
Avg merge
1d 2h
Merged PRs (30d)
2

Description

Finding

make pull-sequences (clone mode of scripts/data_transfer/ingestion/platform/import.py) is not read-only against the source API: after a successful clone it PATCHes every cloned sequence's annotation on the source to under_annotation (update_source_annotations_stage(), called at import.py:803-809) to "claim" the sequences for workflow A.

That behavior is correct for the production annotation workflow, but it makes it impossible to hydrate a local API from the remote for testing/debugging without mutating remote state:

  • There is no flag to skip the source stage update.
  • --dry-run skips the source update but also skips the import itself, so it can't be used for hydration.
  • The equivalent flag exists in the pipeline-B pull script (pull_sequence_annotations.py --no-stage-update, read-only export) — but not in import.py.

Proposal

Add a --skip-source-stage-update flag to import.py (mirroring the --no-stage-update precedent) that guards the update_source_annotations_stage() call, so clone mode can run read-only against the source:

uv run python -m scripts.data_transfer.ingestion.platform.import \
  --source-annotation-url https://annotationapi.pyronear.org \
  --url-api-annotation http://localhost:5050 \
  --max-sequences 10 \
  --clone-processing-stage ready_to_annotate \
  --skip-source-stage-update

Optionally expose it through the Makefile (e.g. make pull-sequences READ_ONLY_SOURCE=1) and mention it in the README's local-testing notes.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in scripts/data_transfer/ingestion/platform/import.py around lines 803-809 and compare the --no-stage-update precedent in pull_sequence_annotations.py. Run the provided clone command with --skip-source-stage-update and verify sequences are imported locally without calling update_source_annotations_stage() on the source; consider the Makefile and README local-testing notes if included.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.