Pipeline run pages return 500 for a schedule whose pipeline is not registered
維護者通常 1 天內回覆
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 85/100
研究方向
從 vulnerabilities/models.py 中的 PipelineSchedule.pipeline_class 開始,接著追蹤它在 PipelineRunListView、PipelineRunDetailView 以及 PipelineRun.pipeline_url 中的使用。執行 vulnerabilities/tests/test_view.py 中新增的 PipelineRunViewsUnregisteredPipelineTestCase;對於未註冊的 pipeline,當兩個執行頁面都回傳 200,並將其 id 顯示為頁面名稱時,即表示完成。
由索引模型根據 Issue 內容生成。
描述
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.
- 主要語言
- Python
- 星號
- 719
- 分支
- 359
- 平均合併
- 11 小時 59 分鐘
- 30 天內合併 PR
- 2
環境準備
- 提供 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 沒有貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
aboutcode-org/vulnerablecode 的其他 Issue
-
Affected-by-advisories v2 page returns 500 for a purl with no matching package可能已有人在做 @sanchit955 於 2 天前認領。 未關閉
難度 1/5 1 小時以內 新手友好度 88/100
aboutcode-org/vulnerablecode#2501 ·
維護者通常 1 天內回覆
-
OSV v3 parser shares introduced/fixed commit patches across affected packages可能已有人在做 @Celestial-0 於 15 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 84/100
aboutcode-org/vulnerablecode#2489 ·
維護者通常 1 天內回覆
-
OSV parser drops all crates.io affected entries because the ecosystem mapping uses cargo可能已有人在做 @Ashutosh-Panda2004 於 22 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 76/100
aboutcode-org/vulnerablecode#2485 · 1 則留言 ·
維護者通常 1 天內回覆
-
Docker Compose setup fails on wait-for-it host web:8000 and missing runtime .env可能已有人在做 @Anurag-S1ngh 於 25 天前認領。 未關閉
難度 2/5 半天 新手友好度 77/100
aboutcode-org/vulnerablecode#2477 · 1 則留言 ·
維護者通常 1 天內回覆
-
OVAL parser corrupts version bounds when the epoch is 10, 20 or the version contains "0:"可能已有人在做 @Ashutosh-Panda2004 於 23 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 76/100
aboutcode-org/vulnerablecode#2474 · 1 則留言 ·
維護者通常 1 天內回覆
查看 aboutcode-org/vulnerablecode 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 76/100
GoogleCloudPlatform/professional-services-data-validator#1899 ·
維護者通常 4 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
mohanraj00/entelos#200 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 68/100
-
sweep
難度 2/5 1-3 小時 新手友好度 85/100
bketelsen/truenas-mcp#77 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 86/100
sandbox-quantum/switch#2163 ·
維護者通常 1 天內回覆