Fixes #37417 - OverriddenAnsibleVariablePresenter GraphQL scheme incorrect for hidden_value and override#716
Conversation
500fe9e to
b8a6df8
Compare
…rrect for hidden_value and override
b8a6df8 to
1b2ed8b
Compare
|
@stejskalleos can you please review this? |
|
I'm unclear on what exactly isn't working and what we're trying to fix with these changes. Additionally, I'm not sure where the new methods are being used. |
|
In the AnsibleVariable model, hidden_value returns a series of asterisks, while hidden_value? returns a boolean. The author's intention was to delegate hidden_value?, but this led to an illegal field name "hidden_value?" in the GraphQL query. Similarly, override? faced the same issue. This has been rectified by wrapping hidden_value? in a new method named hidden_value within the presenter. |
The |
|
You're right, right now neither |
|
Can we somehow continue this PR? We had the following issue, which we were able to fix by this PR. I don't see a reason why such a PR is not merged. If there is a request which should be adapted, please let us exactly know so that we can finish it. |
|
Hi @sbernhard, I thought this PR is needed for #717, which is not ready yet (see my comment here https://github.com/theforeman/foreman_ansible/pull/717/files#r1741039438). |
In the model AnsibleVariable, there is hidden_value, which returns "*****" and there is hidden_value**?**, which returns a boolean.
For GraphQL, the method name must be the same as the value entered in the gql-query. By delegating hidden_value**?**, the original author effectively named the gql-field "hidden_value?", which is not allowed and was therefore not working.
The same applies to override.
This is fixed by wrapping the value of hidden_value**?** in a new method hidden_value in the presenter.
Required by #717