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

Fixed phys_locations update API to remove error related to mismatching region name and ID #7762

Merged
merged 2 commits into from Aug 30, 2023

Conversation

srijeet0406
Copy link
Contributor

@srijeet0406 srijeet0406 commented Aug 30, 2023

This PR is not related to any issue. It fixes the case where a physical location could not be updated in api v5.0, due to a bug where regiona name and region ID do not match.


Which Traffic Control components are affected by this PR?

  • Traffic Ops

What is the best way to verify this PR?

If the user uses TP (with version 5) to update a PhysLoc's Region, the update will fail with the message "region name and ID do not match" before this PR. This error should be fixed with this change.
It can also be recreated by calling the endpoint and changing just the ID (and not the name). In this case the API should use the ID instead of name.

If this is a bugfix, which Traffic Control versions contained the bug?

  • master

PR submission checklist

@srijeet0406 srijeet0406 changed the title Fixed phys_locations update API to remove error related to mismatchin… Fixed phys_locations update API to remove error related to mismatching region name and ID Aug 30, 2023
@srijeet0406 srijeet0406 added Traffic Ops related to Traffic Ops regression bug a bug in existing functionality introduced by a new version labels Aug 30, 2023
@codecov
Copy link

codecov bot commented Aug 30, 2023

Codecov Report

Merging #7762 (6709a28) into master (82901de) will decrease coverage by 0.02%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##             master    #7762      +/-   ##
============================================
- Coverage     31.90%   31.88%   -0.02%     
  Complexity       98       98              
============================================
  Files           712      712              
  Lines         81920    81907      -13     
  Branches        965      965              
============================================
- Hits          26134    26114      -20     
- Misses        53641    53642       +1     
- Partials       2145     2151       +6     
Flag Coverage Δ
golib_unit 53.70% <ø> (+<0.01%) ⬆️
grove_unit 12.02% <ø> (ø)
t3c_unit 5.99% <ø> (ø)
traffic_monitor_unit 26.33% <ø> (ø)
traffic_ops_integration 69.38% <ø> (ø)
traffic_ops_unit 21.60% <ø> (-0.05%) ⬇️
traffic_portal_v2 74.38% <ø> (-0.02%) ⬇️
traffic_stats_unit 10.76% <ø> (ø)
unit_tests 29.18% <ø> (-0.03%) ⬇️
v3 57.79% <ø> (ø)
v4 79.18% <ø> (ø)
v5 78.49% <ø> (ø)

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

Files Changed Coverage Δ
.../traffic_ops_golang/physlocation/phys_locations.go 10.32% <ø> (+0.30%) ⬆️

... and 3 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@shamrickus shamrickus left a comment

Choose a reason for hiding this comment

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

LGTM
Added test case and bug is fixed.

@shamrickus shamrickus merged commit 2cf3335 into apache:master Aug 30, 2023
42 of 43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression bug a bug in existing functionality introduced by a new version Traffic Ops related to Traffic Ops
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants