8000 Move `help_*` out of settings root by cidrblock · Pull Request #1104 · ansible/ansible-navigator · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Move help_* out of settings root #1104

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

Merged
merged 2 commits into from
Mar 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
8000
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docs/changelog-fragments.d/1104.breaking.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Moved the help entries into their respective ansible command parent keys in settings file.

`ansible-navigator.help-builder` => `ansible-navigator.ansible-builder.help`
`ansible-navigator.help-config` => `ansible-navigator.ansible.config.help`
`ansible-navigator.help-doc` => `ansible-navigator.documentation.help`
`ansible-navigator.help-inventory` => `ansible-navigator.ansible.inventory.help`
`ansible-navigator.help-playbook` => `ansible-navigator.ansible.playbook.help`

-- by {user}`cidrblock`
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ class Internals:
name="help_builder",
choices=[True, False],
cli_parameters=CliParameters(short="--hb", action="store_true"),
settings_file_path_override="ansible-builder.help",
short_description="Help options for ansible-builder command in stdout mode",
subcommands=["builder"],
value=SettingsEntryValue(default=False),
Expand All @@ -329,6 +330,7 @@ class Internals:
name="help_config",
choices=[True, False],
cli_parameters=CliParameters(short="--hc", action="store_true"),
settings_file_path_override="ansible.config.help",
short_description="Help options for ansible-config command in stdout mode",
subcommands=["config"],
value=SettingsEntryValue(default=False),
Expand All @@ -337,6 +339,7 @@ class Internals:
name="help_doc",
choices=[True, False],
cli_parameters=CliParameters(short="--hd", action="store_true"),
settings_file_path_override="documentation.help",
short_description="Help options for ansible-doc command in stdout mode",
subcommands=["doc"],
value=SettingsEntryValue(default=False),
Expand All @@ -345,6 +348,7 @@ class Internals:
name="help_inventory",
choices=[True, False],
cli_parameters=CliParameters(short="--hi", action="store_true"),
settings_file_path_override="ansible.inventory.help",
short_description="Help options for ansible-inventory command in stdout mode",
subcommands=["inventory"],
value=SettingsEntryValue(default=False),
Expand All @@ -353,6 +357,7 @@ class Internals:
name="help_playbook",
choices=[True, False],
cli_parameters=CliParameters(short="--hp", action="store_true"),
settings_file_path_override="ansible.playbook.help",
short_description="Help options for ansible-playbook command in stdout mode",
subcommands=["run"],
value=SettingsEntryValue(default=False),
Expand Down
42 changes: 25 additions & 17 deletions src/ansible_navigator/configuration_subsystem/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,21 @@
},
"config": {
"additionalProperties": False,
"properties": {"path": {"type": "string"}},
"properties": {
"help": {
"type": "boolean",
},
"path": {
"type": "string",
},
},
},
"inventory": {
"additionalProperties": False,
"properties": {
"help": {
"type": "boolean",
},
"paths": {
"items": {"type": "string"},
"type": "array",
Expand All @@ -29,7 +39,14 @@
},
"playbook": {
"additionalProperties": False,
"properties": {"path": {"type": "string"}},
"properties": {
"help": {
"type": "boolean",
},
"path": {
"type": "string",
},
},
},
},
"type": "object",
Expand All @@ -38,6 +55,9 @@
"additionalProperties": False,
"type": "object",
"properties": {
"help": {
"type": "boolean",
},
"workdir": {
< 10000 span class='blob-code-inner blob-code-marker ' data-code-marker=" "> "type": "string",
},
Expand Down Expand Up @@ -79,6 +99,9 @@
"documentation": {
"additionalProperties": False,
"properties": {
"help": {
"type": "boolean",
},
"plugin": {
"additionalProperties": False,
"properties": {
Expand Down Expand Up @@ -172,21 +195,6 @@
},
"type": "object",
},
"help-builder": {
"type": "boolean",
},
"help-config": {
"type": "boolean",
},
"help-doc": {
"type": "boolean",
},
"help-inventory": {
"type": "boolean",
},
"help-playbook": {
"type": "boolean",
},
"inventory-columns": {
"items": {"type": "string"},
"type": "array",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@
ansible-navigator:
ansible:
config:
help: False
path: /tmp/ansible.cfg
cmdline: "--forks 15"
inventory:
help: False
paths:
- /tmp/test_inventory.yml
playbook:
help: False
path: /tmp/test_playbook.yml
ansible-builder:
help: False
workdir: /tmp/
ansible-runner:
artifact-dir: /tmp/test1
Expand All @@ -22,6 +26,7 @@ ansible-navigator:
enable: False
osc4: False
documentation:
help: False
plugin:
name: shell
type: become
Expand Down Expand Up @@ -54,11 +59,6 @@ ansible-navigator:
options: "Z"
container-options:
- "--net=host"
help-builder: False
help-config: True
help-doc: True
help-inventory: True
help-playbook: False
inventory-columns:
- ansible_network_os
- ansible_network_cli_ssh_type
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/configuration_subsystem/test_json_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ def test_basic(schema_dict: Dict[str, Any]):
"""
assert schema_dict["$schema"] == "http://json-schema.org/draft-07/schema"
assert isinstance(schema_dict["properties"]["ansible-navigator"]["properties"], dict)
assert len(schema_dict["properties"]["ansible-navigator"]["properties"]) >= 21
# This checks for a number of root keys in the settings file
assert len(schema_dict["properties"]["ansible-navigator"]["properties"]) >= 16


def test_additional_properties(schema_dict: Dict[str, Any]):
Expand Down
0