validate-and-fix

โดย openshift

รันไปป์ไลน์การตรวจสอบแบบเต็ม (make test-unit, make verify, make test-integration) และแก้ไขข้อผิดพลาดเล็กน้อยโดยอัตโนมัติ เช่น การฟอร์แมตด้วย black อิมพอร์ตที่ไม่ได้ใช้ และ...

npx skills add https://github.com/openshift/lightspeed-service --skill validate-and-fix

Validate & Auto-Fix

Run the project validation pipeline, auto-fix trivial issues, and re-run until green or a real failure is found.

Rules

  • Never modify production logic to fix a test. Only fix test expectations, imports, formatting, and lint.
  • Never skip or delete a failing test.
  • Stop after 3 auto-fix cycles to avoid loops.
  • Report real failures clearly; do not attempt speculative fixes.

Step 0: Ensure Dependencies Are Installed

make install-deps 2>&1 | tail -10

This ensures the virtualenv matches the lockfile. Skipping this step is the most common cause of spurious import errors (e.g. llama-index-embeddings-huggingface not found despite being in requirements.txt).

Step 1: Run Unit Tests

make test-unit 2>&1 | tail -40

If all pass, proceed to Step 3 (integration tests). If failures occur, classify each failure (see Step 2).

Step 2: Classify and Fix Failures

For each failure, determine its type:

Auto-fixable (fix immediately, then re-run Step 1):

TypeFix
Missing await on async callAdd await, mark test async def, add @pytest.mark.asyncio
Test asserts old default valueUpdate assertion to match new default

Real failures (do not auto-fix):

  • Logic errors in production code
  • Assertion failures reflecting actual behavior changes
  • Import errors from missing dependencies
  • Failures in code you did not modify

For real failures: report the test name, file, and error summary, then stop.

Step 3: Run Integration Tests

make test-integration 2>&1 | tail -20

Integration test failures are almost always real failures. Report and stop.

Step 4: Run Verify

make verify 2>&1 | tail -30

This runs: black --check, ruff, woke, pylint, mypy.

If failures occur, apply the same classify-and-fix logic from Step 2. Common fixes at this stage:

TypeFix
Black formattinguv run black .
Unused import (ruff F401)Remove the import
Unused variable (ruff F841)Remove the assignment
Unused noqa directive (RUF100)Remove the noqa comment
Other ruff-fixableuv run ruff check . --fix
Pylint issues from changed codeFix inline

Re-run make verify after each fix. Proceed to Step 5 when green.

Step 5: Report

Report exactly:

  • make test-unit: X passed / Y failed
  • make verify: pass/fail (list any remaining issues)
  • make test-integration: X passed / Y failed
  • Auto-fixes applied (list each: file, what was fixed)
  • Cycles used: N/3

Do not include unrelated diagnostics or suggestions.

Skills เพิ่มเติมจาก openshift

openshift-docs
openshift
ค้นหาและอ่านเอกสารประกอบ OpenShift Container Platform ในรูปแบบ markdown ใช้เมื่อผู้ใช้ถามเกี่ยวกับฟีเจอร์ การกำหนดค่า การติดตั้ง… ของ OpenShift
triage-leaked-infra
openshift
ประเมินว่า AWS VPC หรือชุดโครงสร้างพื้นฐานจาก HyperShift CI ปลอดภัยที่จะลบหรือไม่ ใช้เมื่อผู้ใช้วาง cleanleaked output และถามว่า 'ลบอันนี้ได้ไหม?', 'มัน...
openshift-expert
openshift
ผู้เชี่ยวชาญด้านแพลตฟอร์ม OpenShift และ Kubernetes ที่มีความรู้เชิงลึกเกี่ยวกับสถาปัตยกรรมคลัสเตอร์ โอเปอเรเตอร์ เครือข่าย พื้นที่จัดเก็บข้อมูล การแก้ไขปัญหา และไปป์ไลน์ CI/CD ใช้…
Konflux Archived PipelineRuns
openshift
เข้าถึง Konflux PipelineRuns, TaskRuns และบันทึกพ็อดที่ถูกเก็บถาวรผ่าน KubeArchive ใช้โดยอัตโนมัติเมื่อตรวจสอบผลลัพธ์ของ Konflux PipelineRun หรือสืบสวน...
backport
openshift
ย้อนกลับคอมมิตหรือ PR จาก main ไปยัง release branch ใช้เมื่อผู้ใช้ขอให้ย้อนกลับ, cherry-pick, หรือพอร์ตการเปลี่ยนแปลงระหว่าง branch หรือเมื่อกำลังแก้ไข…
rebase
openshift
รีเบสสาขาปัจจุบันไปยังสาขาหลัก แก้ไขข้อขัดแย้งทั้งหมด และตรวจสอบว่า lint, i18n และ build ผ่าน ใช้เมื่อผู้ใช้ขอให้รีเบส อัปเดต หรือซิงค์…
Build CPO Image
openshift
สร้างและพุชอิมเมจคอนเทนเนอร์ control-plane-operator ใช้โดยอัตโนมัติเมื่อทดสอบการเปลี่ยนแปลง CPO ที่ต้องปรับใช้กับคลัสเตอร์ที่ใช้งานจริง
find-complexity
openshift
ค้นหาฟังก์ชันและเมธอดที่มีความซับซ้อนของไซโคลเมติกสูง ความยาวมากเกินไป หรือมีพารามิเตอร์มากเกินไป ใช้เมื่อผู้ใช้ขอให้ค้นหาโค้ดที่ซับซ้อน ความซับซ้อน…