-
Notifications
You must be signed in to change notification settings - Fork 537
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
OCPBUGS-53412 CONSOLE-4448: Add the ability to specify a second custom logo for PatternFly 6 #2177
OCPBUGS-53412 CONSOLE-4448: Add the ability to specify a second custom logo for PatternFly 6 #2177
Conversation
@cajieh: This pull request references CONSOLE-4404 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.19.0" version, but no target version was set. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
Hello @cajieh! Some important instructions when contributing to openshift/api: |
a7e82ea
to
5947e08
Compare
@cajieh: This pull request references CONSOLE-4404 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.19.0" version, but no target version was set. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
@cajieh: This pull request references CONSOLE-4448 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.19.0" version, but no target version was set. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
@cajieh: This pull request references CONSOLE-4448 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.19.0" version, but no target version was set. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
5947e08
to
f503034
Compare
@cajieh: This pull request references CONSOLE-4448 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.19.0" version, but no target version was set. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
operator/v1/types_console.go
Outdated
// CustomFiles defines a configuration based on theme types for the console UI logo. | ||
type CustomFiles struct { |
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.
A couple things here:
- the name
CustomFiles
is not something that I would generally associate with a configuration for a logo based on themes. Is there another name we could use for the struct that is more representative of this being a theme-based logo substitution (or at the least a logo substitution)? - This is pluralized but represents a single object. I would avoid pluralization of a type unless it is aliased to something like a slice or map.
operator/v1/types_console.go
Outdated
|
||
// CustomFiles defines a configuration based on theme types for the console UI logo. | ||
type CustomFiles struct { | ||
// type of the theme for the console UI. |
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.
The documentation on this field is pretty sparse. I'd recommend taking a look at https://github.com/openshift/enhancements/blob/master/dev-guide/api-conventions.md#write-user-readable-documentation-in-godoc and thinking about how you could improve the godoc here to answer some of the key questions in the doc I linked.
operator/v1/types_console.go
Outdated
// CustomFiles defines a configuration based on theme types for the console UI logo. | ||
type CustomFiles struct { | ||
// type of the theme for the console UI. | ||
// +unionDiscriminator |
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.
This is marked as a union discriminator, but this doesn't really seem to be implementing a discriminated union.
I don't really see a need for this to be a discriminated union so I'd recommend removing this marker.
operator/v1/types_console.go
Outdated
type CustomFiles struct { | ||
// type of the theme for the console UI. | ||
// +unionDiscriminator | ||
// +kubebuilder:validation:Enum:="Dark";"Light" |
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.
This is currently limited to either Dark
or Light
. What if a user wants to use the same logo on both dark and light themes?
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.
This is currently limited to either
Dark
orLight
. What if a user wants to use the same logo on both dark and light themes?
I think in that case, the user would reference the same logo for both themes. I can double check on this.
operator/v1/types_console.go
Outdated
// +kubebuilder:validation:Enum:="Dark";"Light" | ||
// +required | ||
Type ThemeType `json:"type"` | ||
// path is the reference to the ConfigMap in the openshift-config namespace. |
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.
My previous comment on the sparse field documentation applies here as well.
operator/v1/types_console.go
Outdated
// Dimensions: Max height of 68px and max width of 200px | ||
// SVG format preferred | ||
// +optional | ||
CustomLogoFiles CustomFiles `json:"customLogoFiles,omitempty"` |
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.
This seems like it is supposed to be a field where multiple things can be referenced, but the type used is a single object. Should this be a slice of CustomFiles
([]CustomFiles
)?
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.
This seems like it is supposed to be a field where multiple things can be referenced, but the type used is a single object. Should this be a slice of
CustomFiles
([]CustomFiles
)?
Right, but just thinking if this should be a single struct instead since there are only two themes, making it easier to manage and access. Something like this:
type CustomLogoThemeFiles struct {
// Dark specifies the ConfigMap reference for the dark theme logo.
Dark configv1.ConfigMapFileReference `json:"dark,omitempty"`
// Light specifies the ConfigMap reference for the light theme logo.
Light configv1.ConfigMapFileReference `json:"light,omitempty"`
}
However, if more themes are added in the future, the struct will need to be updated. With a slice of structs, there will still be an update needed, at least for the enum type. WDYT?
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.
It sounds reasonable to have a single struct, but some things I would take into consideration when transitioning to a single struct:
- What constraints do you expect to be enforced? For example, can I specify only a dark theme or do I have to specify both? How do these constraints evolve as new fields are added?
- How often do you anticipate new fields/options needing to be added?
08ce713
to
59f99fc
Compare
7464d04
to
d6ca60e
Compare
Changes look good One nit though, why are we not gating this addition? All new features are supposed to be behind feature gates now and show sufficient stability prior to being enabled by default How complete is the rest of the implementation of this feature? Are there tests being written? |
7a131a1
to
84cc3c5
Compare
84cc3c5
to
4207302
Compare
configMap: | ||
name: custom-logos-config | ||
key: masthead-dark-logo.svg | ||
expectedError: "spec.customization.logos[0].themes[0].source.from: Unsupported value: \"InvalidSource\": supported values: \"ConfigMap\"" |
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.
I think it looks right again. This trips me up.:)
I will defer to @jhadvig on this. |
@JoelSpeed so this story is actually a bug in the console, which we discovered when upgrading to PatternFly version 6. PatternFly is a design system that provides a set of reusable UI components. With this update we need to provide two logos, one for dark theme and light theme. The same goes for the favicon. So technically its a bug on our end, which we need to address with the PF6 upgrade - part of 4.19. |
/retitle OCPBUGS-53412 CONSOLE-4448: Add the ability to specify a second custom logo for PatternFly 6 |
@cajieh: This pull request references Jira Issue OCPBUGS-53412, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. This pull request references CONSOLE-4448 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.19.0" version, but no target version was set. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
/jira refresh |
@jhadvig: This pull request references Jira Issue OCPBUGS-53412, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
Requesting review from QA contact: This pull request references CONSOLE-4448 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.19.0" version, but no target version was set. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cajieh, everettraven, jhadvig, JoelSpeed The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@cajieh: Jira Issue OCPBUGS-53412: All pull requests linked via external trackers have merged: Jira Issue OCPBUGS-53412 has been moved to the MODIFIED state. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
[ART PR BUILD NOTIFIER] Distgit: ose-cluster-config-api |
The change is to add a new
CustomLogos
field for specifying the console logos for light and dark themes, and to mark the currentCustomLogoFile
field as deprecated.cc: @jhadvig @spadgett
Example of how the CustomLogos map to the ConfigMap:
CustomLogo ConfigMap:
CustomLogos sample structure: