Skip to content

Commit b7856cf

Browse files
authored
Various small fixes (#294)
* action: Upload results even on failure We'd rather see failures in the report than missing data. Signed-off-by: Jussi Kukkonen <[email protected]> * report generation: Avoid checkmarks if no results available Signed-off-by: Jussi Kukkonen <[email protected]> * report generation: Remove action version for now Currently the action version is incorrect (git describe gives the client tags, not conformance tags). We may want to redo this with a version number from python sources but for now remove it. Signed-off-by: Jussi Kukkonen <[email protected]> * Revert "Bump pytest from 8.4.2 to 9.0.0 (#290)" This reverts commit 183d5af. Somehow the new pytest manages to import things from the client directory whatever action.py does ... revert upgrade for now. Signed-off-by: Jussi Kukkonen <[email protected]> --------- Signed-off-by: Jussi Kukkonen <[email protected]>
1 parent dd1ad2b commit b7856cf

File tree

5 files changed

+11
-26
lines changed

5 files changed

+11
-26
lines changed

.github/scripts/generate_client_report.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import argparse
44
import json
5-
import os
65
from dataclasses import dataclass
76
from datetime import UTC, datetime
87
from pathlib import Path
@@ -19,7 +18,6 @@ class Result:
1918
skipped: int = -1
2019
rekor2_verify: bool = False
2120
rekor2_sign: bool = False
22-
conformance_action_version: str = "unknown"
2321
client_sha: str = ""
2422
client_sha_url: str = ""
2523
workflow_run: str = ""
@@ -35,9 +33,6 @@ def __init__(self, report_path: Path):
3533
self.results_found = True
3634

3735
environment = data.get("environment", {})
38-
self.conformance_action_version = environment.get(
39-
"conformance_action_version", "unknown"
40-
)
4136
self.client_sha = environment.get("client_sha", "")
4237
self.client_sha_url = environment.get("client_sha_url", "")
4338
self.workflow_run = environment.get("workflow_run", "")
@@ -87,7 +82,6 @@ def _generate_html(results: list[Result]):
8782
<th>Xfailed</th>
8883
<th>Rekor v2 verify</th>
8984
<th>Rekor v2 sign</th>
90-
<th>Action Version</th>
9185
</tr>
9286
</thead>
9387
<tbody>
@@ -107,6 +101,9 @@ def _generate_html(results: list[Result]):
107101
if res.workflow_run:
108102
client_html += f' (<a href="{res.workflow_run}">run</a>)'
109103

104+
rekor2_verify = "✅" if res.rekor2_verify else "❌"
105+
rekor2_sign = "✅" if res.rekor2_sign else "❌"
106+
110107
html += f"""
111108
<tr class="{status_class}">
112109
<td>{client_html}</td>
@@ -115,9 +112,8 @@ def _generate_html(results: list[Result]):
115112
<td>{res.failed if res.results_found else ""}</td>
116113
<td>{res.skipped if res.results_found else ""}</td>
117114
<td>{res.xfailed if res.results_found else ""}</td>
118-
<td>{"✅" if res.rekor2_verify else "❌"}</td>
119-
<td>{"✅" if res.rekor2_sign else "❌"}</td>
120-
<td>{res.conformance_action_version}</td>
115+
<td>{rekor2_verify if res.results_found else ""}</td>
116+
<td>{rekor2_sign if res.results_found else ""}</td>
121117
</tr>
122118
"""
123119
html += """

action.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ def _debug(msg):
3030
def _sigstore_conformance(environment: str) -> int:
3131
args = ["--json-report", "--json-report-file=conformance-report.json", "--durations=0"]
3232

33-
34-
3533
if _DEBUG:
3634
args.extend(["-s", "-vv", "--showlocals"])
3735

@@ -53,14 +51,11 @@ def _sigstore_conformance(environment: str) -> int:
5351

5452
status = pytest.main([str(_ACTION_PATH / "test"), *args])
5553

56-
# Inject the action version into the report
54+
# Inject some metadata into the report
5755
with open("conformance-report.json", "r+") as f:
5856
report_data = json.load(f)
5957
if "environment" not in report_data:
6058
report_data["environment"] = {}
61-
report_data["environment"]["conformance_action_version"] = os.getenv(
62-
"GHA_SIGSTORE_CONFORMANCE_ACTION_VERSION", "unknown"
63-
)
6459
client_sha = os.getenv("GHA_SIGSTORE_CONFORMANCE_CLIENT_SHA")
6560
if client_sha:
6661
report_data["environment"]["client_sha"] = client_sha

action.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,6 @@ runs:
5252
echo "::endgroup::"
5353
shell: bash
5454

55-
- name: Get action version
56-
id: get_action_version
57-
run: echo "action_version=$(git describe --tags --always)" >> $GITHUB_OUTPUT
58-
shell: bash
59-
6055
- name: Run sigstore-conformance
6156
id: sigstore-conformance
6257
run: |
@@ -72,11 +67,10 @@ runs:
7267
GHA_SIGSTORE_CONFORMANCE_CLIENT_SHA_URL: "${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}"
7368
GHA_SIGSTORE_CONFORMANCE_WORKFLOW_RUN: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
7469
GHA_SIGSTORE_CONFORMANCE_SELFTEST_BIN: "${{ github.workspace }}/sigstore-conformance-selftest-env/bin/sigstore"
75-
GHA_SIGSTORE_CONFORMANCE_ACTION_VERSION: "${{ steps.get_action_version.outputs.action_version }}"
7670
shell: bash
7771

7872
- name: Upload conformance result
79-
if: ${{ inputs.skip-result-upload == 'false' && inputs.environment == 'production' }}
73+
if: ${{ always() && inputs.skip-result-upload == 'false' && inputs.environment == 'production' }}
8074
uses: actions/upload-artifact@v5
8175
with:
8276
name: conformance-results

requirements.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pytest==9.0.0
1+
pytest==8.4.2
22
pytest-json-report==1.5.0
33
pytest-subtests==0.15.0
44
requests==2.32.5

requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -592,9 +592,9 @@ pygments==2.19.2 \
592592
--hash=sha256:636cb2477cec7f8952536970bc533bc43743542f70392ae026374600add5b887 \
593593
--hash=sha256:86540386c03d588bb81d44bc3928634ff26449851e99741617ecb9037ee5ec0b
594594
# via pytest
595-
pytest==9.0.0 \
596-
--hash=sha256:8f44522eafe4137b0f35c9ce3072931a788a21ee40a2ed279e817d3cc16ed21e \
597-
--hash=sha256:e5ccdf10b0bac554970ee88fc1a4ad0ee5d221f8ef22321f9b7e4584e19d7f96
595+
pytest==8.4.2 \
596+
--hash=sha256:86c0d0b93306b961d58d62a4db4879f27fe25513d4b969df351abdddb3c30e01 \
597+
--hash=sha256:872f880de3fc3a5bdc88a11b39c9710c3497a547cfa9320bc3c5e62fbf272e79
598598
# via
599599
# -r requirements.in
600600
# pytest-json-report

0 commit comments

Comments
 (0)