Open
Description
Howdy,
To prevent issues like leftwm/leftwm#436 and leftwm/leftwm-community-themes#25, we should add a CI operation for leftwm-community-themes that performs the following checks:
- Known.toml is valid TOML
- Runs the change operations (See Replace space in theme name with - or _ #9) to make sure none of them need applied to known.toml itself (e.g. a Change to name Sunflower to sunflower, but the known.toml has a theme named Sunflower)
- Checks that all names are unique
- Checks that all Change UUIDs are unique
- Checks that all theme names match the currently acceptable requirements
- Checks that the theme repository exists (download it)
- Checks that the theme repository contains up, down, and theme.toml at a minimum (use relative_directory, and download as per above)
- Warns (with flag --new-versions or similar) of outdated commits
- Sets (with flag --set-versions or similar) the version of each theme equal to the current commit HEAD tag
- Sets (with flag --set-commit or similar) the commit of each theme equal to the current commit HEAD sum
Bonus: - Find a way to determine the minimum leftwm version and set that
Example:
[leftwm-community-themes@leftwm ~]$ leftwm-theme ci-check
[OK] known.toml valid
[OK] all changes are applied
[OK] all changes have unique ID
[OK] all themes have unique name
[OK] all themes have an acceptable name
[1/2] Checking theme `sunflower`
=> Repository downloaded successfully
=> Contains up with proper permissions
=> Contains down with proper permissions
=> Contains valid theme.toml with proper permissions
[2/2] Checking theme `soothe` in `soothe/theme/`
=> Repository downloaded successfully
=> Sub-directory entered successfully
=> Contains up with proper permissions
=> Contains down with proper permissions
=> Contains valid theme.toml with proper permissions
Example 2 (with flags):
[leftwm-community-themes@leftwm ~]$ leftwm-theme ci-check --set-versions --set-commit
[OK] known.toml valid
[OK] all changes are applied
[OK] all changes have unique ID
[OK] all themes have unique name
[OK] all themes have an acceptable name
[1/2] Checking theme `sunflower`
=> Repository downloaded successfully
=> Contains up with proper permissions
=> Contains down with proper permissions
=> Contains valid theme.toml with proper permissions
=> Version upgraded from 0.0.1 to 0.1.0
=> Commit set to 9c504d9
[2/2] Checking theme `soothe` in `soothe/theme/`
=> Repository downloaded successfully
=> Sub-directory entered successfully
=> Contains up with proper permissions
=> Contains down with proper permissions
=> Contains valid theme.toml with proper permissions
=> Version remains 0.1.0
=> Commit set to 643ad4e
Example 3 (errors):
[leftwm-community-themes@leftwm ~]$ leftwm-theme ci-check
[Err] known.toml valid:
Error: Unknown character ~, line 1, column 1. TOML could not be parsed.
Example 4 (errors):
[leftwm-community-themes@leftwm ~]$ leftwm-theme ci-check --set-versions --set-commit
[OK] known.toml valid
[Err] all changes are applied
Error: theme "Soothe" not renamed to "soothe"
Help: change name="Soothe" to name="soothe"
[Err] all changes have unique ID
Error: change (uuid1) is not unique
Help: insert new UUID for uuid1
[Err] all themes have unique name
Error: theme "sunflower" is defined twice.
Help: rename all but one instance of "sunflower", or delete duplicate entries.
[Err] all themes have an acceptable name
Error: theme "Soothe" does not have an acceptable name.
Metadata
Metadata
Assignees
Labels
No labels