-
Notifications
You must be signed in to change notification settings - Fork 83
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
Add AnsibleVariable to entities #1220
base: master
Are you sure you want to change the base?
Conversation
Can one of the admins verify this patch? |
3353ca4
to
3fbcc5c
Compare
@Gauravtalreja1 Would you like to review this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Matches the apidoc and works locally too.
3fbcc5c
to
bec86cb
Compare
@vsedmik thank you for the review, do you know somebody who could supply the second review? |
@SatelliteQE/team-rocket should be in charge. Let me poke them offline. |
nailgun/entities.py
Outdated
'default_value': entity_fields.StringField(), | ||
'override_value_order': entity_fields.StringField(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the APIdoc, only hidden_value field is missing here, could you add it?
https://apidocs.theforeman.org/katello/latest/apidoc/v2/ansible_variables/update.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is some diff between API and apidoc regarding the hidden_value
. Apidoc says "ansible_variable[hidden_value]" but in response I can see we get hidden_value?
.
2024-11-14 09:49:59 - nailgun.client - DEBUG - Received HTTP 200 response: {"parameter":"var_with_hidden_val","id":75,"variable":"var_with_hidden_val","ansible_role":"RedHatInsights.insights-client","ansible_role_id":1,"description":"","override":true,"variable_type":"string","hidden_value?":true,"validator_type":"","validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2024-11-13 13:58:13 UTC","updated_at":"2024-11-13 13:58:13 UTC","default_value":"abc","imported":false,"override_values":[],"override_values_count":0}
So the change needed would be this, which looks quite weird
'default_value': entity_fields.StringField(), | |
'override_value_order': entity_fields.StringField(), | |
'default_value': entity_fields.StringField(), | |
'override_value_order': entity_fields.StringField(), | |
'hidden_value?': entity_fields.BooleanField(), |
@Gauravtalreja1 Can you check with DEVs what is expected and if they need to fix the API or apidoc?
Anyway, I wouldn't block the PR until it's resolved. It can be added anytime when needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seeing that the PR has been open for ~ 3 months I would not start to hurry now and clarify this in that PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO this is a bug theforeman/foreman_ansible#744
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Gauravtalreja1 @vsedmik As suggested by you above I would merge and cherry-pick the changes and then add the hidden value field to stream once the bug is fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dosas Sorry for the late response. It seems your fix theforeman/foreman_ansible#744 has been merged meanwhile. Do you want to update this PR with the hidden_value
now?
Checked your fix locally:
$ curl -sku admin:changeme -H "Content-type: application/json" -X GET https://satellite.redhat.com/ansible/api/ansible_variables/11 | jq
{
"parameter": "foreman_scap_client_apt_repo_url",
"id": 11,
"variable": "foreman_scap_client_apt_repo_url",
"ansible_role": "theforeman.foreman_scap_client",
"ansible_role_id": 2,
"description": "",
"override": true,
"variable_type": "string",
"validator_type": "",
"validator_rule": null,
"merge_overrides": false,
"merge_default": false,
"avoid_duplicates": false,
"override_value_order": "fqdn\nhostgroup\nos\ndomain",
"created_at": "2024-12-19 08:46:27 UTC",
"updated_at": "2024-12-19 08:48:15 UTC",
"default_value": "deb [trusted=yes] https://apt.atix.de/Ubuntu20LTS/ stable main",
"imported": true,
"override_values": [],
"override_values_count": 0,
"hidden_value": true <---------------------
}
bec86cb
to
e66be96
Compare
e66be96
to
7cc3b5a
Compare
Description of changes
Add AnsibleVariable to entities
Upstream API documentation, plugin, or feature links
I would like to reference to api doc but the latest version I can find is 3.4 ...
Functional demonstration
Example: