4.0.0-beta.1
This is a big release for configlet sync
, making it much more ergonomic - it now caches problem-specifications.
configlet sync
improvement
Before this release, the default behavior of configlet sync
was to clone exercism/problem-specifications
and delete it afterwards. The -p, --prob-specs-dir
and -o, --offline
options influenced the behavior as shown in the below table.
--prob-specs-dir given? |
--offline given? |
Behavior |
---|---|---|
Clone prob-specs, and delete it afterwards | ||
✔️ | Use the given prob-specs dir; error if outdated | |
✔️ | ✔️ | Use the given prob-specs dir; don't check whether outdated |
✔️ | Error: -p must be provided when -o is given |
This was a simple and robust initial implementation, but not ergonomic for the typical use case - the zero-option behavior is slow and wasteful. Most track maintainers would probably want to use both --offline
and --prob-specs-dir
nearly all the time, especially because we often want to run several configlet sync
commands in quick succession.
With this release, configlet sync
now caches problem-specifications on the user's machine, behaving as follows:
Cache hit? | --offline given? |
Behavior |
---|---|---|
Clone prob-specs, and don't delete it afterwards | ||
✔️ | Use cached prob-specs, and git pull in it |
|
✔️ | ✔️ | Use cached prob-specs, and don't git pull in it |
✔️ | Error: local prob-specs not found, and won't clone |
This optimizes for the convenience of configlet sync
and configlet sync --offline
. That is, to perform an offline sync, the user no longer needs to also write a path to a prob-specs directory. In fact, this release also removes the --prob-specs-dir
option entirely; its remaining usefulness is not worth the added complexity (both in the code, and the help message).
Other improvements:
- You don't need to
git pull
in your prob-specs directory before usingconfiglet sync
. - The zero-option behavior is faster, as a
git pull
involves much less data transfer than agit clone
.
Despite the --prob-specs-dir
removal, note that you can still:
- Sync from an older prob-specs commit, by checking out that commit in the cached repo and then using
--offline
. This can be helpful when, for example, creating atomic commits. We require the commit to exist on the upstreammain
branch. - Sync when you have no network connection, and your only copy of problem-specifications is outside the cache directory (by copying it to the cached location, and then using
--offline
). Configlet will tell you this if you use--offline
without a cached prob-specs.
The path to the cached prob-specs is:
$PATHSTART/exercism/configlet/problem-specifications
where the value of $PATHSTART
is given by this table:
Platform | $PATHSTART |
---|---|
Windows | getEnv("LOCALAPPDATA") |
macOS | getEnv("XDG_CACHE_HOME", getEnv("HOME") / "Library/Caches") |
Other | getEnv("XDG_CACHE_HOME", getEnv("HOME") / ".cache") |
and getEnv
returns the value of the environment variable with the name of the first parameter (or if that does not exist, the value of the second parameter).
For example, on Linux, the cached path is typically:
~/.cache/exercism/configlet/problem-specifications
Checksums
We also now include a checksums file in the release assets. You can use this file to verify that a configlet release archive was downloaded correctly. For example, on Linux:
$ sha256sum --check --ignore-missing configlet_4.0.0-beta.1_checksums_sha256.txt
configlet-linux-64bit.tgz: OK
In a future release, we plan to sign this file.
No longer "alpha"
Configlet has stayed "alpha" since January 2021 - partly for the freedom to make breaking changes while we converge on a CLI design, but partly from inertia. In reality, configlet has been working reliably for a long time; the latest "alpha release" ran in CI on every PR on every track, and was downloaded whenever a user ran a fetch-configlet
script.
We're getting closer to releasing 4.0.0, but we're starting beta
releases in the meantime - this better conveys the current situation, and that configlet is not "dangerous alpha software".
Declaring beta
at this exact moment also helps us to distinguish configlet versions that have the new caching behavior (and lack the --prob-specs-dir
option).
User-facing Enhancements
- f7c1225 build: upload checksums file (#552)
- b54fe48 info(prob_specs_exercises): add
state-of-tic-tac-toe
(#554) - f01a5ff exec: cloneExercismRepo: clone a single branch by default (#546)
- 4819f8d sync: cache prob-specs repo, and remove
--prob-specs-dir
option (#540)
Full Changelog (including changes that aren't user facing):
4.0.0-alpha.37...4.0.0-beta.1