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

change: remove ID of consumer #1745

Merged
merged 24 commits into from
Apr 19, 2021
Merged

Conversation

nic-chen
Copy link
Member

@nic-chen nic-chen commented Apr 11, 2021

Please answer these questions before submitting a pull request, or your PR will get closed.

Why submit this pull request?

  • Bugfix
  • New feature provided
  • Improve performance
  • Backport patches

APISIX has removed the consumer id in version 2.5, see: apache/apisix#3868.

Dashboard also needs to remove the consumer id before it can be used with APISIX 2.5 and above.

What changes will this PR take into?

  1. Sync schema from APISIX 2.5 version
  2. Remove the id field from the consumer's struct
  3. Modify related test cases

Related issues

close #1742

Checklist:

  • Did you explain what problem does this PR solve? Or what new features have been added?
  • Have you added corresponding test cases?
  • Have you modified the corresponding document?
  • Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first

@netlify
Copy link

netlify bot commented Apr 11, 2021

Deploy preview for apisix-dashboard ready!

Built with commit 15d1ce5

https://deploy-preview-1745--apisix-dashboard.netlify.app

Copy link
Contributor

@starsz starsz left a comment

Choose a reason for hiding this comment

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

It seems we don't modify E2E test.
Do we need?

// sleep for process log
time.Sleep(1500 * time.Millisecond)
logContent := ReadAPISIXErrorLog(t)
fmt.Println("logContent:", logContent)
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 debugging info?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, removed.

@@ -22,7 +22,7 @@ etcd:
- "http://172.16.238.10:2379"
- "http://172.16.238.11:2379"
- "http://172.16.238.12:2379"
resync_delay: 0.1 # sync data from etcd quickly for e2e test
resync_delay: 1 # sync data from etcd quickly for e2e test
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to modify this?

Copy link
Member Author

@nic-chen nic-chen Apr 12, 2021

Choose a reason for hiding this comment

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

sure. APISIX allow only int for this configuration now.

assert.True(t, args.Bool(2))
}).Return(tc.giveRet, tc.giveErr)

mStore.On("Get", mock.Anything).Run(func(args mock.Arguments) {
}).Return(nil, nil)
Copy link
Contributor

Choose a reason for hiding this comment

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

We should test if the Get returns a consumer.

@codecov-io
Copy link

Codecov Report

Merging #1745 (389f93e) into master (8b6080d) will decrease coverage by 20.10%.
The diff coverage is 60.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master    #1745       +/-   ##
===========================================
- Coverage   72.45%   52.34%   -20.11%     
===========================================
  Files         132       38       -94     
  Lines        5721     2661     -3060     
  Branches      649        0      -649     
===========================================
- Hits         4145     1393     -2752     
+ Misses       1334     1080      -254     
+ Partials      242      188       -54     
Flag Coverage Δ
backend-e2e-test ?
backend-e2e-test-ginkgo ?
backend-unit-test 52.34% <60.00%> (+0.05%) ⬆️
frontend-e2e-test ?

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

Impacted Files Coverage Δ
api/internal/core/entity/entity.go 0.00% <ø> (-100.00%) ⬇️
api/internal/handler/consumer/consumer.go 66.66% <60.00%> (-24.83%) ⬇️
api/internal/utils/version.go 0.00% <0.00%> (-100.00%) ⬇️
api/internal/filter/request_id.go 0.00% <0.00%> (-100.00%) ⬇️
api/internal/core/store/storehub.go 0.00% <0.00%> (-74.77%) ⬇️
api/internal/filter/cors.go 0.00% <0.00%> (-66.67%) ⬇️
api/internal/filter/schema.go 0.00% <0.00%> (-55.47%) ⬇️
api/internal/utils/consts/api_error.go 0.00% <0.00%> (-50.00%) ⬇️
api/internal/handler/data_loader/route_import.go 27.41% <0.00%> (-37.50%) ⬇️
... and 120 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8b6080d...389f93e. Read the comment docs.

@nic-chen
Copy link
Member Author

@juzhiyuan @LiteSun
FE CI failed, please help to check, thanks.

@juzhiyuan
Copy link
Member

@nic-chen Please take a look #1752, once it's merged, please resync your branch. Thanks!

@nic-chen
Copy link
Member Author

@nic-chen Please take a look #1752, once it's merged, please resync your branch. Thanks!

After synchronizing the code, it still failed. Does FE need to make responsive changes?

@juzhiyuan
Copy link
Member

This test failed due to raw data editor 🤔 It's the first time that failed, if it still failed after rerun, then need @LiteSun's help.

@juzhiyuan
Copy link
Member

test-rawDataEditor.spec.js.mp4

@nic-chen I see what happened, the test failed due to Network error, does this PR changes some fields or?

@juzhiyuan
Copy link
Member

see 00:34

@nic-chen
Copy link
Member Author

does this PR changes some fields or?

remove ID of consumer. @juzhiyuan

@nic-chen nic-chen requested a review from tokers April 14, 2021 10:33
@nic-chen
Copy link
Member Author

FE CI still failed, please have a look when you have time. thanks. @LiteSun

@juzhiyuan
Copy link
Member

cecb6cf

Wait for this PR cecb6cf or take the above change :)

@juzhiyuan
Copy link
Member

@LiteSun You may need to take some changes with FE & API.

@codecov-commenter
Copy link

codecov-commenter commented Apr 17, 2021

Codecov Report

❗ No coverage uploaded for pull request base (master@f1b8f0c). Click here to learn what that means.
The diff coverage is 52.63%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #1745   +/-   ##
=========================================
  Coverage          ?   71.69%           
=========================================
  Files             ?      172           
  Lines             ?     6049           
  Branches          ?      699           
=========================================
  Hits              ?     4337           
  Misses            ?     1468           
  Partials          ?      244           
Flag Coverage Δ
backend-e2e-test 62.04% <27.77%> (?)
backend-e2e-test-ginkgo 48.87% <16.66%> (?)
backend-unit-test 52.41% <50.00%> (?)
frontend-e2e-test 71.95% <100.00%> (?)

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

Impacted Files Coverage Δ
api/internal/core/entity/entity.go 100.00% <ø> (ø)
api/internal/core/store/store_mock.go 0.00% <0.00%> (ø)
api/internal/handler/consumer/consumer.go 91.07% <69.23%> (ø)
web/src/components/Plugin/PluginDetail.tsx 62.23% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f1b8f0c...15d1ce5. Read the comment docs.

@nic-chen nic-chen merged commit 5d9cd3f into apache:master Apr 19, 2021
@nic-chen nic-chen deleted the remove-consumer-id branch April 19, 2021 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

change: remove ID of consumer
9 participants