From 1b4356b66a5e3a015f367fd343163577d290fa5d Mon Sep 17 00:00:00 2001 From: chariri Date: Thu, 21 May 2026 21:08:24 +0900 Subject: [PATCH] fix(ci): bad pyinfra type coverage report comments (#36482) --- .github/workflows/pyrefly-type-coverage-comment.yml | 4 ++-- .github/workflows/pyrefly-type-coverage.yml | 4 ++++ api/controllers/service_api/index.py | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pyrefly-type-coverage-comment.yml b/.github/workflows/pyrefly-type-coverage-comment.yml index 52c16f3153..2fe9aa591d 100644 --- a/.github/workflows/pyrefly-type-coverage-comment.yml +++ b/.github/workflows/pyrefly-type-coverage-comment.yml @@ -63,8 +63,8 @@ jobs: id: render run: | comment_body="$(uv run --directory api python libs/pyrefly_type_coverage.py \ - --base base_report.json \ - < pr_report.json)" + --base "$GITHUB_WORKSPACE/base_report.json" \ + < "$GITHUB_WORKSPACE/pr_report.json")" { echo "### Pyrefly Type Coverage" diff --git a/.github/workflows/pyrefly-type-coverage.yml b/.github/workflows/pyrefly-type-coverage.yml index eae8debf1a..915e406b57 100644 --- a/.github/workflows/pyrefly-type-coverage.yml +++ b/.github/workflows/pyrefly-type-coverage.yml @@ -65,6 +65,9 @@ jobs: # Save structured data for the fork-PR comment workflow cp /tmp/pyrefly_report_pr.json pr_report.json cp /tmp/pyrefly_report_base.json base_report.json + # Keep fork-PR comments correct while the trusted workflow_run job is + # still using the default-branch renderer, which resolves --base from api/. + cp /tmp/pyrefly_report_base.json api/base_report.json - name: Save PR number run: | @@ -77,6 +80,7 @@ jobs: path: | pr_report.json base_report.json + api/base_report.json pr_number.txt - name: Comment PR with type coverage diff --git a/api/controllers/service_api/index.py b/api/controllers/service_api/index.py index 31151b5f9f..41f8ef53a5 100644 --- a/api/controllers/service_api/index.py +++ b/api/controllers/service_api/index.py @@ -11,7 +11,7 @@ register_response_schema_models(service_api_ns, IndexInfoResponse) @service_api_ns.route("/") class IndexApi(Resource): @service_api_ns.response(200, "Success", service_api_ns.models[IndexInfoResponse.__name__]) - def get(self): + def get(self) -> dict[str, str]: return { "welcome": "Dify OpenAPI", "api_version": "v1",