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

Replace Host.validate_destroy with supports feature #7639

Conversation

@agrare agrare force-pushed the replace_host_validate_destroy_with_supports_feature branch from 9cd611d to 912ad58 Compare February 22, 2021 21:34
@agrare
Copy link
Member Author

agrare commented Feb 22, 2021

@miq-bot cross-repo-tests including ManageIQ/manageiq#21073

@miq-bot
Copy link
Member

miq-bot commented Feb 22, 2021

@agrare 'cross-repo-test(s)' was given invalid repo names and cannot continue

  • including https://github.com/ManageIQ/manageiq/pull/21073

@agrare
Copy link
Member Author

agrare commented Feb 22, 2021

@miq-bot cross-repo-tests ManageIQ/manageiq#21073

@miq-bot
Copy link
Member

miq-bot commented Feb 22, 2021

Checked commit agrare@912ad58 with ruby 2.6.3, rubocop 0.82.0, haml-lint 0.35.0, and yamllint
1 file checked, 0 offenses detected
Everything looks fine. 🍰

miq-bot pushed a commit to ManageIQ/manageiq-cross_repo-tests that referenced this pull request Feb 22, 2021
agrare added a commit to ManageIQ/manageiq-cross_repo-tests that referenced this pull request Feb 22, 2021
@chessbyte chessbyte closed this Feb 22, 2021
@chessbyte chessbyte reopened this Feb 22, 2021
@agrare agrare closed this Feb 22, 2021
@agrare agrare reopened this Feb 22, 2021
@agrare
Copy link
Member Author

agrare commented Feb 22, 2021

Weird spec:jest passes locally, I'll investigate

@agrare
Copy link
Member Author

agrare commented Feb 24, 2021

@h-kataria I'm not able to get this to fail locally but it looks like this jest failure is also on master can you help out here? Not sure what this error means or how to fix it.

@h-kataria
Copy link
Contributor

@agrare can you try `yarn test -u˙ on the latest master and commit the changes, that should fix the CI, it should create a new snapshot.

@agrare
Copy link
Member Author

agrare commented Feb 24, 2021

@h-kataria when I run that I don't see an local changes, but again this wasn't failing for me locally

@h-kataria
Copy link
Contributor

@himdel can you help with jest failures?

@Fryguy
Copy link
Member

Fryguy commented Feb 24, 2021

@h-kataria SecondaryButtonSet is specifically a Carbon thing. See https://github.com/search?q=SecondaryButtonSet&type=code. I bet carbon updated and broke something.

@chessbyte chessbyte self-assigned this Feb 24, 2021
@chessbyte
Copy link
Member

Merging since the jest failure is unrelated.

@chessbyte chessbyte merged commit 54cc0a5 into ManageIQ:master Feb 24, 2021
@agrare agrare deleted the replace_host_validate_destroy_with_supports_feature branch February 24, 2021 17:08
@himdel
Copy link
Contributor

himdel commented Feb 24, 2021

jest fixed in #7645 :)

@agrare
Copy link
Member Author

agrare commented Feb 24, 2021

Marking lasker/yes? as the core changes landed before the branch

Fryguy pushed a commit that referenced this pull request Mar 1, 2021
…th_supports_feature

Replace Host.validate_destroy with supports feature

(cherry picked from commit 54cc0a5)
@Fryguy
Copy link
Member

Fryguy commented Mar 1, 2021

Backport details

commit a49b5910feaf61d20015a2ee05b219cc5b87cef8 (HEAD -> lasker, upstream/lasker)
Author: Oleg Barenboim <[email protected]>
Date:   Wed Feb 24 11:57:14 2021 -0500

    Merge pull request #7639 from agrare/replace_host_validate_destroy_with_supports_feature

    Replace Host.validate_destroy with supports feature

    (cherry picked from commit 54cc0a5af0071b299754822002a0662633e69b1c)

if !validation[:available]
add_flash(validation[:message], :error)
if !host.supports?(:destroy)
add_flash(host.unsupported_reason(:destroy), :error)
Copy link
Member

Choose a reason for hiding this comment

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

@Fryguy so, if the model has N_() for the unsupported reason, then all the UI callers have to translate that via _() in places like this. Is that correct? Asking because of this discussion in a different PR.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, I believe so. From what I can tell, N_() just tells the i18n engine to consider that string for translation (i.e. put it in the catalog), but don't actually translate it. That's why it's used for things like constants and enums. However you have to call _() to actually translate it. If you were to use _() on a constant it would translate once at constant resolution time, then never translate again for the user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OpenStack infra node destroy should use SupportFeaturesMixin instead of validate_<feature>
6 participants