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

Fixes #37612 - Fix deletion of Ansible variables from Host page #723

Merged
merged 1 commit into from
Aug 6, 2024

Conversation

nofaralfasi
Copy link
Contributor

@nofaralfasi nofaralfasi commented Jun 30, 2024

  • Use isEqual for deep comparison when matching variable values,
    ensuring correct behavior during variable deletion.
  • Add defaultValue field to GraphQL mutation, for proper value display
    after Ansible variable deletion.

@Thorben-D
Copy link
Contributor

Looks like a sensible change but I can't test it unfortunately, as I am not sure how to reproduce the issue.

@nofaralfasi
Copy link
Contributor Author

Looks like a sensible change but I can't test it unfortunately, as I am not sure how to reproduce the issue.

I added the steps to reproduce this bug - https://projects.theforeman.org/issues/37612#note-2

@Thorben-D
Copy link
Contributor

Thank you for adding the reproducer!
I tested it and can confirm that the deletion of overrides is now working.
I did however notice a different issue:
TypeError: Cannot read properties of null (reading 'value') at AnsibleVariableOverridesTableHelper.js:52:59

This happens because the OverridenAnsibleVariablePresenter returns nil for the current_value field, as the override has just been deleted.
This then breaks this function, which is used to set the text of the "Value" and "Edit" field. Right now, the edit field still retains the override-value after deletion.

@nofaralfasi nofaralfasi marked this pull request as draft August 4, 2024 15:48
- Use `isEqual` for deep comparison when matching variable values,
  ensuring correct behavior during variable deletion.
- Add `defaultValue` field to GraphQL mutation, for proper display
  after Ansible variable deletion.
@stejskalleos
Copy link
Contributor

@MariaAga review please

Copy link
Member

@MariaAga MariaAga left a comment

Choose a reason for hiding this comment

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

lgtm

@stejskalleos stejskalleos merged commit 1f8e278 into theforeman:master Aug 6, 2024
27 of 28 checks passed
@stejskalleos
Copy link
Contributor

Thanks @nofaralfasi @Thorben-D @MariaAga

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