Skip to content

Commit 06d2a0e

Browse files
authored
Fix ghost-diffs (no-map, but actually no-secrets) (#50)
1 parent a3e08a6 commit 06d2a0e

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

.github/actions/atlas-render/render.sh

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,22 @@ fi
150150
echo "snapshot_dir=$SNAPSHOT_DIR" >> "$GITHUB_OUTPUT"
151151

152152
# ── Sidedump directory ──────────────────────────────────────────────────────
153-
if [ -n "${ATLAS_SIDEDUMP_MAP_DIR:-}" ]; then
153+
# Backfill empty map files for releases that had no secrets. The redaction
154+
# pipeline only writes a sidedump when the replacement map is non-empty, so
155+
# secret-free releases (e.g. rook-ceph) get no file. The replay step treats
156+
# a missing file as "old ATLAS version — suppress diff", which causes ghost
157+
# entries. An empty JSON object signals "no secrets, safe to diff".
158+
if [ -n "${ATLAS_SIDEDUMP_MAP_DIR:-}" ] && [ -d "$SNAPSHOT_DIR" ]; then
159+
while IFS= read -r templates_dir; do
160+
[ -z "$templates_dir" ] && continue
161+
release_dir="$(dirname "$(dirname "$templates_dir")")"
162+
release_path="${release_dir#"$SNAPSHOT_DIR"/}"
163+
map_file="${ATLAS_SIDEDUMP_MAP_DIR}/${release_path}.json"
164+
if [ ! -f "$map_file" ]; then
165+
mkdir -p "$(dirname "$map_file")"
166+
echo '{}' > "$map_file"
167+
fi
168+
done < <(find "$SNAPSHOT_DIR" -type d -name templates 2>/dev/null | sort -u)
154169
echo "sidedump_dir=$ATLAS_SIDEDUMP_MAP_DIR" >> "$GITHUB_OUTPUT"
155170
fi
156171

0 commit comments

Comments
 (0)