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

chore: ntsc config not supported #10056

Merged
merged 13 commits into from
Oct 16, 2024
Merged

chore: ntsc config not supported #10056

merged 13 commits into from
Oct 16, 2024

Conversation

kkunapuli
Copy link
Contributor

@kkunapuli kkunapuli commented Oct 15, 2024

Ticket

CM-559

Description

Returns an error if admins set invariant config for NTSC. Also fixes some nil pointer issues and refines error message when there's a conflict between global and workspace config policies.

Test Plan

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

@cla-bot cla-bot bot added the cla-signed label Oct 15, 2024
Copy link

codecov bot commented Oct 15, 2024

Codecov Report

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

Project coverage is 54.43%. Comparing base (3fc9fed) to head (ed1d237).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
master/internal/configpolicy/utils.go 53.33% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10056      +/-   ##
==========================================
- Coverage   54.43%   54.43%   -0.01%     
==========================================
  Files        1262     1262              
  Lines      158894   158901       +7     
  Branches     3631     3632       +1     
==========================================
- Hits        86498    86491       -7     
- Misses      72262    72276      +14     
  Partials      134      134              
Flag Coverage Δ
backend 45.53% <53.33%> (-0.02%) ⬇️
harness 72.74% <ø> (ø)
web 53.95% <ø> (ø)

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

Files with missing lines Coverage Δ
master/internal/configpolicy/utils.go 24.74% <53.33%> (+1.40%) ⬆️

... and 4 files with indirect coverage changes

Copy link

netlify bot commented Oct 15, 2024

Deploy Preview for determined-ui canceled.

Name Link
🔨 Latest commit ed1d237
🔍 Latest deploy log https://app.netlify.com/sites/determined-ui/deploys/670ef79cb7e2c80008ff8e6d

@@ -211,7 +220,7 @@ func configPolicyConflict(config1, config2 interface{}) {
if field1.IsValid() && field2.IsValid() && !field1.IsZero() && !field2.IsZero() {
// For non-pointer fields, compare directly if both are non-zero
if !reflect.DeepEqual(field1.Interface(), field2.Interface()) {
ConfigPolicyWarning(fmt.Sprintf("%s: %v, %v", GlobalConfigConflictErr, field1.Interface(), field2.Interface()))
ConfigPolicyWarning(fmt.Sprintf("%s: field=%s", GlobalConfigConflictErr, v1.Type().Field(i).Name))
Copy link
Contributor Author

@kkunapuli kkunapuli Oct 15, 2024

Choose a reason for hiding this comment

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

This was confusing: it just printed out the memory address of both fields. We could determine if the field is a pointer or not and print each case differently ... but it seemed simpler and more clear to simply tell the admin which field conflicts.

@kkunapuli kkunapuli marked this pull request as ready for review October 15, 2024 22:42
@kkunapuli kkunapuli requested a review from a team as a code owner October 15, 2024 22:42
@kkunapuli kkunapuli requested review from salonig23 and removed request for salonig23 October 15, 2024 22:42
Copy link
Contributor

@carolinaecalderon carolinaecalderon left a comment

Choose a reason for hiding this comment

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

LGTM, thank you for catching this

@kkunapuli kkunapuli merged commit 315f65d into main Oct 16, 2024
81 of 94 checks passed
@kkunapuli kkunapuli deleted the kunapuli/no-ntsc-config branch October 16, 2024 14:04
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.

2 participants