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

fix: fix fallback logic for partially provided custom logos #9842

Merged
merged 7 commits into from
Aug 21, 2024

Conversation

hamidzr
Copy link
Member

@hamidzr hamidzr commented Aug 20, 2024

Ticket

Description

we had a custom logic for doing fallback for variations of the logo that we needed from the user. here we simplify that and leave it to the user to decide to use duplicate vartions if desired.

Test Plan

  • updated unit tests
  • test with an empty logo_path as well as one with some missing logo variation

Checklist

  • Changes have been manually QA'd
  • New features have been approved by the corresponding PM
  • User-facing API changes have the "User-facing API Change" label
  • Release notes have been added as a separate file under docs/release-notes/
    See Release Note for details.
  • Licenses have been included for new code which was copied and/or modified from any external code

@hamidzr hamidzr added the to-cherry-pick Pull requests that need to be cherry-picked into the current release label Aug 20, 2024
@cla-bot cla-bot bot added the cla-signed label Aug 20, 2024
@determined-ci determined-ci added the documentation Improvements or additions to documentation label Aug 20, 2024
@determined-ci determined-ci requested a review from a team August 20, 2024 17:14
Copy link

netlify bot commented Aug 20, 2024

Deploy Preview for determined-ui canceled.

Name Link
🔨 Latest commit 0f9fe26
🔍 Latest deploy log https://app.netlify.com/sites/determined-ui/deploys/66c63e252711780009166839

@hamidzr hamidzr requested a review from a team as a code owner August 20, 2024 20:00
Copy link

codecov bot commented Aug 20, 2024

Codecov Report

Attention: Patch coverage is 68.18182% with 7 lines in your changes missing coverage. Please review.

Project coverage is 54.72%. Comparing base (32fafdd) to head (0f9fe26).
Report is 4 commits behind head on main.

Files Patch % Lines
master/internal/config/ui_config.go 71.42% 6 Missing ⚠️
master/internal/core.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #9842   +/-   ##
=======================================
  Coverage   54.71%   54.72%           
=======================================
  Files        1261     1261           
  Lines      156015   156011    -4     
  Branches     3590     3589    -1     
=======================================
+ Hits        85361    85372   +11     
+ Misses      70522    70507   -15     
  Partials      132      132           
Flag Coverage Δ
backend 45.19% <68.18%> (+0.02%) ⬆️
harness 72.60% <ø> (ø)
web 54.47% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
master/internal/core.go 6.24% <0.00%> (ø)
master/internal/config/ui_config.go 50.00% <71.42%> (-20.46%) ⬇️

... and 6 files with indirect coverage changes

Copy link
Contributor

@amandavialva01 amandavialva01 left a comment

Choose a reason for hiding this comment

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

Looks great! Left a few comments

@hamidzr hamidzr changed the title docs: Add more details about logo path variations fix: fix fallback logic for partially provided custom logos Aug 20, 2024
Copy link
Contributor

@amandavialva01 amandavialva01 left a comment

Choose a reason for hiding this comment

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

These changes LGTM! Just left a few comments about a docs change and some test case naming changes.

},
}

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
result := tt.variations.PickVariation(tt.mode, tt.orientation)
name := fmt.Sprintf("mode=%s, orientation=%s", tt.mode, tt.orientation)
Copy link
Contributor

Choose a reason for hiding this comment

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

If mode or orientation == "", then these test names might be a bit confusing.
Should we do

Suggested change
name := fmt.Sprintf("mode=%s, orientation=%s", tt.mode, tt.orientation)
mode := "none"
if len(tt.mode) > 0 {
mode = tt.mode
}
orientation := "none"
if len(tt.orientation) > 0 {
orientation = tt.orientation
}
name := fmt.Sprintf("mode=%s, orientation=%s", mode, orientation)

Copy link
Contributor

Choose a reason for hiding this comment

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

This is a nit, so feel free to ignore!

Copy link
Contributor

@amandavialva01 amandavialva01 left a comment

Choose a reason for hiding this comment

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

LGTM! Onee small change request and should be good after that!

@hamidzr hamidzr enabled auto-merge (squash) August 21, 2024 20:48
Copy link
Contributor

@amandavialva01 amandavialva01 left a comment

Choose a reason for hiding this comment

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

LGTM, awesome work!

@hamidzr hamidzr merged commit 3a91552 into main Aug 21, 2024
82 of 96 checks passed
@hamidzr hamidzr deleted the hz-morelogodocs branch August 21, 2024 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed documentation Improvements or additions to documentation to-cherry-pick Pull requests that need to be cherry-picked into the current release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants