Fix check-for-updates pipeline job to signal failure when it finds any issues
Background
-
While merging GT.M V7.0-002, I noticed that the
check-for-updates
job passed even though it reported some issues. -
Below is pasted from https://gitlab.com/nars1/YDBEncrypt/-/jobs/6378244582
. . The contents of sr_port/ydb_logicals_tab.h are different in the YDB and YDBEncrypt repos 3c3 < * Copyright (c) 2018-2024 YottaDB LLC and/or its subsidiaries. * --- > * Copyright (c) 2018-2023 YottaDB LLC and/or its subsidiaries. * 94c94 < YDBENVINDX_TABLE_ENTRY (YDBENVINDX_MALLOC_LIMIT, "$ydb_malloc_limit", "$gtm_malloc_limit") --- > YDBENVINDX_TABLE_ENTRY (YDBENVINDX_MAX_STORALLOC, "$ydb_max_storalloc", "$gtm_max_storalloc") exit $status Cleaning up project directory and file based variables Job succeeded
-
Notice that the job reported that
sr_port/ydb_logicals_tab.h
was different in the YDB and YDBEncrypt repos. But the final line still saidJob succeeded
.
Issue
- There was logic that set
status=1
in case a non-zero diff was found. But it was then followed by logic that resetstatus=0
.
Fix
-
I did not understand why the
status=0
reset logic existed so removed it as part of this commit. That also meant that$filelist
was no longer used and so removed logic that initialized thecommit_list
andfilelist
variables. This simplified the logic a bit. -
Additionally, changed usages of
status
variable to use a different variable nameexit_status
. The former collided with the shell's own variable to hold the exit status of the most recently invoked command so it is better not to usestatus
to store the exit status of the script.