[hermes] soteria: go:S1192 #73
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
SonarQube reports go:S1192 in
internal/k8s/job_manifests.go. The build is green; this is a standing finding, not a failure.What is wrong
The string literal "/cache" is duplicated three times in job_manifests.go: as the cache volume MountPath in buildBackupJob, as the cache volume MountPath in buildRestoreJob, and as the RESTIC_CACHE_DIR value in resticEnv. If the cache path ever changes, the three sites can drift apart silently, which is exactly what go:S1192 guards against.
Ariadne opened no pull request for it: no automated patch was possible for this finding.
Facts
internal/k8s/job_manifests.go:45)Suggested fix (not applied)
Hermes could not open a pull request for this, so the change below was not written, validated, or pushed anywhere. It is a starting point for whoever picks this up, not a reviewed patch.
internal/k8s/job_manifests.go— Declare a single package-level constant for the restic cache directory and reference it at all three duplication sites. Add the constant after the import block, then replace the literal in the backup job's VolumeMounts, the restore job's VolumeMounts, and the RESTIC_CACHE_DIR env var in resticEnv. The rendered manifests are byte-for-byte identical, so behaviour is unchanged. The "/cache/restore" paths inside restoreCommand are a different literal and are not flagged, so they are intentionally left alone.Links
/api/admin/audit/events, event typeshermes_autotriage_incidentandhermes_autotriage_diagnosis.Filed automatically by Ariadne from a Hermes Agent diagnosis (run run_8f21a5d14845447eb706c88ff8e4493c). Hermes has no write access to this repository; no files or infrastructure were changed.