Skip to content

fix: dùng setup-uv ở job verify và tăng thời gian chờ PyPI index - #13

Merged
WindowScary321 merged 1 commit into
mainfrom
fix/release-verify-uv
Nov 18, 2026
Merged

WindowScary321 merged 1 commit into
mainfrom
fix/release-verify-uv

Conversation

@WindowScary321

Copy link
Copy Markdown
Owner

Tóm tắt thay đổi

Sửa hai lỗi hạ tầng khiến job verify trong pipeline phát hành (Run 44247642348 của tag v0.2.0) thất bại dù package đã được upload thành công lên PyPI:

  • .github/workflows/publish.yml & .github/workflows/testpypi.yml (job verify):
    • Thay actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 (# v6) bằng astral-sh/setup-uv@94527f2e458b27549849d47d273a16bec83a01e9 (# v7, version: "0.13.0", enable-cache: false) và chạy qua uv run --no-project --python "${{ matrix.python-version }}" python -I scripts/smoke_index.py .... Khắc phục lỗi The version '3.9' with architecture 'x64' was not found for Ubuntu 26.04 khi ubuntu-latest chạy trên Ubuntu 26.04 LTS.
    • Tăng --delay của scripts/smoke_index.py từ 10 giây lên 20 giây (--attempts 6 --delay 20, tổng cửa sổ chờ tối đa 100 giây) để tránh lỗi sớm khi CDN của PyPI chưa đồng bộ xong trong khoảng 60 giây đầu sau upload.

Bằng chứng & Rủi ro merge

  • Trước sửa (Run 44247642348): job Upload đúng file còn thiếu qua Trusted Publishing đã success, nhưng verify thất bại ở PyPI / Python 3.9 / ubuntu-latest (thiếu Python 3.9 trên Ubuntu 26.04) và PyPI / Python 3.11 / {ubuntu,windows}-latest (CDN chưa kịp đồng bộ trong 50 giây đầu).
  • Sau sửa (local): uv run --locked --group ci python -m unittest tests/test_release_workflows.py tests/test_smoke_index.py tests/test_ci_scope.py -v đạt 47/47 test (exit 0); git diff --check exit 0.
  • Phạm vi ảnh hưởng: Chỉ đổi 2 workflow YAML ở job verify; không sửa code package myfap/, không mở thêm quyền cho publish/release và dễ hoàn tác.

@WindowScary321

Copy link
Copy Markdown
Owner Author

Sau commit 0d862be: dùng setup-uv cho job verify và tăng thời gian chờ PyPI CDN

Commit: 0d862be

Thay đổi chính

  • .github/workflows/publish.yml (+6/-3): chuyển bước cài Python trong job verify sang astral-sh/setup-uv@94527f2e458b27549849d47d273a16bec83a01e9 (version: "0.13.0", enable-cache: false), chạy smoke_index.py bằng uv run --no-project --python "${{ matrix.python-version }}" và tăng --delay 20.
  • .github/workflows/testpypi.yml (+6/-3): đồng bộ cấu hình astral-sh/setup-uv, uv run --no-project --python và --delay 20 cho job verify tương ứng.

Kiểm tra đã chạy

  • uv run --locked --group ci python -m unittest tests/test_release_workflows.py tests/test_smoke_index.py tests/test_ci_scope.py -v: 47/47 đạt, exit 0 (kiểm tra cấu trúc/bảo mật workflow publish.yml, testpypi.yml, ci.yml, logic smoke_index.py và chính sách ci_scope.py).
  • git diff --check và git diff --cached --check: exit 0.
  • uv run --locked --group ci python <skills-dir>/vietnamese-tech-writing/scripts/validate_copy.py <pr-text> --register eng-readme: 0 error, 0 warning, exit 0.
  • Kiểm tra quét diff & nội dung PR: không chứa đường dẫn tuyệt đối trên máy, thông tin cá nhân hay credential.

Giới hạn

  • Các test workflow trong tests/test_release_workflows.py kiểm tra nội dung YAML và logic inline trên giả lập offline; chưa kích hoạt lại publish.yml / testpypi.yml thực tế (sẽ được kiểm chứng đầy đủ ở lần chạy tag/dispatch tiếp theo).
  • Đang chờ GitHub Actions chạy workflow Kiểm tra cho PR này sau khi push.

@WindowScary321
WindowScary321 merged commit 3c01c8e into main Nov 18, 2026
11 checks passed
@WindowScary321
WindowScary321 deleted the fix/release-verify-uv branch November 18, 2026 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant