Skip to content

chore: Attempt to cache source from downloads.keyman if external source missing#337

Merged
darcywong00 merged 3 commits intokeymanapp:masterfrom
darcywong00:chore/warn-external-source-missing
Feb 4, 2026
Merged

chore: Attempt to cache source from downloads.keyman if external source missing#337
darcywong00 merged 3 commits intokeymanapp:masterfrom
darcywong00:chore/warn-external-source-missing

Conversation

@darcywong00
Copy link
Contributor

@darcywong00 darcywong00 commented Feb 3, 2026

The current build is failing because the external sources for fv.bea.tsaadane are not available

Changes

  • If external source fails to download, attempt to get the latest source from downloads.keyman.com
  • Brings in jq.inc.sh from the keyboards repo

I'm open to optimizing the api.keyman query so we only run it once.
Also am not handling retrieve_external_source_model() at the moment.

Test-bot: skip

If external source is unavailable, get the latest version from downloads.keyman
@darcywong00 darcywong00 added this to the A19S22 milestone Feb 3, 2026
Copy link
Member

@mcdurdin mcdurdin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a good interim stop-gap. I am concerned that we will not see the warnings in the logs which may lead to bigger issues in the future, so we need to have a tracking issue for a deeper resolution (which involves caching the files in-repo at submission time). Perhaps this patch should not 'fix' the reporting issue

local path=
[[ ! $filename =~ .model_info$ ]] && path=source/
curl -s -L "$url" --output "$path$filename" --create-dirs || die "Unable to download $filename"
curl -s -L "$url" --output "$path$filename" --create-dirs || retrieve_cached_model "$path" "$filename" && continue
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't continue if retrieve_cached_model fails; we still also need to verify the checksum of the cached model.

Comment on lines 139 to 143
# Also handle model_info since we need to query the latest version
# .model_info is downloaded up a level
local version=`curl "$query" | $JQ -r '.[].version'`
local model_info_filename="https://downloads.keyman.com/models/${model_id}/${version}/${model_id}.model_info"
curl -s -L "$model_info_filename" --output "$model_id.model_info" --create-dirs || die "Unable to download $model_info_filename"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should really be under the model_info) section, I don't see any benefit to it being under kmp)

* Remove continue, process model_info in its own section
@mcdurdin
Copy link
Member

mcdurdin commented Feb 4, 2026

Relates-to: keymanapp/keyman#15545

Copy link
Member

@mcdurdin mcdurdin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM; we'll keep the tracking issue in keymanapp/keyman open for a longer-term solution that involves caching on first use

@darcywong00 darcywong00 merged commit bf6f46e into keymanapp:master Feb 4, 2026
2 checks passed
@darcywong00 darcywong00 deleted the chore/warn-external-source-missing branch February 5, 2026 06:24
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.

2 participants