-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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 replication of multiple projects with numeric names #21474
base: main
Are you sure you want to change the base?
fix: fix replication of multiple projects with numeric names #21474
Conversation
e841434
to
dd06536
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #21474 +/- ##
==========================================
+ Coverage 45.36% 46.17% +0.81%
==========================================
Files 244 247 +3
Lines 13333 13883 +550
Branches 2719 2875 +156
==========================================
+ Hits 6049 6411 +362
- Misses 6983 7134 +151
- Partials 301 338 +37
Flags with carried forward coverage won't be shown. Click here to find out more. |
nice catch! |
dd06536
to
1f6f427
Compare
FYI, all of the tests were previously passing on this, but after I updated the branch for "out-of-date with base", the test statuses have been reset. Since I don't have permission to run those tests, I'm not planning to do another "Update branch" until they've been re-run and the PR has 2 approvals from maintainers. |
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
Signed-off-by: Chris Girard <[email protected]>
This keeps the server from parsing all-numeric project names as integer values which it does not like. Signed-off-by: Chris Girard <[email protected]>
1f6f427
to
77da6b0
Compare
Thank you for contributing to Harbor!
Comprehensive Summary of your change
The original fix to #19027 contained in #19090 worked well for replicating a single project whose name was numeric, but did not resolve the issue when multiple numeric project names were provided.
The issue was in the construction of the API call. The query parameter was previously being constructed as
name={'123 456 789'}
. With the addition of some debug logging (also included in this PR), I noticed that the server was parsing this as'123
,456
,789'
. Note that the single quotes were being associated with the first and last values of the list, so these values were forced into parsing as string values. However, the middle value contains only numbers and so was parsed as such. This doesn't cause a problem when only 1 or 2 values are being passed, but can show itself once there are 3 or more values.The solution is to surround each project name in quotes,
name={'123' '456' '789'}
, so they are all handled as strings by the server.Issue being fixed
Further fixes #19027.
Please indicate you've done the following: