Skip to content

Commit 1e4feaf

Browse files
authored
chore: optionally provide more verbose details about which plugins are skipped from the csv generation (RHIDP-4196), so it's clear that techdocs plugins are not in the csv (but are in the supported / tech preview tables) (#1277)
Signed-off-by: Nick Boldt <[email protected]>
1 parent 60da29f commit 1e4feaf

File tree

1 file changed

+29
-11
lines changed

1 file changed

+29
-11
lines changed

modules/dynamic-plugins/rhdh-supported-plugins.sh

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,10 @@ for j in $jsons; do
228228
# as discussed in RHDH SOS on Jul 14, we are now opening the door for TP plugins to be on by default.
229229
# PM (Ben) and Support (Tim) are cool with this as long as the docs clearly state
230230
# what is TP, and how to disable the TP content
231-
echo -e "${blue}[WARNING]: $Plugin is enabled by default but is only $Support_Level ${norm}" | tee -a ${ENABLED_PLUGINS}.errors
231+
echo -e "${blue}[WARN] $Plugin is enabled by default but is only $Support_Level ${norm}" | tee -a ${ENABLED_PLUGINS}.errors
232232
echo "* \`${Plugin}\`" >> "$ENABLED_PLUGINS"
233233
else
234-
echo -e "${red}[ERROR]: $Plugin should not be enabled by default as its support level is $Support_Level${norm}" | tee -a ${ENABLED_PLUGINS}.errors
234+
echo -e "${red}[ERROR] $Plugin should not be enabled by default as its support level is $Support_Level${norm}" | tee -a ${ENABLED_PLUGINS}.errors
235235
fi
236236
fi
237237

@@ -295,28 +295,42 @@ for j in $jsons; do
295295
echo
296296
done
297297

298+
c=0
299+
if [[ $QUIET -eq 0 ]]; then
300+
echo "Creating .csv ..."
301+
fi
302+
298303
# create .csv file with header
299304
echo -e "\"Name\",\"Plugin\",\"Role\",\"Version\",\"Support Level\",\"Path\",\"Required Variables\",\"Default\"" > "${0/.sh/.csv}"
300305

301306
num_plugins=()
302307
# append to .csv and .adocN files
303308
rm -f "${0/.sh/.adoc1}"
304309
sorted=(); while IFS= read -rd '' key; do sorted+=( "$key" ); done < <(printf '%s\0' "${!adoc1[@]}" | sort -z)
305-
for key in "${sorted[@]}"; do
306-
echo -e "${adoc1[$key]}" >> "${0/.sh/.ref-rh-supported-plugins}"
307-
if [[ $key != *"techdocs"* ]]; then
310+
if [[ $sorted ]] ;then
311+
for key in "${sorted[@]}"; do
312+
(( c = c + 1 ))
313+
if [[ $QUIET -eq 0 ]]; then echo " * [$c] $key [ supported-plugins ] = ${csv[$key]}"; fi
314+
echo -e "${adoc1[$key]}" >> "${0/.sh/.ref-rh-supported-plugins}"
315+
# RHIDP-4196 omit techdocs plugins from the .csv
316+
if [[ $key != *"techdocs"* ]]; then
308317
echo -e "${csv[$key]}" >> "${0/.sh/.csv}"
309-
fi
310-
done
318+
else
319+
if [[ $QUIET -eq 0 ]]; then echo -e "${blue} [WARN] Omit plugin $key from .csv file${norm}"; fi
320+
fi
321+
done
322+
fi
311323
num_plugins+=(${#adoc1[@]})
312324

313325
rm -f "${0/.sh/.adoc2}"
314326
sorted=(); while IFS= read -rd '' key; do sorted+=( "$key" ); done < <(printf '%s\0' "${!adoc2[@]}" | sort -z)
315327
# shellcheck disable=SC2128
316328
if [[ $sorted ]] ;then
317329
for key in "${sorted[@]}"; do
318-
echo -e "${adoc2[$key]}" >> "${0/.sh/.ref-rh-tech-preview-plugins}";
319-
echo -e "${csv[$key]}" >> "${0/.sh/.csv}"
330+
(( c = c + 1 ))
331+
if [[ $QUIET -eq 0 ]]; then echo " * [$c] $key [ tech-preview-plugins ] = ${csv[$key]}"; fi
332+
echo -e "${adoc2[$key]}" >> "${0/.sh/.ref-rh-tech-preview-plugins}";
333+
echo -e "${csv[$key]}" >> "${0/.sh/.csv}"
320334
done
321335
fi
322336
num_plugins+=(${#adoc2[@]})
@@ -326,12 +340,16 @@ sorted=(); while IFS= read -rd '' key; do sorted+=( "$key" ); done < <(printf '%
326340
# shellcheck disable=SC2128
327341
if [[ $sorted ]] ;then
328342
for key in "${sorted[@]}"; do
329-
echo -e "${adoc3[$key]}" >> "${0/.sh/.ref-community-plugins}";
330-
echo -e "${csv[$key]}" >> "${0/.sh/.csv}"
343+
(( c = c + 1 ))
344+
if [[ $QUIET -eq 0 ]]; then echo " * [$c] $key [ community-plugins ] = ${csv[$key]}"; fi
345+
echo -e "${adoc3[$key]}" >> "${0/.sh/.ref-community-plugins}";
346+
echo -e "${csv[$key]}" >> "${0/.sh/.csv}"
331347
done
332348
fi
333349
num_plugins+=(${#adoc3[@]})
334350

351+
if [[ $QUIET -eq 0 ]]; then echo; fi
352+
335353
# merge the content from the three .adocX files into the .template.adoc file, replacing the TABLE_CONTENT markers
336354
count=1
337355
index=0

0 commit comments

Comments
 (0)