-
Notifications
You must be signed in to change notification settings - Fork 991
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 #36160 - Redefine append domain names setting #9613
Fixes #36160 - Redefine append domain names setting #9613
Conversation
Can one of the admins verify this patch? |
2 similar comments
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
b8d12f7
to
4c4c44f
Compare
There are more places that now needs to stop using the setting, e.g. foreman/app/services/name_synchronizer.rb Line 28 in 3347fa4
|
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.
Few other places to update:
- app/views/hosts/_form.html.erb
- app/services/name_synchronizer.rb
- test/unit/name_synchronizer_test.rb
- test/models/lookup_value_test.rb
and rubocop
4c4c44f
to
b48c11c
Compare
I guess this PR is going to force FQDN to always be stored as a host name, isn't it? If so, does this affect only managed hosts? What about unmanaged or virtual? Also, do I understand right that from now on the setting should change only the way how to display name of a host? Like in "display short or FQDN" manner with always saving fqdn? I'd also vote to renaming the setting or at least mention that this affect only the view in the description. Related to the problem: currently I'm kinda mad due to upcoming patches and fixes for UI (#9047 and #9140 and #9201 and #9564 and #9591) to fix almost the same thing again and again. Could we maybe unify the logic and the place where we display hostname? Currently I found few places (https://github.com/theforeman/foreman/blob/develop/app/helpers/hosts_helper.rb#L250 https://github.com/theforeman/foreman/blob/develop/app/models/concerns/orchestration/compute.rb#L47 https://github.com/theforeman/foreman/blob/develop/app/services/name_synchronizer.rb#L28 https://github.com/theforeman/foreman/blob/develop/app/assets/javascripts/host_edit_interfaces.js#L71
|
b48c11c
to
837f7b8
Compare
837f7b8
to
954b539
Compare
I think that this setting focuses on a different area than the one in this PR. I don't think it is related or should be changed.
Yes, this PR proposes always storing the FQDN. I don't know what do you mean by
The change in model is in base.rb, so it will affect unmanaged as well. It shouldn't have an effect on virtual hosts according to @stejskalleos.
Yes, you understand correctly that the setting will only control the view and I already changed the setting description.
Wouldn't this simplify things by having FQDN at all times and control only the way it is displayed? @ofedoren |
f6a86d2
to
c7e481a
Compare
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.
Suggestion for UI Description microcopy.
type: :boolean, | ||
description: N_('Foreman will append domain names when new hosts are provisioned'), | ||
description: N_('Foreman will display domain names appended to hostnames.'), |
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.
description: N_('Foreman will display domain names appended to hostnames.'), | |
description: N_('Display names of hosts as FQDNs. If disabled, only display names of hosts as hostnames.'), |
Not sure about the terminology here. If "shortname" is a thing, then maybe say "shortnames" instead of "hostnames". But to my understanding it's called hostnames and I'd prefer the common industry term.
Edit: Also I'd remove "Foreman" from the description, because that wouldn't work well with downstream branding.
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.
You are spot on. I think someone came up with when naming the variable and it caught on.
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.
JS tests are failing:
Error: 81:5 error ouiaId property is missing in PatternFly component 'Card' @theforeman/rules/require-ouiaid
Error: 89:9 error ouiaId property is missing in PatternFly component 'Modal' @theforeman/rules/require-ouiaid
Can you add the ouiaid
field? It's for our automation framework (I think), check with QAs what the value of the fields should be.
c7e481a
to
303c688
Compare
303c688
to
faf3d83
Compare
js Test failures are not related to this pr, I'll open a pr to fix them |
faf3d83
to
a604db6
Compare
ok to test |
This PR aims to unify the format of host names stored in the database and the way they are displayed. With this change, the name of the host is always going to be stored with the domain name appended. The setting formerly named `append_domain_name_for_hosts` is now renamed to `display_fqdn_for_hosts` because it will only impact how the names are displayed from now. This means dashboards and breadcrumbs are going to display the whole FQDN if you choose to.
a604db6
to
520ea40
Compare
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.
🍏 LGTM
Works as expected, let's get this in.
Thanks @Dyrkon and others! |
Big thanks for everyone who commented and helped with the PR! |
This PR aims to unify the format of host names stored in the database and the way they are displayed. With this change, the name of the host is always going to be stored with the domain name appended.
The setting formerly named
append_domain_name_for_hosts
is now renamed todisplay_fqdn_for_hosts
because it will only impact how the names are displayed from now. This means dashboards and breadcrumbs are going to display the whole FQDN if you choose to.