Skip to content

ci: error if FRONTEND_VERSION not found#2050

Open
alxndrsn wants to merge 9 commits into
getodk:nextfrom
alxndrsn:jq-er
Open

ci: error if FRONTEND_VERSION not found#2050
alxndrsn wants to merge 9 commits into
getodk:nextfrom
alxndrsn:jq-er

Conversation

@alxndrsn

@alxndrsn alxndrsn commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Re #2042 (comment)

Adding -e isn't enough to cause a helpful failure when FRONTEND_VERSION is missing from docker-compose.yml because:

  1. it doesn't fail, despite bash -e, because the jq command runs inside the echo call, which succeeds, and
  2. if the intention is for the failure to be easy to understand, jq -e won't help on its own

What has been done to verify that this works as intended?

  • checked behaviour locally
  • tested first invocation
  • tested second invocation

Why is this the best possible solution? Were any other approaches considered?

Here's what failure looks like now:

[extract-frontend-version.sh] Ensuring .env exists for docker compose...
[extract-frontend-version.sh] Reading FRONTEND_VERSION from docker-compose.yml...
time="2026-07-07T03:33:30Z" level=warning msg="The \"DOMAIN\" variable is not set. Defaulting to a blank string."
time="2026-07-07T03:33:30Z" level=warning msg="The \"SYSADMIN_EMAIL\" variable is not set. Defaulting to a blank string."
time="2026-07-07T03:33:30Z" level=warning msg="The \"DOMAIN\" variable is not set. Defaulting to a blank string."
time="2026-07-07T03:33:30Z" level=warning msg="The \"DOMAIN\" variable is not set. Defaulting to a blank string."
time="2026-07-07T03:33:30Z" level=warning msg="The \"SYSADMIN_EMAIL\" variable is not set. Defaulting to a blank string."
time="2026-07-07T03:33:30Z" level=warning msg="The \"DOMAIN\" variable is not set. Defaulting to a blank string."
time="2026-07-07T03:33:30Z" level=warning msg="The \"DOMAIN\" variable is not set. Defaulting to a blank string."
time="2026-07-07T03:33:30Z" level=warning msg="The \"SYSADMIN_EMAIL\" variable is not set. Defaulting to a blank string."
[extract-frontend-version.sh] !!!
[extract-frontend-version.sh] !!! Failed to read FRONTEND_VERSION from docker-compose.yml (got: 'null').
[extract-frontend-version.sh] !!!

And success:

Screenshot_2026-07-07_07-26-50

How does this change impact users? Describe intentional behavior changes from code updates. What are the regression risks?

No impact.

Does this change require updates to documentation? If so, please file an issue here and include the link below.

No.

alxndrsn and others added 2 commits July 7, 2026 05:44
Fixes error seen on release:

```
> [linux/amd64 intermediate 4/5] RUN files/prebuild/write-version.sh:
0.073 files/prebuild/write-version.sh: line 26: FRONTEND_BUILD_MODE: unbound variable
```
@alxndrsn alxndrsn changed the title Jq er ci: error if FRONTEND_VERSION not found Jul 7, 2026
@alxndrsn alxndrsn changed the title ci: error if FRONTEND_VERSION not found ci: error if FRONTEND_VERSION not found Jul 7, 2026
@alxndrsn alxndrsn marked this pull request as ready for review July 7, 2026 04:27
@alxndrsn alxndrsn requested a review from lognaturel July 7, 2026 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant