Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polish modules arguments #10

Merged
merged 2 commits into from
Jun 28, 2024
Merged

Polish modules arguments #10

merged 2 commits into from
Jun 28, 2024

Conversation

evgenyz
Copy link
Member

@evgenyz evgenyz commented Jun 18, 2024

  • All modules inherit global options (input, tailoring).
  • Some modules now share profile option.
  • Added missing help text, metavars and titles.

@jan-cerny jan-cerny self-assigned this Jun 19, 2024
parser.set_defaults(func=list.execute)
def prepare_parser_list(cli_sub_parsers, global_parser, profile_parser) -> None:
parser = cli_sub_parsers.add_parser("list", parents=[global_parser],
help="list available components")
Copy link
Collaborator

Choose a reason for hiding this comment

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

It should list available security profiles and their identifiers.

Moreover, nobody knows what a "component" means.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've expanded the message a bit.

compliance_tool/cli.py Outdated Show resolved Hide resolved
compliance_tool/cli.py Show resolved Hide resolved
compliance_tool/cli.py Show resolved Hide resolved
parser.add_argument("--html")
parser.add_argument("--json")
parser.add_argument("--control", metavar="CONTROL_ID",
help="control identifier")
Copy link
Collaborator

Choose a reason for hiding this comment

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

The help text is very short here. It isn't clear what will happen if a user provides this argument. We need to explain in the help text what would happen if the user provides this argument.

Also, please foresee that we will use the help text to generate manual and or docs.

Copy link
Member Author

Choose a reason for hiding this comment

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

Expanded it a bit. I would expect us to add more details following implementation of these features.

parser.add_argument("--control", metavar="CONTROL_ID",
help="control identifier")
parser.add_argument("--rule", metavar="RULE_ID",
help="rule identifier")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ditto. We need to give an explanation on action will this option trigger in the help text.

compliance_tool/cli.py Show resolved Hide resolved
Comment on lines 42 to 54
parser.add_argument("--control", metavar="CONTROL_ID",
help="control identifier")
parser.add_argument("--rule", metavar="RULE_ID",
help="rule identifier")
Copy link
Collaborator

Choose a reason for hiding this comment

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

These 2 have similar problem with lack of information in help text as in the other module.

Copy link
Member Author

Choose a reason for hiding this comment

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

Expanded it a bit.

compliance_tool/cli.py Outdated Show resolved Hide resolved
@evgenyz evgenyz force-pushed the main branch 3 times, most recently from b4c07d2 to d04bc40 Compare June 21, 2024 09:12
help="policy definitions (recognized formats: SCAP Data Stream)")
global_parser.add_argument("--tailoring", metavar="SOURCE_FILE",
help="policy customizations"
" (recognized formats: XCCDF Tailoring, JSON Tailoring)")
Copy link
Collaborator

Choose a reason for hiding this comment

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

It won't consume XCCDF tailoring. The whole point of the tool is to hide XCCDF and other SCAP technologies from the user, so that in future we can easily switch to other non-SCAP technologies.

Copy link
Member Author

Choose a reason for hiding this comment

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

Do you think that we should somehow hint what format this should be in?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, definitely, we should.

Copy link
Member Author

Choose a reason for hiding this comment

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

XCCDF Tailoring is gone.

compliance_tool/cli.py Outdated Show resolved Hide resolved
return parser
global_parser = argparse.ArgumentParser(add_help=False)
global_parser.add_argument("--input", metavar="SOURCE_FILE",
help="policy definitions (recognized formats: SCAP Data Stream)")
Copy link
Collaborator

Choose a reason for hiding this comment

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

It shouldn't depend on a SCAP data stream because we want to leave our door open to other technologies in future. We want the tool to be generic and not depend on SCAP technologies. The design that doesn't involve SCAP will allow us to easily switch to whatever technology we would use in the future.

Copy link
Member Author

Choose a reason for hiding this comment

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

Do you think that we should somehow hint what format this should be in?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, I agree.

Copy link
Member Author

Choose a reason for hiding this comment

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

The option is no longer there.

@evgenyz evgenyz requested a review from marcusburghardt June 24, 2024 14:00
compliance_tool/cli.py Show resolved Hide resolved
compliance_tool/cli.py Show resolved Hide resolved
evgenyz added 2 commits June 27, 2024 15:23
All modules inherit global options (input, tailoring).
Some modules now share profile argument.
Profile argument is mandatory now.
Added missing help text, metavars and titles.
Copy link
Collaborator

@jan-cerny jan-cerny left a comment

Choose a reason for hiding this comment

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

amazing

@jan-cerny jan-cerny merged commit aef2c28 into ComplianceAsCode:main Jun 28, 2024
5 checks passed
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.

4 participants