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

Đang mở Phù hợp với người mới
#152 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

  • #154 của @Chouffe — đã đóng, không merge

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
78/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
python
Lĩnh vực
api, backend

Hướng nghiên cứu

Bắt đầu tại scripts/data_transfer/ingestion/platform/import.py, khoảng các dòng 803-809, và so sánh với tiền lệ --no-stage-update trong pull_sequence_annotations.py. Chạy lệnh clone được cung cấp với --skip-source-stage-update và xác minh rằng các sequence được import cục bộ mà không gọi update_source_annotations_stage() trên source; xem xét các ghi chú kiểm thử cục bộ trong Makefile và README nếu có.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
TypeScript
Star
0
Fork
1
Merge trung bình
2 ngày 6 giờ
Pull request đã merge (30 ngày)
4

Chuẩn bị môi trường

  • Có Dockerfile hoặc tệp Docker Compose
  • Không có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của pyronear/pyro-annotator

Tất cả issue của pyronear/pyro-annotator

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.