Skip to content

Fix check-for-updates pipeline job to signal failure when it finds any issues

Narayanan Iyer requested to merge nars1/YDBEncrypt:checkforupdates into master

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 said Job 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 reset status=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 the commit_list and filelist variables. This simplified the logic a bit.

  • Additionally, changed usages of status variable to use a different variable name exit_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 use status to store the exit status of the script.

Merge request reports