julia-actions / cache

A shortcut action to cache Julia artifacts, packages, and registries.
MIT License
38 stars 8 forks source link

URL encode any invalid key characters #93

Closed omus closed 6 months ago

omus commented 6 months ago

Noticed in a private workflow that when a matrix values contain commas the cache restore step fails with:

Error: Key Validation Error: <redacted-key> cannot contain commas.

I ended up tracking down where the key restrictions are implemented and found that there are only two restrictions:

I've opted to URL encode the comma character only to keep the artifact key as human-readable as possible while still indicating the presence of a comma. I'm not as worried about the key length limit as my artifact key was only 286 characters and was using a pretty complicated job matrix with included paths.

IanButterworth commented 6 months ago

LGTM but worth a test? Can we just put a comma in the CI matrix somewhere?

omus commented 6 months ago

LGTM but worth a test? Can we just put a comma in the CI matrix somewhere?

Will do. Would love to get some unit tests setup to make it more obvious what we're all testing for

omus commented 6 months ago

The Windows CI job failed due to network issues. Will push an empty commit to try again:

Run using Pkg; Pkg.add(PackageSpec(name="pandoc_jll", version="3"))

  Installing known registries into `/tmp/julia-depot`
ERROR: LoadError: could not download https://pkg.julialang.org/registry/23338594-aafe-5451-b93e-139f81909106/65918196649b53895b4fe97bb7661f82807c9e49 
Exception: RequestError: HTTP/1.1 404 Not Found while requesting https://pkg.julialang.org/registry/23338594-aafe-5451-b93e-139f81909106/65918196649b53895b4fe97bb7661f82807c9e49
omus commented 6 months ago

@IanButterworth feel free to merge. I don't have write access.