Skip to content

Commit cac4b51

Browse files
committed
gha-matrix: add short hash-free name to matrix items for job labels
The GHA job name was `matrix.desc`, which for artifacts is `name=version` (version carrying the source/patch/config/revision content hashes), e.g. `uboot-bananapim7-vendor=2017.09-S39cd-P1ff0-...`. Those hashes are the OCI cache identity, but in the Actions UI they're just noise. Add a separate, hash-free `name` to every matrix item (artifacts: `artifact_name`; images: `image_file_id`) so workflows can label jobs with the readable name while `desc`/`invocation` keep the full hashed identity. Backward compatible: `desc` is unchanged, this only adds a field. Signed-off-by: Igor Pecovnik <igor@armbian.com>
1 parent e096863 commit cac4b51

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

lib/tools/info/output-gha-matrix.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ def generate_matrix_images(info) -> list[dict]:
8787
continue
8888

8989
desc = f"{image['image_file_id']} {image_id}"
90+
# Short, hash-free label for the GHA job name (desc keeps the full id for logs).
91+
name = image['image_file_id']
9092

9193
inputs = image['in']
9294

@@ -96,7 +98,7 @@ def generate_matrix_images(info) -> list[dict]:
9698
cmds = (armbian_utils.map_to_armbian_params(inputs["vars"], True) + inputs["configs"]) # image build is "build" command, omitted here
9799
invocation = " ".join(cmds)
98100

99-
item = {"desc": desc, "runs_on": runs_on, "invocation": invocation}
101+
item = {"desc": desc, "name": name, "runs_on": runs_on, "invocation": invocation}
100102
matrix.append(item)
101103
return matrix
102104

@@ -113,6 +115,8 @@ def generate_matrix_artifacts(info):
113115
artifact_name = artifact['in']['artifact_name']
114116

115117
desc = f"{artifact['out']['artifact_name']}={artifact['out']['artifact_version']}"
118+
# Short, hash-free label for the GHA job name (desc keeps name=version+hashes).
119+
name = artifact['out']['artifact_name']
116120

117121
inputs = artifact['in']['original_inputs']
118122

@@ -127,7 +131,7 @@ def generate_matrix_artifacts(info):
127131
cmds = (["artifact"] + armbian_utils.map_to_armbian_params(inputs["vars"], True) + inputs["configs"])
128132
invocation = " ".join(cmds)
129133

130-
item = {"desc": desc, "runs_on": runs_on, "invocation": invocation}
134+
item = {"desc": desc, "name": name, "runs_on": runs_on, "invocation": invocation}
131135
matrix.append(item)
132136
return matrix
133137

@@ -187,7 +191,7 @@ def generate_matrix_artifacts(info):
187191
if len(chunk) == 0:
188192
log.warning(f"Chunk '{i + 1}' for '{type_gen}' is empty, adding fake invocation.")
189193
chunks[i] = [
190-
{"desc": "Fake matrix element so matrix is not empty", "runs_on": "ubuntu-latest", "invocation": "none", "really": "no",
194+
{"desc": "Fake matrix element so matrix is not empty", "name": "Empty chunk", "runs_on": "ubuntu-latest", "invocation": "none", "really": "no",
191195
"shost": "no", "fdepth": "1"}
192196
]
193197
else:

0 commit comments

Comments
 (0)