microsoft / microsoft/AzureTRE

Bash options cause "silent" bugs

Open
#1,672 0 comments 1 reaction 1 assignee View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
235
Forks
192
Avg merge
1d 23h
Merged PRs (30d)
13

Description

Describe the bug

Most of our bash scripts don't sent common switches important to avoid unintended behaviors. Specifically many don't use set -o nounset which don't catch misspelled / not provided variables.
When this is added to certain scripts, it has a cascade affect on scripts that don't use it as we chain commands in our make targets (command1 && command2).

Steps to reproduce

  • make build-api-image never used the "CI ACR" as the image name was using a non existing var visible here.
    The log example from one of the runs (pr bot):

11 importing cache manifest from ***.azurecr.io/:0.2.12
11 sha256:2fe49dad347b96f3d494163154bea9c19f4825505b5ac4478c0d055bc36f9996
11 ERROR: invalid reference format

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.