feat: version list with verification + deployed badge (stage 3)

- pulp_client: list_versions / list_distributions / get_publication
- GET /repos/{uuid}/versions: 버전 목록 페이지(최신순)
- 현재 운영 배포 버전 판별: Distribution→publication→repository_version 역추적
- views.build_version_view: vN, 생성일시, 패키지 수, 증감(+/-), 검증 배지, 배포 여부
- views.verification_detail: gpgcheck/repo-gpgcheck/checksum 상세 (화면4)
- 대시보드 저장소명 → 버전 페이지 링크, [이 버전 배포] 버튼은 단계4용 placeholder
- 단계1 TODO(배포 버전 역추적) 해소

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-17 11:15:31 +09:00
parent 6c41b89c53
commit 72c75252d3
12 changed files with 419 additions and 5 deletions

View File

@@ -101,3 +101,37 @@ def test_task_progress_failed_surfaces_error():
p = views.task_progress({"state": "failed", "error": {"description": "boom"}})
assert p["failed"] is True
assert p["error"] == "boom"
def test_build_version_view_with_deltas_and_deploy_flag():
version = {
"pulp_href": "/pulp/api/v3/repositories/rpm/rpm/x/versions/3/",
"pulp_created": "2026-06-01T00:00:00Z",
"content_summary": {
"present": {"rpm.package": {"count": 4821}},
"added": {"rpm.package": {"count": 130}},
"removed": {"rpm.package": {"count": 9}},
},
}
gpg = {"level": "pass", "label": "검증됨"}
v = views.build_version_view(version, deployed_number=3, gpg=gpg)
assert v["number"] == 3
assert v["package_count"] == 4821
assert (v["added"], v["removed"]) == (130, 9)
assert v["is_deployed"] is True
assert v["gpg"]["level"] == "pass"
def test_build_version_view_not_deployed():
version = {"pulp_href": "/pulp/api/v3/repositories/rpm/rpm/x/versions/2/"}
v = views.build_version_view(version, deployed_number=3)
assert v["is_deployed"] is False
assert v["added"] == 0 and v["removed"] == 0
def test_verification_detail():
repo = {"repo_config": {"gpgcheck": 1, "repo-gpgcheck": 0}}
d = views.verification_detail(repo)
assert d["gpgcheck"] == 1
assert d["repo_gpgcheck"] == 0
assert d["status"]["level"] == "warn"