devportal
devportal copied to clipboard
Try to automatically determine when `avn` commands are added/altered
The avn
command is immensely useful, but it has many options and we don't always find out immediately when it gains the ability to do something new, or when how something works is changed.
The blog post Help scraping: track changes to CLI tools by recording their --help using Git has some interesting ideas.
The first and simplest suggestion is to write a script that asks avn
for all its help text, recursively, records it to a file, and reports any changes since the last time it was run. A person can then periodically update avn
to the latest version and run this.
If this proves useful, it could be automated and run regularly as part of CI.
A more sophisticated solution (to be investigated later on) might adopt Simon's suggestion in that post of recording the help to a documentation page or pages. This is not normally something one would do, as it gets out of date, but the point here would be to automate its update, and then possibly use the git log as a means of determining that the tool has changed.
There's a command avn help
which seems to output a simple (ish) list of all the commands, including subcommands, in one go. I think we could parse this data in a script even if we ran it manually to find out what has been added. It doesn't help with things like "the cli command also works with Redis now" but it's a start.
I wonder if this should be combined with the non automatic information which is already there or what would be the best way to this.
about the automation process, we can use github actions for that: https://github.com/aiven/devportal/pull/945
I think we would need to first complete all the open tickets tagged avn cli
and then look at creating a script to check that everything that avn help
outputs is relfected in the docs. It won't pick up parameters but it would spot whole new commands. We also probably can try to automate something on the CLI repo itself to notify us of changes in the function signatures for the tool?