Skip to content

Conversation

@plars
Copy link
Contributor

@plars plars commented Sep 21, 2025

Hello from the dark side! (still looking for those cookies)
I was feeling nostalgic and decided to go tidy some things up. Feel free to take this or not. I'm really happy to see how nicely everything seems to still be progressing with this project! :)

Description

There's a lot of boilerplate and extra functions needed to setup argparse, due to all the subcommands and different args needed. This allows us to define them up front in a JSON blob that gets used to setup argparse.

Resolved issues

Mainly it just makes it easier to read and modify, and removes a lot of boilerplate as mentioned above.

Documentation

N/A

Web service API changes

N/A

Tests

The tests all still pass, and to be clear, this doesn't intend to change the way the cli args work at all. It just cleans it up a bit and makes it easier to work with.

There's a lot of boilerplate and extra functions needed to setup
argparse, due to all the subcommands and different args needed. This
allows us to define them up front in a JSON blob that gets used to setup
argparse.
@plars
Copy link
Contributor Author

plars commented Sep 23, 2025

@pedro-avalos @boukeas @val500 Tagging you hear because it doesn't seem to auto-assign reviewers when someone from the outisde submits a PR, so it probably didn't notify you at all. I have this one and another at #804 if you get a chance to take a look. :)

@ajzobro
Copy link
Contributor

ajzobro commented Dec 10, 2025

I would like to see tests that go along with something like this as every argument is being touched.
Furthermore, this abstracts things from their use by creating magic lists (e.g. "args": [ { "name": ["--oneshot", "-o"], "action": "store_true", "help": "Get latest output and exit immediately", }, {"name": "job_id", "completer": "job_ids"}, ]

With no supporting documentation as to how they relate or will be parsed.

@bladernr
Copy link
Collaborator

This would also need to be updated to include the current state of args in testflinger CLI, the json is missing the admin stuff at the very least.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants