Pipeline run pages return 500 for a schedule whose pipeline is not registered
Maintainer thường phản hồi trong vòng 1 ngày
Đá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
- 85/100
Hướng nghiên cứu
Bắt đầu với PipelineSchedule.pipeline_class trong vulnerabilities/models.py, sau đó lần theo nơi nó được dùng trong PipelineRunListView và PipelineRunDetailView, cũng như trong PipelineRun.pipeline_url. Chạy PipelineRunViewsUnregisteredPipelineTestCase mới trong vulnerabilities/tests/test_view.py; hoàn tất khi cả hai trang chạy pipeline đều trả về 200 đối với một pipeline chưa đăng ký và hiển thị id của pipeline làm tên trang.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
PipelineSchedule rows persist in the database. When a pipeline is removed or renamed (for example the open "Remove v1 code" work), every stale schedule's run pages crash:
GET /pipelines/<pipeline_id>/runs/→ 500GET /pipelines/<pipeline_id>/run/<uuid>/→ 500
Evidence
PipelineSchedule.pipeline_class (vulnerabilities/models.py) does a bare dict lookup, pipeline_registry[self.pipeline_id], which raises KeyError for an id that is no longer registered. Both PipelineRunListView.get_context_data and PipelineRunDetailView.get_context_data dereference it (pipeline_class.__name__), and the run detail template also reaches it through PipelineRun.pipeline_url when the run has a commit recorded.
Reproduced locally on PostgreSQL 16 with a schedule and a run using pipeline_id="hunt_probe_no_such_pipeline": both pages 500 with KeyError: 'hunt_probe_no_such_pipeline'. The dashboard list page is not affected — its template never calls pipeline_class.
Fix
pipeline_classreturnsNonefor an unregistered id (.get()instead of[]);descriptionalready guards on a falsy class.- Both views fall back to the raw
pipeline_idas the page name when the class is unknown. pipeline_urlreturnsNonewhen the class is unknown, so the detail template's commit link degrades cleanly.
Tests
New PipelineRunViewsUnregisteredPipelineTestCase in vulnerabilities/tests/test_view.py: both pages return 200 with the pipeline id as the name for an unregistered pipeline. Both tests fail on unmodified main and pass with the fix. Full test_view.py: 14 passed (1 pre-existing flaky timing failure in test_aggregate_fixed_and_affected_packages, fails on main too); pipeline model tests 10 passed.
- Ngôn ngữ chính
- Python
- Star
- 719
- Fork
- 359
- Merge trung bình
- 11 giờ 59 phút
- Pull request đã merge (30 ngày)
- 2
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
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của aboutcode-org/vulnerablecode
-
Affected-by-advisories v2 page returns 500 for a purl with no matching packageCó thể đã có người làm @sanchit955 đã nhận 2 ngày trước. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
aboutcode-org/vulnerablecode#2501 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
OSV v3 parser shares introduced/fixed commit patches across affected packagesCó thể đã có người làm @Celestial-0 đã nhận 15 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
aboutcode-org/vulnerablecode#2489 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
OSV parser drops all crates.io affected entries because the ecosystem mapping uses cargoCó thể đã có người làm @Ashutosh-Panda2004 đã nhận 22 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
aboutcode-org/vulnerablecode#2485 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Docker Compose setup fails on wait-for-it host web:8000 and missing runtime .envCó thể đã có người làm @Anurag-S1ngh đã nhận 25 ngày trước. Đang mở
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 77/100
aboutcode-org/vulnerablecode#2477 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
OVAL parser corrupts version bounds when the epoch is 10, 20 or the version contains "0:"Có thể đã có người làm @Ashutosh-Panda2004 đã nhận 23 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
aboutcode-org/vulnerablecode#2474 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của aboutcode-org/vulnerablecode
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
GoogleCloudPlatform/professional-services-data-validator#1899 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
mohanraj00/entelos#200 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Dead url in mise.tomlĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
-
sweep
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
bketelsen/truenas-mcp#77 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Console writes URL credentials to the local log, though AGENTS.md says secrets never reach diskĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
sandbox-quantum/switch#2163 ·
Maintainer thường phản hồi trong vòng 1 ngày