Changelog
Next
Changes listed here will be part of the next release.
0.4.0 (2023.04.17)
With this release the Onyo commands allow to add and find information inside a
repository. The get command extracts data from assets, and with new,
set and unset it is easy to manage an inventory.
Many flags (--keys, --message, --depth, --yes) and
functionalities across all commands are added or normalized to give a smooth and
predictable user experience.
A demo repository shows how an
inventory created and managed with Onyo looks like.
The code-base and tests use a lot of new features and are uplifted to reflect
current standards across the project.
The highlights are:
New Commands
add command
onyo unset: remove key/value pairs from assetsadd command
onyo get: query the onyo repository
Command Changes
- overhaul of
onyo new: expect full asset path and name as an argument, instead of reading name fields via TUI
allow creation of multiple assets in one call
verify validity of asset name
do not open new assets with an editor by default
add diff-like output after reading/combining all information
- add flags:
--edit: open new asset(s) in editor--keys: set key/value(s) to new asset(s)--path: list paths for newly created asset(s)--tsv: read information from table instead of TUI--yes: answer yes to all prompts
- overhaul of
normalize flags
--pathand--keysfor commandsget,new,set,unsetadd
onyo set --rename: allows renaming assets (update pseudo-keys), which was formerly done withonyo mv --renameadd
--messageflag to all committing commandsadd to
onyo editflags--yesand--quietadd to
onyo mkdirflags--yesand--quietremove flag
onyo set --recursive(set and unset operate recursively by default)key/value pairs are now space-separated (rather than comma-separated)
normalize user-facing texts (“Update assets? (y/n)”) and behavior (remove default options, the user has to explicitly answer) across commands
rename template “standard” -> “empty”
retire
.onyo/temp/, assets are changed in place and changes reverted when needed
API
add property
Repo.templates: the templates in.onyo/`templatesremove unused property
Repo.gitfiles- the following public methods are added to
Repo: validate_name_scheme(): test that an asset name matches the asset name schemeget_template(): return a template pathclean_caches(): reset properties ofReporestore(): restore uncommitted changesgenerate_commit_message(): build the most explicit commit message which fits into the character limit with information about the command used and assets and directories changed
- the following public methods are added to
add
fsckcheck for pseudo-key names in asset file(s)add doc strings to properties
Bugs
clear caches of properties after modifying the repository to remove stale information
allow special characters in asset and directory names
order files/dirs in commit messages alphabetically
enable shell completion when using multiple arguments for the same flag
tab completion stops listing short/long flag names when the other version was already used (e.g.
--yesand-y)onyo treedisplays just paths in an onyo repository instead of allowing paths to lead outside of the repositoryfix “tests badge”
Docs
add “Code Conventions” to readme
add badge for demo deploy status
Tests
run tests in random order
add fixture
repo_contentsfor setting asset contentsadd/expand tests for changed behavior of
onyo newadd tests for
onyo unsetadd tests for
onyo treeadd tests for
Repo.valid_name()expand tests for
onyo set- modernize/normalize all tests under
tests/ fixtures, doc-strings, parameterization, type hints
add special character tests
test single/list of path arguments as input
- modernize/normalize all tests under
remove
test_invoking.pyandreference_output/
Demo
- add
demo.sh runs a list of commands to create an example repository
deploy example repository at https://github.com/psyinfra/onyo-demo
- add
add demo information to docs and readme
0.3.0 (2022.11.02)
This release introduces an Onyo API and contains general code modernization, performance improvements, and expansion of tests.
The highlights are:
Command Changes
onyo mv --renameis retired.onyo setis the only command that can change keys/pseudo-keys.add
onyo mv --quietrename
onyo mv --forcetoonyo mv --yesto match other commandsonyo newfaux serials default length is decreased from 8 to 6asset read/write always preserves key order and comments (aka: roundtrip mode)
API
a new
Repoclass to represent a repository as an objectRepo(init=True)initializes a new repositorythe following properties are added to
Repo:assets: assets in the repodirs: directories in the repofiles: files in the repofiles_changed: files in the “changed” state in gitfiles_staged: files in the “staged” state in gitfiles_untracked: files “untracked” by gitroot: repository rootopdir: operating directory
the following public methods are added to
Repo:Repo.add(): stage a file’s changed contentsRepo.commit(): commit all staged changesRepo.generate_faux_serials(): generate unique, fake serialsRepo.get_config(): get a config valueRepo.set_config(): set a config name and value, in either.onyo/configor any other valid git-config locationRepo.fsck(): fsck the repository, individual tests can be selectedRepo.mkdir(): create a directory (and any parents), add.anchorfiles, and stage themRepo.mv(): move/rename a directory/file and stage itRepo.rm(): delete a directory/file and stage it
remove
onyo/utils.pymost tests are rewritten/updated to be self-contained
Bugs
onyo historyhonorsonyo -Conyo historyerrors bubble up the correct exit code“protected paths” (such as
.anchor,.git,.onyo) are checked for anywhere in the path name.calling
onyowith an insufficient number of arguments no longer exits 0arguments named ‘config’ no longer ignore subsequent arguments
simultaneous use of
onyo -Candonyo --debugno longer crashes Onyofaux serials are generated in a more random way
onyo mkdirno longer errors with overlapping target directoriesonyo mv file-1 subdir/file-1(aka: explicit move) no longer errors
Validation
Validation is entirely removed. It will be reintroduced, in an improved form, in a later release.
Docs
Linting is documented.
Tests
add tests for the
onyo editcommandadd tests for the
onyo historycommandadd tests for the
onyo mvcommandadd tests for the
onyo newcommandadd tests for the
onyocommandadd tests for the
Repoclass:initialization
instantiation
assetsdirsfilesfiles_changesfiles_stagedfiles_untrackedrootopdiradd()commit()generate_faux_serials()get_config()set_config()fsck()mkdir()mv()rm()
Pyre is used for type checking
repofixture to assist with test setup and isolation
Installation
The Python version required by Onyo is bumped from 3.7 to 3.9.
Both GitPython and PyYAML are dropped as dependencies.
Authors
Tobias Kadelka (@TobiasKadelka)
Alex Waite (@aqw)
0.2.0 (2022.09.28)
This release primarily focused on configuration, refactoring, and tests.
The highlights are:
Command Changes
onyo cat: error codes are now reliably reported and bugs related to roundtrip-ing were fixedonyo config: now callsgit configand thus inherits all of its functionality (with a few intentional exceptions).onyo shell-completion: now supports completion foronyo -C,onyo config,onyo new --templates, and when Onyo is invoked through an alias.
Retired
onyo git: retired in favor of aliasingonyo-git(see Aliases).
Configuration
Configuration was completed overhauled:
options can be set in either
git configoronyo configall options are moved into an
onyonamespace.added
onyo.core.editorto configure the preferred editordocumentation written (see Configuration)
Docs
configuration is documented (see Configuration)
help output is stripped of various rst-isms
documented using aliases with onyo, especially to operate on an onyo repo from elsewhere on the system
improved documentation for building and testing
Tests
enabled code coverage
many tests added, notably for
onyo catandonyo configsignificant refactoring and cleanup
Authors
0.1.0 (2022.09.19)
Onyo still isn’t ready for production use yet, but it has gained a lot of features, fixes, documentation, and tests since the last release.
The highlights are:
New Commands
onyo config: configure optionsonyo fsck: check the sanity of the git repo, onyo config, and validate all assetsonyo history: see the history of an asset or directory (spawnstigorgit log)onyo mkdir: create directories (with.anchorfiles)onyo rm: delete assets and directoriesonyo set: set keys and values in assetsonyo shell-completion: tab-completion support
Command Changes
onyo new:a faux-serial number is generated when the serial field is left blank
spawns an editor after initial dialog
support for templates (see Template Files)
onyo newandonyo edit: now check for valid YAML and passing validation rulesonyo newandonyo mkdir: no longer automatically create missing parentmost commands now accept multiple files and directories as arguments
most commands now verify the integrity of the repo before executing
Retired
onyo anchorandonyo unanchor: these were retired in favor ofonyo mkdirwhich always creates an.anchorfile.ONYO_REPOSITORY_DIR:onyo -Cshould be used instead
Validation
Rudimentary validation support is now available for the contents of asset files. It’s currently mostly limited to checking types, but will be expanded for more sophisticated checks.
When invoking onyo edit or onyo new, the file must pass validation
before it will be saved and committed.
Docs
Command descriptions have been moved from the README into Onyo and are available when invoking
--help.The help text has received a lot of attention to improve clarity and also consistency of language across commands.
Read the Docs has been setup, and content migrated to it.
Art
Onyo has a logo!
Tests
RTD runs a test-build for all PRs
A boatload of new tests have been written
The tests no longer run in the top-level and now create
tests/sandbox
Installation
Onyo now requires Python 3.7 or newer.
Authors
Anne Ghisla (@aghisla)
Tobias Kadelka (@TobiasKadelka)
Alex Waite (@aqw)
Laura Waite (@loj)
0.0.1 (2022.03.24)
Onyo lives! It’s still the beginning — and Onyo explodes more often than it should — but the overall design has been written, and the commands are taking shape.
The highlights are:
New Commands
onyo anchorandonyo unanchor: add/remove an.anchorfile in directories, so that they can be tracked by gitonyo cat: print assets to stdoutonyo edit: edit assetsonyo init: initialize an onyo repoonyo mv: move assets and directoriesonyo new: create new assetsonyo tree: print a directories/files in a tree structureonyo git: run git commands from within the onyo repo (most useful withonyo -CorONYO_REPOSITORY_DIR)onyo --debug: debug logging
Tests
Basic tests and CI
Authors
Tobias Kadelka (@TobiasKadelka)
Alex Waite (@aqw)