Skip to content

Simplification and fix of the argument parser#200

Merged
safl merged 2 commits intorefenv:mainfrom
naddinadja-forks:argparse
Dec 18, 2025
Merged

Simplification and fix of the argument parser#200
safl merged 2 commits intorefenv:mainfrom
naddinadja-forks:argparse

Conversation

@NaddiNadja
Copy link
Contributor

No description provided.

Signed-off-by: Nadja Brix Koch <n.koch@samsung.com>
@NaddiNadja NaddiNadja requested a review from safl December 17, 2025 12:11
Copy link
Collaborator

@safl safl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the CI errors related to this?

@NaddiNadja NaddiNadja force-pushed the argparse branch 2 times, most recently from e6aa58b to 6f0b527 Compare December 17, 2025 13:34
@NaddiNadja
Copy link
Contributor Author

Are the CI errors related to this?

hehe, yes. I'm on it

@coveralls
Copy link

coveralls commented Dec 17, 2025

Pull Request Test Coverage Report for Build 20331338240

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 29 of 31 (93.55%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.2%) to 78.633%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/cijoe/cli/cli.py 29 31 93.55%
Totals Coverage Status
Change from base Build 18189340355: 0.2%
Covered Lines: 1583
Relevant Lines: 2077

💛 - Coveralls

Copy link
Collaborator

@safl safl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this require that one now does not explicitly provide --workflow?
I ask, since there are places where CIJOE is in use where it would like convenient not to have to adjust to that. In other words, could providing --workflow be optional, or does that break with the cleanup done here?

@NaddiNadja
Copy link
Contributor Author

NaddiNadja commented Dec 17, 2025

Does this require that one now does not explicitly provide --workflow?

It did, but I've added it back for backwards compatibility. Also, I have added a bunch of tests for the parse_args() function to support our confidence in it being correct. If there are any cases that you feel like are missing, let me know. Right now I check:

Workflows:

  • Giving a workflow as a positional argument
  • Giving a workflow as a positional argument with a list of steps
  • Giving a workflow with the --workflow argument
  • Giving a workflow with the --workflow argument with a list of steps

Scripts:

  • Giving a cijoe script (core.example_script_default) as a positional argument
  • Giving a cijoe script (core.example_script_default) as a positional argument with script arguments
  • Giving a path to a script as a positional argument
  • Giving a path to a script as a positional argument with script arguments (should fail)
  • Giving a path to a script as a positional argument with a list of steps (should remove steps)

Other:

  • Base test for just all arguments to see they are added correctly
  • Giving a bunch of arguments in "another order" than the other tests (this was to ensure that e.g. --monitor can be put first)
  • Giving no arguments to see that the workflow is set to the default

@NaddiNadja NaddiNadja force-pushed the argparse branch 2 times, most recently from 67e70ef to 96a4b97 Compare December 18, 2025 08:52
This simplifies the logic of the argument parser without changing the
functionality. It also fixes the bug where boolean arguments, such as
--monitor, could not be placed as the first argument.

Signed-off-by: Nadja Brix Koch <n.koch@samsung.com>
Copy link
Collaborator

@safl safl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent, thanks!

@safl safl merged commit 27184f0 into refenv:main Dec 18, 2025
30 checks passed
@NaddiNadja NaddiNadja deleted the argparse branch December 18, 2025 14:05
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