Fix submodule detection, the CleanupArtifacts NameError and the skippable Bandit scan - #246
Merged
Conversation
Up to standards ✅🟢 Issues
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #246 +/- ##
=======================================
Coverage 82.22% 82.22%
=======================================
Files 1 1
Lines 45 45
Branches 9 9
=======================================
Hits 37 37
Misses 4 4
Partials 4 4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Paebbels
force-pushed
the
claude/workflow-fixes
branch
from
August 2, 2026 19:48
0443fff to
5808758
Compare
Paebbels
commented
Aug 3, 2026
Paebbels
force-pushed
the
claude/workflow-fixes
branch
from
August 3, 2026 22:55
5808758 to
91378e7
Compare
**`PrepareJob.yml`: submodules were never detected.** The check tested for a file named `.gitsubmodules`; Git's file is `.gitmodules`. `has_submodules` was therefore always `'false'` and `git_submodule_count`, `git_submodule_names` and `git_submodule_paths` kept their initial empty values for every repository. The block already had the correct name in a local variable one line below, which is now used for the test as well. Verified against a scratch repository with two submodules: ``` has_submodules=true count=2 names=libA:libB paths=deps/libA:deps/libB ``` and `has_submodules=false` once the file is removed. **`CleanupArtifacts.yml`: an unknown artifact ID raised `NameError`.** Both compute steps call `printf(...)` in their `case _:` fallback, but the step runs `shell: python`, where `printf` is not a function. An `artifact-json-ids` entry that is not a key of the JSON dictionary - a typo, or a key removed from `Parameters.yml` while a consumer still lists it - aborted the step with `NameError: name 'printf' is not defined` instead of reporting the name. That is precisely the case the branch exists for. Reproduced against the previous revision (exit code 1, `NameError`) and against this one: ``` Name 'typo_key' not found in JSON dictionary. Artifact to delete: pyX-UnitTestReportSummary-XML-* pyX-Packages ``` `_Checking_CleanupArtifacts.yml` now passes an `unknown_key` entry, so the branch is exercised by the verification pipeline. **`CheckCodeQuality.yml`: the security scan could be skipped silently.** The `Bandit` step was guarded by `if: inputs.artifact != ''`, although the step writes its report to a fixed path and never used that parameter. An empty artifact name skipped the scan while the job still reported success. The guard is removed; the scan now runs whenever the job runs. Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
Paebbels
force-pushed
the
claude/workflow-fixes
branch
from
August 3, 2026 22:57
91378e7 to
828b7bf
Compare
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New Features
Changes
@r7consumers need no adjustment.CheckCodeQuality.yml'sartifactinput is now unused. It is kept declared, because removing an input from a stable release branch breaks every consumer that passes it —CompletePipelinedoes. See the note at the bottom.Bug Fixes
PrepareJob.yml: submodules were never detected. The check tested for a file named.gitsubmodules; Git's file is.gitmodules.has_submoduleswas therefore always'false', andgit_submodule_count,git_submodule_namesandgit_submodule_pathskept their initial empty values — for every repository, since the workflow was introduced.The block already had the correct name in a local variable one line below:
The variable is now assigned first and used for the test.
Verified against a scratch repository with two submodules:
and
has_submodules=falseonce.gitmodulesis removed.Nothing consumes these four outputs today, which is why nobody hit it. It matters as soon as a pipeline wants to check out submodules conditionally.
CleanupArtifacts.yml: an unknown artifact ID raisedNameError. Both compute steps callprintf(...)in theircase _:fallback, but the step runsshell: python, whereprintfis not a function:So an
artifact-json-idsentry that is not a key of the JSON dictionary — a typo, or a key removed fromParameters.ymlwhile a consumer still lists it — aborted the step instead of reporting the name. That is precisely the case the branch exists for.Reproduced against the previous revision of the step:
and against this one:
The second run also confirms that a
#-commented entry is still skipped and that the prefix/postfix forms still resolve.CheckCodeQuality.yml: the security scan could be skipped silently. TheBanditstep was guarded byif: inputs.artifact != '', although the step writes its report to a fixed path (report/bandit/report.xml) and never used that parameter. An empty artifact name skipped the scan, while the job installed bandit, ran to the end and reported success — a green security check that scanned nothing.artifactis declaredrequired: true, but GitHub does not enforce required inputs that arrive as an empty string from an expression, which is how a consumer would realistically pass one.The guard is removed. The scan now runs whenever the job runs, i.e. whenever
bandit: 'true'.Documentation
.. attention::notes; those notes are removed in that pull-request's branch, since this one makes them obsolete. The two pull-requests are independent, but both should land — see the note below.Unit Tests
_Checking_CleanupArtifacts.ymlnow passes anunknown_keyentry, so thecase _:branch is exercised by the verification pipeline rather than only by a typo in production.The
PrepareJobsubmodule logic was executed offline against a scratch repository, in both states (.gitmodulespresent and absent) — output quoted above. The Actions repository itself has no submodules, so its own pipeline cannot cover the positive case.Both changed shell scripts pass
bash -n, and all four changed workflows parse as YAML.The
CheckCodeQualitychange is covered by this repository's own pipeline:_Checking_JobTemplates.ymlinstantiates the template, and the Bandit findings inmyPackage/myFrameworkare deliberate, so the step must run and report them.Review (2026-08-03)
No description of past defects in the source. The three explanatory comments I had added — why
.gitsubmoduleswas wrong, why theif:on the Bandit step is gone, what theunknown_keyentry exercises — are removed. A fix belongs in the commit message and in this description; the code should read as if the defect never existed. The comment in_Checking_CleanupArtifacts.ymlis reduced to the reviewer's one-liner,# Deliberate added 'unknown_key' for exception testing.The diff is now four hunks, all of them the actual change.
The
unknown_keyregression entry is kept, pending the reviewer's decision. It does not test for a typo: it covers thecase _:branch, which is documented behaviour ("A key that is not present in the dictionary is reported and skipped") and is reachable without any typo — a key removed fromParameters.ymlwhile a consumer on@r7still lists it. Becauseshell: pythonaborts the whole step, an unknown ID meant no artifact of that set was deleted, not "one entry skipped". One line to drop if unwanted.The submodule block was re-verified after the edit, since removing the comments touched that hunk:
has_submodules=true count=2 names=libA:libB paths=deps/libA:deps/libBagainst a scratch repository with two submodules,falsewith empty outputs once.gitmodulesis removed.Related Issues and Pull-Requests
Note
CheckCodeQuality.yml'sartifactinput is now referenced nowhere. It is declaredrequired: true, so it cannot be dropped without breaking consumers that pass it on@r7. Two options for a later major release: remove it, or give it a purpose by uploading the bandit XML report under that name. Left as is here, because either choice is an interface decision rather than a bug fix.