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: generate an uid when post a route without id #1883

Merged
merged 1 commit into from May 10, 2021

Conversation

starsz
Copy link
Contributor

@starsz starsz commented May 10, 2021

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

Why submit this pull request?

This PR is to fix this situation:
when creating the route with the script, but without the id.The original logic will return the key is required.

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

What changes will this PR take into?

Fix the situation:
When creating the route with the script, but without the id.The original logic will return the key is required.

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 May 10, 2021

Deploy preview for apisix-dashboard ready!

Built with commit 8e97cf3

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

@codecov-commenter
Copy link

Codecov Report

Merging #1883 (8e97cf3) into master (b1e66a2) will decrease coverage by 5.56%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1883      +/-   ##
==========================================
- Coverage   72.10%   66.54%   -5.57%     
==========================================
  Files         125      173      +48     
  Lines        2947     6208    +3261     
  Branches      711      712       +1     
==========================================
+ Hits         2125     4131    +2006     
- Misses        822     1755     +933     
- Partials        0      322     +322     
Flag Coverage Δ
backend-e2e-test 45.76% <0.00%> (?)
backend-e2e-test-ginkgo 48.40% <100.00%> (?)
frontend-e2e-test 72.47% <ø> (+0.36%) ⬆️

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

Impacted Files Coverage Δ
api/internal/handler/route/route.go 67.75% <100.00%> (ø)
api/internal/core/storage/etcd.go 47.27% <0.00%> (ø)
api/internal/route.go 85.29% <0.00%> (ø)
api/internal/core/store/validate.go 55.86% <0.00%> (ø)
api/internal/conf/conf.go 61.03% <0.00%> (ø)
api/internal/log/log.go 50.00% <0.00%> (ø)
api/internal/utils/runtime/runtime.go 0.00% <0.00%> (ø)
api/internal/utils/json_patch.go 44.82% <0.00%> (ø)
.../internal/handler/authentication/authentication.go 88.23% <0.00%> (ø)
api/internal/handler/global_rule/global_rule.go 64.51% <0.00%> (ø)
... and 42 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 b1e66a2...8e97cf3. Read the comment docs.

@starsz starsz requested review from Jaycean, nic-chen, tokers and imjoey and removed request for Jaycean May 10, 2021 09:02
@tokers tokers changed the title fix: generate a uid when post a route without id fix: generate an uid when post a route without id May 10, 2021
@@ -23,6 +23,7 @@ import (
"github.com/onsi/ginkgo"
"github.com/onsi/ginkgo/extensions/table"
"github.com/onsi/gomega"
"github.com/tidwall/gjson"

Copy link
Member

Choose a reason for hiding this comment

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

Hi, this file seems doesn't test script field?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The request body was contained in dag-conf.json.Also include the script field.
You can see this file line 32.

bytes, err := ioutil.ReadFile("../../testdata/dag-conf.json")

@juzhiyuan juzhiyuan merged commit 1770596 into apache:master May 10, 2021
@starsz starsz deleted the fix_script_id branch May 10, 2021 11:12
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.

None yet

5 participants