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:
52
app/demo.py
52
app/demo.py
@@ -69,6 +69,9 @@ class DemoPulpClient:
|
||||
return _VERSIONS.get(version_href, {})
|
||||
|
||||
def get_repo(self, uuid: str) -> dict[str, Any]:
|
||||
for r in _REPOS:
|
||||
if r["pulp_href"].rstrip("/").endswith(uuid):
|
||||
return {**r, "remote": "/pulp/api/v3/remotes/rpm/rpm/demo/"}
|
||||
return {"remote": "/pulp/api/v3/remotes/rpm/rpm/demo/"}
|
||||
|
||||
def sync_repo(self, uuid: str, remote_href: str) -> str:
|
||||
@@ -81,3 +84,52 @@ class DemoPulpClient:
|
||||
"progress_reports": [{"done": 120, "total": 120}],
|
||||
"created_resources": ["/pulp/api/v3/repositories/rpm/rpm/demo/versions/9/"],
|
||||
}
|
||||
|
||||
def list_versions(self, uuid: str) -> list[dict[str, Any]]:
|
||||
base = f"/pulp/api/v3/repositories/rpm/rpm/{uuid}/versions/"
|
||||
return [
|
||||
{
|
||||
"pulp_href": base + "1/",
|
||||
"pulp_created": "2026-05-02T01:00:00Z",
|
||||
"content_summary": {
|
||||
"present": {"rpm.package": {"count": 4500}},
|
||||
"added": {"rpm.package": {"count": 4500}},
|
||||
"removed": {},
|
||||
},
|
||||
},
|
||||
{
|
||||
"pulp_href": base + "2/",
|
||||
"pulp_created": "2026-05-28T04:30:00Z",
|
||||
"content_summary": {
|
||||
"present": {"rpm.package": {"count": 4700}},
|
||||
"added": {"rpm.package": {"count": 250}},
|
||||
"removed": {"rpm.package": {"count": 50}},
|
||||
},
|
||||
},
|
||||
{
|
||||
"pulp_href": base + "3/",
|
||||
"pulp_created": "2026-06-15T02:11:00Z",
|
||||
"content_summary": {
|
||||
"present": {"rpm.package": {"count": 4821}},
|
||||
"added": {"rpm.package": {"count": 130}},
|
||||
"removed": {"rpm.package": {"count": 9}},
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
def list_distributions(self) -> list[dict[str, Any]]:
|
||||
# 저장소별 현재 배포 버전 (publication href 에 uuid-버전 인코딩)
|
||||
deployed = {"0001": 2, "0002": 1, "0003": 3, "0004": 1}
|
||||
return [
|
||||
{"publication": f"/pulp/api/v3/publications/rpm/rpm/{u}-{v}/"}
|
||||
for u, v in deployed.items()
|
||||
]
|
||||
|
||||
def get_publication(self, publication_href: str) -> dict[str, Any]:
|
||||
tail = publication_href.rstrip("/").split("/")[-1] # "0001-2"
|
||||
uuid, number = tail.split("-")
|
||||
return {
|
||||
"repository_version": (
|
||||
f"/pulp/api/v3/repositories/rpm/rpm/{uuid}/versions/{number}/"
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user