You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/04/21 07:45:21 UTC

[GitHub] [apisix-dashboard] liuxiran opened a new pull request #1812: fix: can not configure upstream with no nodes

liuxiran opened a new pull request #1812:
URL: https://github.com/apache/apisix-dashboard/pull/1812


   Please answer these questions before submitting a pull request, **or your PR will get closed**.
   
   **Why submit this pull request?**
   
   - [X] Bugfix
   - [ ] New feature provided
   - [ ] Improve performance
   - [ ] Backport patches
   
   **What changes will this PR take into?**
   
   Please update this section with detailed description.
   
   During rechecking #1803 , there is a problem occured when I try to configure a upstream with no nodes.
   
   Test steps:
   
   1. Create an upstream with no nodes
   2. Configure this upstream with no changes, an Submit the data, the error occured
   
   ![2021-04-21 15-32-32屏幕截图](https://user-images.githubusercontent.com/2561857/115514584-d36fd000-a2b6-11eb-9029-e966a67699f7.png)
   
   This pr tried to change the fe logic to solve this problem.
   
   Doc: 
   Delete `k8s_deployment_info` in upstream just refer to https://github.com/apache/apisix/blob/359e0906c5a3f0149c0f6a44aff927d4c4eb8c6b/CHANGELOG.md#220
   
   TODO
   
   - [ ] add test case
   
   
   
   **Related issues**
   
   None
   
   **Checklist:**
   
   - [X] 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
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] netlify[bot] edited a comment on pull request #1812: fix: can not configure upstream with no nodes

Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #1812:
URL: https://github.com/apache/apisix-dashboard/pull/1812#issuecomment-823852872






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] imjoey merged pull request #1812: fix: can not configure upstream with no nodes

Posted by GitBox <gi...@apache.org>.
imjoey merged pull request #1812:
URL: https://github.com/apache/apisix-dashboard/pull/1812


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] netlify[bot] edited a comment on pull request #1812: fix: can not configure upstream with no nodes

Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #1812:
URL: https://github.com/apache/apisix-dashboard/pull/1812#issuecomment-823852872


   Deploy preview for *apisix-dashboard* ready!
   
   Built with commit 79f014e2c3e3077f1aa7c8e535b36f8b46a9c6a8
   
   https://deploy-preview-1812--apisix-dashboard.netlify.app


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] liuxiran commented on a change in pull request #1812: fix: can not configure upstream with no nodes

Posted by GitBox <gi...@apache.org>.
liuxiran commented on a change in pull request #1812:
URL: https://github.com/apache/apisix-dashboard/pull/1812#discussion_r619734507



##########
File path: api/internal/core/entity/format_test.go
##########
@@ -101,3 +101,53 @@ func TestNodesFormat_Map(t *testing.T) {
 	assert.Contains(t, jsonStr, `"port":8080`)
 	assert.Contains(t, jsonStr, `"host":"127.0.0.1"`)
 }
+
+func TestNodesFormat_empty_struct(t *testing.T) {
+	// route data saved in ETCD
+	routeStr := `{
+		"uris": ["/*"],
+		"upstream": {
+			"type": "roundrobin",
+			"nodes": []
+		}
+	}`
+
+	// bind struct
+	var route Route
+	err := json.Unmarshal([]byte(routeStr), &route)
+	assert.Nil(t, err)
+
+	// nodes format
+	nodes := NodesFormat(route.Upstream.Nodes)
+
+	// json encode for client
+	res, err := json.Marshal(nodes)
+	assert.Nil(t, err)
+	jsonStr := string(res)
+	assert.Contains(t, jsonStr, `[]`)
+}
+
+func TestNodesFormat_empty_map(t *testing.T) {
+	// route data saved in ETCD
+	routeStr := `{
+		"uris": ["/*"],
+		"upstream": {
+			"type": "roundrobin",
+			"nodes": {}
+		}
+	}`
+
+	// bind struct
+	var route Route
+	err := json.Unmarshal([]byte(routeStr), &route)
+	assert.Nil(t, err)
+
+	// nodes format
+	nodes := NodesFormat(route.Upstream.Nodes)
+
+	// json encode for client
+	res, err := json.Marshal(nodes)
+	assert.Nil(t, err)
+	jsonStr := string(res)
+	assert.Contains(t, jsonStr, `[]`)
+}

Review comment:
       done.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #1812: fix: can not configure upstream with no nodes

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1812:
URL: https://github.com/apache/apisix-dashboard/pull/1812#issuecomment-825484125


   # [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1812](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (83ae2bc) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/a476ad7f264a1166290fe0bdb397d2d26cfd23c2?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a476ad7) will **decrease** coverage by `0.31%`.
   > The diff coverage is `100.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #1812      +/-   ##
   ==========================================
   - Coverage   71.85%   71.54%   -0.32%     
   ==========================================
     Files         172       47     -125     
     Lines        6100     3152    -2948     
     Branches      713        0     -713     
   ==========================================
   - Hits         4383     2255    -2128     
   + Misses       1474      653     -821     
   - Partials      243      244       +1     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | backend-e2e-test | `46.31% <100.00%> (-0.39%)` | :arrow_down: |
   | backend-e2e-test-ginkgo | `49.17% <100.00%> (ø)` | |
   | backend-unit-test | `52.44% <100.00%> (+0.03%)` | :arrow_up: |
   | frontend-e2e-test | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [api/internal/core/entity/format.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2Zvcm1hdC5nbw==) | `62.79% <100.00%> (ø)` | |
   | [api/internal/core/store/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmUuZ28=) | `86.82% <0.00%> (-2.40%)` | :arrow_down: |
   | [api/internal/core/storage/etcd.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmFnZS9ldGNkLmdv) | `45.45% <0.00%> (-1.82%)` | :arrow_down: |
   | [.../components/active-check/Unhealthy/TCPFailures.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1Vwc3RyZWFtL2NvbXBvbmVudHMvYWN0aXZlLWNoZWNrL1VuaGVhbHRoeS9UQ1BGYWlsdXJlcy50c3g=) | | |
   | [.../Route/components/DebugViews/DebugFormDataView.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9wYWdlcy9Sb3V0ZS9jb21wb25lbnRzL0RlYnVnVmlld3MvRGVidWdGb3JtRGF0YVZpZXcudHN4) | | |
   | [web/src/pages/Route/components/Step2/index.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9wYWdlcy9Sb3V0ZS9jb21wb25lbnRzL1N0ZXAyL2luZGV4LnRzeA==) | | |
   | [...mponents/Upstream/components/active-check/Host.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1Vwc3RyZWFtL2NvbXBvbmVudHMvYWN0aXZlLWNoZWNrL0hvc3QudHN4) | | |
   | [...eb/src/pages/PluginTemplate/components/Preview.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9wYWdlcy9QbHVnaW5UZW1wbGF0ZS9jb21wb25lbnRzL1ByZXZpZXcudHN4) | | |
   | [web/src/components/IconFont/IconFont.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL0ljb25Gb250L0ljb25Gb250LnRzeA==) | | |
   | [web/src/components/PluginOrchestration/service.ts](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1BsdWdpbk9yY2hlc3RyYXRpb24vc2VydmljZS50cw==) | | |
   | ... and [116 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [a476ad7...83ae2bc](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] netlify[bot] edited a comment on pull request #1812: fix: can not configure upstream with no nodes

Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #1812:
URL: https://github.com/apache/apisix-dashboard/pull/1812#issuecomment-823852872


   Deploy preview for *apisix-dashboard* processing.
   
   Building with commit a4a7e3edde0448783c45e06ba34a621559cb5dd6
   
   https://app.netlify.com/sites/apisix-dashboard/deploys/6082817f78934e0007b1a00e


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] netlify[bot] edited a comment on pull request #1812: fix: can not configure upstream with no nodes

Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #1812:
URL: https://github.com/apache/apisix-dashboard/pull/1812#issuecomment-823852872


   Deploy preview for *apisix-dashboard* ready!
   
   Built with commit 569b91eaaaa8c4641c3cbd681eeb7e8c9f35a757
   
   https://deploy-preview-1812--apisix-dashboard.netlify.app


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] codecov-commenter commented on pull request #1812: fix: can not configure upstream with no nodes

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #1812:
URL: https://github.com/apache/apisix-dashboard/pull/1812#issuecomment-825484125


   # [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1812](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (10db8d7) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/a476ad7f264a1166290fe0bdb397d2d26cfd23c2?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a476ad7) will **decrease** coverage by `19.48%`.
   > The diff coverage is `100.00%`.
   
   > :exclamation: Current head 10db8d7 differs from pull request most recent head a4a7e3e. Consider uploading reports for the commit a4a7e3e to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff             @@
   ##           master    #1812       +/-   ##
   ===========================================
   - Coverage   71.85%   52.37%   -19.49%     
   ===========================================
     Files         172       39      -133     
     Lines        6100     2740     -3360     
     Branches      713        0      -713     
   ===========================================
   - Hits         4383     1435     -2948     
   + Misses       1474     1111      -363     
   + Partials      243      194       -49     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | backend-e2e-test | `?` | |
   | backend-e2e-test-ginkgo | `?` | |
   | backend-unit-test | `52.37% <100.00%> (-0.04%)` | :arrow_down: |
   | frontend-e2e-test | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [api/internal/core/entity/format.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2Zvcm1hdC5nbw==) | `60.46% <100.00%> (-2.33%)` | :arrow_down: |
   | [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [api/internal/filter/request\_id.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9yZXF1ZXN0X2lkLmdv) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=) | `0.00% <0.00%> (-71.03%)` | :arrow_down: |
   | [api/internal/filter/cors.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9jb3JzLmdv) | `0.00% <0.00%> (-66.67%)` | :arrow_down: |
   | [api/internal/filter/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9zY2hlbWEuZ28=) | `0.00% <0.00%> (-55.47%)` | :arrow_down: |
   | [api/internal/utils/consts/api\_error.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL2NvbnN0cy9hcGlfZXJyb3IuZ28=) | `0.00% <0.00%> (-50.00%)` | :arrow_down: |
   | [api/internal/handler/data\_loader/route\_import.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZGF0YV9sb2FkZXIvcm91dGVfaW1wb3J0Lmdv) | `27.41% <0.00%> (-37.50%)` | :arrow_down: |
   | [api/internal/handler/handler.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvaGFuZGxlci5nbw==) | `42.59% <0.00%> (-35.19%)` | :arrow_down: |
   | ... and [157 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [a476ad7...a4a7e3e](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #1812: fix: can not configure upstream with no nodes

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1812:
URL: https://github.com/apache/apisix-dashboard/pull/1812#issuecomment-825484125


   # [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1812](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (83ae2bc) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/a476ad7f264a1166290fe0bdb397d2d26cfd23c2?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a476ad7) will **decrease** coverage by `4.05%`.
   > The diff coverage is `100.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #1812      +/-   ##
   ==========================================
   - Coverage   71.85%   67.79%   -4.06%     
   ==========================================
     Files         172       47     -125     
     Lines        6100     3152    -2948     
     Branches      713        0     -713     
   ==========================================
   - Hits         4383     2137    -2246     
   + Misses       1474      752     -722     
   - Partials      243      263      +20     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | backend-e2e-test | `46.31% <100.00%> (-0.39%)` | :arrow_down: |
   | backend-e2e-test-ginkgo | `?` | |
   | backend-unit-test | `52.44% <100.00%> (+0.03%)` | :arrow_up: |
   | frontend-e2e-test | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [api/internal/core/entity/format.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2Zvcm1hdC5nbw==) | `62.79% <100.00%> (ø)` | |
   | [api/internal/handler/healthz/healthz.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvaGVhbHRoei9oZWFsdGh6Lmdv) | `66.66% <0.00%> (-33.34%)` | :arrow_down: |
   | [...l/handler/route\_online\_debug/route\_online\_debug.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvcm91dGVfb25saW5lX2RlYnVnL3JvdXRlX29ubGluZV9kZWJ1Zy5nbw==) | `56.92% <0.00%> (-26.16%)` | :arrow_down: |
   | [api/internal/filter/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9zY2hlbWEuZ28=) | `31.93% <0.00%> (-23.53%)` | :arrow_down: |
   | [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `81.25% <0.00%> (-18.75%)` | :arrow_down: |
   | [api/internal/log/log.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2xvZy9sb2cuZ28=) | `40.00% <0.00%> (-10.00%)` | :arrow_down: |
   | [api/internal/handler/schema/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvc2NoZW1hL3NjaGVtYS5nbw==) | `90.47% <0.00%> (-9.53%)` | :arrow_down: |
   | [api/internal/handler/handler.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvaGFuZGxlci5nbw==) | `68.51% <0.00%> (-9.26%)` | :arrow_down: |
   | [api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=) | `63.55% <0.00%> (-7.48%)` | :arrow_down: |
   | [api/internal/handler/route/route.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvcm91dGUvcm91dGUuZ28=) | `71.42% <0.00%> (-7.35%)` | :arrow_down: |
   | ... and [131 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [a476ad7...83ae2bc](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] liuxiran commented on a change in pull request #1812: fix: can not configure upstream with no nodes

Posted by GitBox <gi...@apache.org>.
liuxiran commented on a change in pull request #1812:
URL: https://github.com/apache/apisix-dashboard/pull/1812#discussion_r619734507



##########
File path: api/internal/core/entity/format_test.go
##########
@@ -101,3 +101,53 @@ func TestNodesFormat_Map(t *testing.T) {
 	assert.Contains(t, jsonStr, `"port":8080`)
 	assert.Contains(t, jsonStr, `"host":"127.0.0.1"`)
 }
+
+func TestNodesFormat_empty_struct(t *testing.T) {
+	// route data saved in ETCD
+	routeStr := `{
+		"uris": ["/*"],
+		"upstream": {
+			"type": "roundrobin",
+			"nodes": []
+		}
+	}`
+
+	// bind struct
+	var route Route
+	err := json.Unmarshal([]byte(routeStr), &route)
+	assert.Nil(t, err)
+
+	// nodes format
+	nodes := NodesFormat(route.Upstream.Nodes)
+
+	// json encode for client
+	res, err := json.Marshal(nodes)
+	assert.Nil(t, err)
+	jsonStr := string(res)
+	assert.Contains(t, jsonStr, `[]`)
+}
+
+func TestNodesFormat_empty_map(t *testing.T) {
+	// route data saved in ETCD
+	routeStr := `{
+		"uris": ["/*"],
+		"upstream": {
+			"type": "roundrobin",
+			"nodes": {}
+		}
+	}`
+
+	// bind struct
+	var route Route
+	err := json.Unmarshal([]byte(routeStr), &route)
+	assert.Nil(t, err)
+
+	// nodes format
+	nodes := NodesFormat(route.Upstream.Nodes)
+
+	// json encode for client
+	res, err := json.Marshal(nodes)
+	assert.Nil(t, err)
+	jsonStr := string(res)
+	assert.Contains(t, jsonStr, `[]`)
+}

Review comment:
       done.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] liuxiran commented on pull request #1812: fix: can not configure upstream with no nodes

Posted by GitBox <gi...@apache.org>.
liuxiran commented on pull request #1812:
URL: https://github.com/apache/apisix-dashboard/pull/1812#issuecomment-826270711


   > @liuxiran FE ci failed after this pr got merged. Could you please take a look, please refer to https://github.com/apache/apisix-dashboard/runs/2430236911. Thanks.
   
   got it, I will fix it later, thanks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #1812: fix: can not configure upstream with no nodes

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1812:
URL: https://github.com/apache/apisix-dashboard/pull/1812#issuecomment-825484125


   # [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1812](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (5a40fe0) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/a476ad7f264a1166290fe0bdb397d2d26cfd23c2?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a476ad7) will **decrease** coverage by `0.24%`.
   > The diff coverage is `100.00%`.
   
   > :exclamation: Current head 5a40fe0 differs from pull request most recent head aa4535d. Consider uploading reports for the commit aa4535d to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #1812      +/-   ##
   ==========================================
   - Coverage   71.85%   71.60%   -0.25%     
   ==========================================
     Files         172       47     -125     
     Lines        6100     3152    -2948     
     Branches      713        0     -713     
   ==========================================
   - Hits         4383     2257    -2126     
   + Misses       1474      651     -823     
   - Partials      243      244       +1     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | backend-e2e-test | `46.51% <100.00%> (-0.20%)` | :arrow_down: |
   | backend-e2e-test-ginkgo | `49.17% <100.00%> (ø)` | |
   | backend-unit-test | `52.40% <100.00%> (ø)` | |
   | frontend-e2e-test | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [api/internal/core/entity/format.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2Zvcm1hdC5nbw==) | `62.79% <100.00%> (ø)` | |
   | [api/internal/core/store/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmUuZ28=) | `86.82% <0.00%> (-2.40%)` | :arrow_down: |
   | [...s/Upstream/components/active-check/Concurrency.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1Vwc3RyZWFtL2NvbXBvbmVudHMvYWN0aXZlLWNoZWNrL0NvbmN1cnJlbmN5LnRzeA==) | | |
   | [...eb/src/pages/PluginTemplate/components/Preview.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9wYWdlcy9QbHVnaW5UZW1wbGF0ZS9jb21wb25lbnRzL1ByZXZpZXcudHN4) | | |
   | [web/src/components/Plugin/UI/limit-conn.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1BsdWdpbi9VSS9saW1pdC1jb25uLnRzeA==) | | |
   | [...eb/src/components/Upstream/components/TimeUnit.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1Vwc3RyZWFtL2NvbXBvbmVudHMvVGltZVVuaXQudHN4) | | |
   | [...ponents/Upstream/components/passive-check/Type.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1Vwc3RyZWFtL2NvbXBvbmVudHMvcGFzc2l2ZS1jaGVjay9UeXBlLnRzeA==) | | |
   | [...m/components/active-check/Healthy/HttpStatuses.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1Vwc3RyZWFtL2NvbXBvbmVudHMvYWN0aXZlLWNoZWNrL0hlYWx0aHkvSHR0cFN0YXR1c2VzLnRzeA==) | | |
   | [...nents/Upstream/components/active-check/Timeout.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1Vwc3RyZWFtL2NvbXBvbmVudHMvYWN0aXZlLWNoZWNrL1RpbWVvdXQudHN4) | | |
   | [web/src/pages/Service/List.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9wYWdlcy9TZXJ2aWNlL0xpc3QudHN4) | | |
   | ... and [115 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [a476ad7...aa4535d](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] netlify[bot] edited a comment on pull request #1812: fix: can not configure upstream with no nodes

Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #1812:
URL: https://github.com/apache/apisix-dashboard/pull/1812#issuecomment-823852872






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] netlify[bot] edited a comment on pull request #1812: fix: can not configure upstream with no nodes

Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #1812:
URL: https://github.com/apache/apisix-dashboard/pull/1812#issuecomment-823852872


   Deploy preview for *apisix-dashboard* ready!
   
   Built with commit a65465ef0d903a128e36a0b6943052f5616cb56c
   
   https://deploy-preview-1812--apisix-dashboard.netlify.app


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] imjoey commented on pull request #1812: fix: can not configure upstream with no nodes

Posted by GitBox <gi...@apache.org>.
imjoey commented on pull request #1812:
URL: https://github.com/apache/apisix-dashboard/pull/1812#issuecomment-826267363


   @liuxiran FE ci failed after this pr got merged. Could you please take a look, please refer to https://github.com/apache/apisix-dashboard/runs/2430236911. Thanks.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] imjoey commented on pull request #1812: fix: can not configure upstream with no nodes

Posted by GitBox <gi...@apache.org>.
imjoey commented on pull request #1812:
URL: https://github.com/apache/apisix-dashboard/pull/1812#issuecomment-824729089


   @liuxiran
   
   How about we make it in the backend? Please see https://github.com/apache/apisix-dashboard/blob/master/api/internal/core/entity/format.go#L49, we can initialize the `nodes` as an empty slice instead of a nil one. Just change `var nodes []*Node` to `nodes := make([]*Node, 0)` .
   
   Looking forward to your insights.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] liuxiran commented on pull request #1812: fix: can not configure upstream with no nodes

Posted by GitBox <gi...@apache.org>.
liuxiran commented on pull request #1812:
URL: https://github.com/apache/apisix-dashboard/pull/1812#issuecomment-825440571


   > Hi, @liuxiran
   > In golang, you should distinguish `nil slice` and `empty slice`
   > 
   > ```
   > var x []*entity.Node
   > ```
   > 
   > is a nil slice.
   > 
   > ```
   > y := make([]*entity.Node, 0)
   > ```
   > 
   > is an empty slice. The length and value are 0.
   > If you use printf or println to print them, the result is both "[]".
   > 
   > In this situation, because the upstream.Nodes' type is interface{}.So it's a little more complex.
   > You can use
   > 
   > ```
   > reflect.ValueOf(upstream.Nodes).IsNil()
   > ```
   > 
   > to see the true value.
   
   @starsz Thanks for your detailed explanation, after added `reflect.ValueOf(upstream.Nodes).IsNil()` and debug again, I find out the confusion before:
   debug step:
   1. create an upstream with no nodes
   2. visit uptream page, call `GET /apisix/admin/upstreams`
   3. config the upstream ,call `GET /apisix/admin/upstream/:id`
   
   before the advice change, I got the logs:
   ![2021-04-23 14-32-00屏幕截图](https://user-images.githubusercontent.com/2561857/115829386-853b0800-a441-11eb-8ee3-8703f220bc4e.png)
   
   after the advice change, I got the logs:
   ![2021-04-23 14-39-50屏幕截图](https://user-images.githubusercontent.com/2561857/115829615-c7644980-a441-11eb-88c0-93964e82b626.png)
   
   The conclusion is that: 
   the original `upstream.nodes` type got from etcd is `[]interface{}`, and it is an empty slice, 
   it will be changed to type nodes , `[]*Node`, in FormatNodes `case []interface{}` when I visit upstream page(step2), 
   and  the when I got the upstream info(step3), the data come from catch instead of stroge, that is to say, in this scene, the `upstream.nodes` type is already `[]*Node`.
   
   so the advice will solve the problem. 
   Thanks again for all your help, then I will try to add related test cases
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] starsz commented on a change in pull request #1812: fix: can not configure upstream with no nodes

Posted by GitBox <gi...@apache.org>.
starsz commented on a change in pull request #1812:
URL: https://github.com/apache/apisix-dashboard/pull/1812#discussion_r619600269



##########
File path: api/internal/core/entity/format_test.go
##########
@@ -101,3 +101,53 @@ func TestNodesFormat_Map(t *testing.T) {
 	assert.Contains(t, jsonStr, `"port":8080`)
 	assert.Contains(t, jsonStr, `"host":"127.0.0.1"`)
 }
+
+func TestNodesFormat_empty_struct(t *testing.T) {
+	// route data saved in ETCD
+	routeStr := `{
+		"uris": ["/*"],
+		"upstream": {
+			"type": "roundrobin",
+			"nodes": []
+		}
+	}`
+
+	// bind struct
+	var route Route
+	err := json.Unmarshal([]byte(routeStr), &route)
+	assert.Nil(t, err)
+
+	// nodes format
+	nodes := NodesFormat(route.Upstream.Nodes)
+
+	// json encode for client
+	res, err := json.Marshal(nodes)
+	assert.Nil(t, err)
+	jsonStr := string(res)
+	assert.Contains(t, jsonStr, `[]`)
+}
+
+func TestNodesFormat_empty_map(t *testing.T) {
+	// route data saved in ETCD
+	routeStr := `{
+		"uris": ["/*"],
+		"upstream": {
+			"type": "roundrobin",
+			"nodes": {}
+		}
+	}`
+
+	// bind struct
+	var route Route
+	err := json.Unmarshal([]byte(routeStr), &route)
+	assert.Nil(t, err)
+
+	// nodes format
+	nodes := NodesFormat(route.Upstream.Nodes)
+
+	// json encode for client
+	res, err := json.Marshal(nodes)
+	assert.Nil(t, err)
+	jsonStr := string(res)
+	assert.Contains(t, jsonStr, `[]`)
+}

Review comment:
       Need to test without the "nodes" field.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] starsz commented on pull request #1812: fix: can not configure upstream with no nodes

Posted by GitBox <gi...@apache.org>.
starsz commented on pull request #1812:
URL: https://github.com/apache/apisix-dashboard/pull/1812#issuecomment-825347305


   > > @liuxiran
   > > How about we make it in the backend? Please see https://github.com/apache/apisix-dashboard/blob/master/api/internal/core/entity/format.go#L49, we can initialize the `nodes` as an empty slice instead of a nil one. Just change `var nodes []*Node` to `nodes := make([]*Node, 0)` .
   > > Looking forward to your insights.
   > 
   > @imjoey Thanks for your advice, and it really make sense for me.
   > 
   > before this change, when get info about an upstream with no nodes
   > fe will get
   > <img alt="WechatIMG5" width="834" src="https://user-images.githubusercontent.com/2561857/115748640-ee326980-a3c8-11eb-809a-e09e63cd6955.png">
   > 
   > actually `nodes:null` causes the problem
   > 
   > after this change, fe will get
   > <img alt="WechatIMG4" width="969" src="https://user-images.githubusercontent.com/2561857/115748817-1ae68100-a3c9-11eb-87c6-89c5c9dcd18f.png">
   > 
   > which is matches expectation.
   > 
   > BTW, I have a question in the process of debugging:
   > there are some logs I added to watch the changes of `upstream.Nodes` before the advice
   > <img alt="WechatIMG7" width="740" src="https://user-images.githubusercontent.com/2561857/115749803-11a9e400-a3ca-11eb-96cc-a6621465ab08.png">
   > I found even if I did not do this change, the `upstram.Nodes` will always be `[]`, but what Fe got is different, I haven't thought about it for a long time.
   > 
   > Also @nic-chen @Jaycean @starsz to take a look, thanks a lot
   
   Hi, @liuxiran 
   In golang, you should distinguish `nil slice` and `empty slice`
   
   ```
   var x []*entity.Node
   ```
   is a nil slice.
   
   ```
   y := make([]*entity.Node, 0)
   ```
   is an empty slice. The length and value are 0.
   If you use printf or println to print them, the result is both "[]".
   
   In this situation, because the upstream.Nodes' type is interface{}.So it's a little more complex.
   You can use 
   ```
   reflect.ValueOf(upstream.Nodes).IsNil()
   ```
   to see the true value.
   
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] liuxiran commented on pull request #1812: fix: can not configure upstream with no nodes

Posted by GitBox <gi...@apache.org>.
liuxiran commented on pull request #1812:
URL: https://github.com/apache/apisix-dashboard/pull/1812#issuecomment-826270711


   > @liuxiran FE ci failed after this pr got merged. Could you please take a look, please refer to https://github.com/apache/apisix-dashboard/runs/2430236911. Thanks.
   
   got it, I will fix it later, thanks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] imjoey commented on pull request #1812: fix: can not configure upstream with no nodes

Posted by GitBox <gi...@apache.org>.
imjoey commented on pull request #1812:
URL: https://github.com/apache/apisix-dashboard/pull/1812#issuecomment-826267363


   @liuxiran FE ci failed after this pr got merged. Could you please take a look, please refer to https://github.com/apache/apisix-dashboard/runs/2430236911. Thanks.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] juzhiyuan commented on a change in pull request #1812: fix: can not configure upstream with no nodes

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on a change in pull request #1812:
URL: https://github.com/apache/apisix-dashboard/pull/1812#discussion_r617582530



##########
File path: web/src/components/Upstream/service.ts
##########
@@ -68,7 +68,6 @@ export const convertToRequestData = (
     type,
     hash_on,
     key,
-    k8s_deployment_info,

Review comment:
       yes, we don't support k8s_deployemnt_info here




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] netlify[bot] edited a comment on pull request #1812: fix: can not configure upstream with no nodes

Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #1812:
URL: https://github.com/apache/apisix-dashboard/pull/1812#issuecomment-823852872


   Deploy preview for *apisix-dashboard* ready!
   
   Built with commit 83ae2bcb3ea1c6f22427908815fb80dd974a0e8c
   
   https://deploy-preview-1812--apisix-dashboard.netlify.app


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #1812: fix: can not configure upstream with no nodes

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1812:
URL: https://github.com/apache/apisix-dashboard/pull/1812#issuecomment-825484125


   # [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1812](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (83ae2bc) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/a476ad7f264a1166290fe0bdb397d2d26cfd23c2?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a476ad7) will **decrease** coverage by `0.03%`.
   > The diff coverage is `100.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #1812      +/-   ##
   ==========================================
   - Coverage   71.85%   71.81%   -0.04%     
   ==========================================
     Files         172      172              
     Lines        6100     6096       -4     
     Branches      713      711       -2     
   ==========================================
   - Hits         4383     4378       -5     
     Misses       1474     1474              
   - Partials      243      244       +1     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | backend-e2e-test | `46.31% <100.00%> (-0.39%)` | :arrow_down: |
   | backend-e2e-test-ginkgo | `49.17% <100.00%> (ø)` | |
   | backend-unit-test | `52.44% <100.00%> (+0.03%)` | :arrow_up: |
   | frontend-e2e-test | `72.11% <100.00%> (+0.13%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [api/internal/core/entity/format.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2Zvcm1hdC5nbw==) | `62.79% <100.00%> (ø)` | |
   | [web/src/components/Upstream/components/Nodes.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1Vwc3RyZWFtL2NvbXBvbmVudHMvTm9kZXMudHN4) | `100.00% <100.00%> (ø)` | |
   | [web/src/components/Upstream/service.ts](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1Vwc3RyZWFtL3NlcnZpY2UudHM=) | `75.00% <100.00%> (+2.08%)` | :arrow_up: |
   | [web/src/helpers.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9oZWxwZXJzLnRzeA==) | `68.85% <0.00%> (-3.28%)` | :arrow_down: |
   | [api/internal/core/store/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmUuZ28=) | `86.82% <0.00%> (-2.40%)` | :arrow_down: |
   | [api/internal/core/storage/etcd.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmFnZS9ldGNkLmdv) | `45.45% <0.00%> (-1.82%)` | :arrow_down: |
   | [web/src/pages/Upstream/List.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9wYWdlcy9VcHN0cmVhbS9MaXN0LnRzeA==) | `92.50% <0.00%> (+2.50%)` | :arrow_up: |
   | [web/src/pages/Upstream/Create.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9wYWdlcy9VcHN0cmVhbS9DcmVhdGUudHN4) | `91.17% <0.00%> (+11.76%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [a476ad7...83ae2bc](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #1812: fix: can not configure upstream with no nodes

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1812:
URL: https://github.com/apache/apisix-dashboard/pull/1812#issuecomment-825484125


   # [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1812](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (83ae2bc) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/a476ad7f264a1166290fe0bdb397d2d26cfd23c2?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a476ad7) will **decrease** coverage by `19.40%`.
   > The diff coverage is `100.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff             @@
   ##           master    #1812       +/-   ##
   ===========================================
   - Coverage   71.85%   52.44%   -19.41%     
   ===========================================
     Files         172       39      -133     
     Lines        6100     2740     -3360     
     Branches      713        0      -713     
   ===========================================
   - Hits         4383     1437     -2946     
   + Misses       1474     1109      -365     
   + Partials      243      194       -49     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | backend-e2e-test | `?` | |
   | backend-e2e-test-ginkgo | `?` | |
   | backend-unit-test | `52.44% <100.00%> (+0.03%)` | :arrow_up: |
   | frontend-e2e-test | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [api/internal/core/entity/format.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2Zvcm1hdC5nbw==) | `62.79% <100.00%> (ø)` | |
   | [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [api/internal/filter/request\_id.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9yZXF1ZXN0X2lkLmdv) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=) | `0.00% <0.00%> (-71.03%)` | :arrow_down: |
   | [api/internal/filter/cors.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9jb3JzLmdv) | `0.00% <0.00%> (-66.67%)` | :arrow_down: |
   | [api/internal/filter/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9zY2hlbWEuZ28=) | `0.00% <0.00%> (-55.47%)` | :arrow_down: |
   | [api/internal/utils/consts/api\_error.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL2NvbnN0cy9hcGlfZXJyb3IuZ28=) | `0.00% <0.00%> (-50.00%)` | :arrow_down: |
   | [api/internal/handler/data\_loader/route\_import.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZGF0YV9sb2FkZXIvcm91dGVfaW1wb3J0Lmdv) | `27.41% <0.00%> (-37.50%)` | :arrow_down: |
   | [api/internal/handler/handler.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvaGFuZGxlci5nbw==) | `42.59% <0.00%> (-35.19%)` | :arrow_down: |
   | ... and [156 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [a476ad7...83ae2bc](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #1812: fix: can not configure upstream with no nodes

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1812:
URL: https://github.com/apache/apisix-dashboard/pull/1812#issuecomment-825484125


   # [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1812](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (10db8d7) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/a476ad7f264a1166290fe0bdb397d2d26cfd23c2?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a476ad7) will **decrease** coverage by `0.21%`.
   > The diff coverage is `100.00%`.
   
   > :exclamation: Current head 10db8d7 differs from pull request most recent head aa4535d. Consider uploading reports for the commit aa4535d to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #1812      +/-   ##
   ==========================================
   - Coverage   71.85%   71.63%   -0.22%     
   ==========================================
     Files         172       47     -125     
     Lines        6100     3152    -2948     
     Branches      713        0     -713     
   ==========================================
   - Hits         4383     2258    -2125     
   + Misses       1474      650     -824     
   - Partials      243      244       +1     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | backend-e2e-test | `46.57% <100.00%> (-0.13%)` | :arrow_down: |
   | backend-e2e-test-ginkgo | `49.17% <100.00%> (ø)` | |
   | backend-unit-test | `52.37% <100.00%> (-0.04%)` | :arrow_down: |
   | frontend-e2e-test | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [api/internal/core/entity/format.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2Zvcm1hdC5nbw==) | `62.79% <100.00%> (ø)` | |
   | [api/internal/core/store/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmUuZ28=) | `87.42% <0.00%> (-1.80%)` | :arrow_down: |
   | [...omponents/passive-check/Unhealthy/HttpFailures.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1Vwc3RyZWFtL2NvbXBvbmVudHMvcGFzc2l2ZS1jaGVjay9VbmhlYWx0aHkvSHR0cEZhaWx1cmVzLnRzeA==) | | |
   | [...eb/src/components/PluginOrchestration/transform.ts](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1BsdWdpbk9yY2hlc3RyYXRpb24vdHJhbnNmb3JtLnRz) | | |
   | [web/src/pages/Route/Create.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9wYWdlcy9Sb3V0ZS9DcmVhdGUudHN4) | | |
   | [web/src/components/Upstream/components/Timeout.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1Vwc3RyZWFtL2NvbXBvbmVudHMvVGltZW91dC50c3g=) | | |
   | [...omponents/Upstream/components/UpstreamSelector.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1Vwc3RyZWFtL2NvbXBvbmVudHMvVXBzdHJlYW1TZWxlY3Rvci50c3g=) | | |
   | [web/src/components/Plugin/UI/limit-count.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1BsdWdpbi9VSS9saW1pdC1jb3VudC50c3g=) | | |
   | [...eam/components/active-check/Unhealthy/Timeouts.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1Vwc3RyZWFtL2NvbXBvbmVudHMvYWN0aXZlLWNoZWNrL1VuaGVhbHRoeS9UaW1lb3V0cy50c3g=) | | |
   | [web/src/pages/Route/components/Step1/MetaView.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9wYWdlcy9Sb3V0ZS9jb21wb25lbnRzL1N0ZXAxL01ldGFWaWV3LnRzeA==) | | |
   | ... and [115 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [a476ad7...aa4535d](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #1812: fix: can not configure upstream with no nodes

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1812:
URL: https://github.com/apache/apisix-dashboard/pull/1812#issuecomment-825484125


   # [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1812](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (5a40fe0) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/a476ad7f264a1166290fe0bdb397d2d26cfd23c2?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a476ad7) will **decrease** coverage by `19.44%`.
   > The diff coverage is `100.00%`.
   
   > :exclamation: Current head 5a40fe0 differs from pull request most recent head aa4535d. Consider uploading reports for the commit aa4535d to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff             @@
   ##           master    #1812       +/-   ##
   ===========================================
   - Coverage   71.85%   52.40%   -19.45%     
   ===========================================
     Files         172       39      -133     
     Lines        6100     2740     -3360     
     Branches      713        0      -713     
   ===========================================
   - Hits         4383     1436     -2947     
   + Misses       1474     1110      -364     
   + Partials      243      194       -49     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | backend-e2e-test | `?` | |
   | backend-e2e-test-ginkgo | `?` | |
   | backend-unit-test | `52.40% <100.00%> (ø)` | |
   | frontend-e2e-test | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [api/internal/core/entity/format.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2Zvcm1hdC5nbw==) | `60.46% <100.00%> (-2.33%)` | :arrow_down: |
   | [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [api/internal/filter/request\_id.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9yZXF1ZXN0X2lkLmdv) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=) | `0.00% <0.00%> (-71.03%)` | :arrow_down: |
   | [api/internal/filter/cors.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9jb3JzLmdv) | `0.00% <0.00%> (-66.67%)` | :arrow_down: |
   | [api/internal/filter/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9zY2hlbWEuZ28=) | `0.00% <0.00%> (-55.47%)` | :arrow_down: |
   | [api/internal/utils/consts/api\_error.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL2NvbnN0cy9hcGlfZXJyb3IuZ28=) | `0.00% <0.00%> (-50.00%)` | :arrow_down: |
   | [api/internal/handler/data\_loader/route\_import.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZGF0YV9sb2FkZXIvcm91dGVfaW1wb3J0Lmdv) | `27.41% <0.00%> (-37.50%)` | :arrow_down: |
   | [api/internal/handler/handler.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvaGFuZGxlci5nbw==) | `42.59% <0.00%> (-35.19%)` | :arrow_down: |
   | ... and [157 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1812/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [a476ad7...aa4535d](https://codecov.io/gh/apache/apisix-dashboard/pull/1812?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #1812: fix: can not configure upstream with no nodes

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1812:
URL: https://github.com/apache/apisix-dashboard/pull/1812#issuecomment-825484125






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] imjoey merged pull request #1812: fix: can not configure upstream with no nodes

Posted by GitBox <gi...@apache.org>.
imjoey merged pull request #1812:
URL: https://github.com/apache/apisix-dashboard/pull/1812


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] netlify[bot] edited a comment on pull request #1812: fix: can not configure upstream with no nodes

Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #1812:
URL: https://github.com/apache/apisix-dashboard/pull/1812#issuecomment-823852872


   Deploy preview for *apisix-dashboard* processing.
   
   Building with commit 79f014e2c3e3077f1aa7c8e535b36f8b46a9c6a8
   
   https://app.netlify.com/sites/apisix-dashboard/deploys/6080f53255f7330008ca7e6c


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] netlify[bot] edited a comment on pull request #1812: fix: can not configure upstream with no nodes

Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #1812:
URL: https://github.com/apache/apisix-dashboard/pull/1812#issuecomment-823852872


   Deploy preview for *apisix-dashboard* ready!
   
   Built with commit aa4535dcdb9f5fe4568bd600e9614cc3d146cdef
   
   https://deploy-preview-1812--apisix-dashboard.netlify.app


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] liuxiran commented on pull request #1812: fix: can not configure upstream with no nodes

Posted by GitBox <gi...@apache.org>.
liuxiran commented on pull request #1812:
URL: https://github.com/apache/apisix-dashboard/pull/1812#issuecomment-824998296


   > @liuxiran
   > 
   > How about we make it in the backend? Please see https://github.com/apache/apisix-dashboard/blob/master/api/internal/core/entity/format.go#L49, we can initialize the `nodes` as an empty slice instead of a nil one. Just change `var nodes []*Node` to `nodes := make([]*Node, 0)` .
   > 
   > Looking forward to your insights.
   
   @imjoey Thanks for your advice, and it really make sense for me.
   
   before this change, when get info about an upstream with no nodes
   fe will get
   <img width="834" alt="WechatIMG5" src="https://user-images.githubusercontent.com/2561857/115748640-ee326980-a3c8-11eb-809a-e09e63cd6955.png">
   
   
   actually `nodes:null` causes the problem
   
   after this change, fe will get
   <img width="969" alt="WechatIMG4" src="https://user-images.githubusercontent.com/2561857/115748817-1ae68100-a3c9-11eb-87c6-89c5c9dcd18f.png">
   
   which is matches expectation.
   
   BTW, I have a question in the process of debugging:
   there are some logs I added to watch the changes of `upstream.Nodes` before the advice
   <img width="740" alt="WechatIMG7" src="https://user-images.githubusercontent.com/2561857/115749803-11a9e400-a3ca-11eb-96cc-a6621465ab08.png">
   I found even if I did not do this change, the `upstram.Nodes` will always be `[]`, but what Fe got is different, I haven't thought about it for a long time. 
   
   Also @nic-chen @Jaycean @starsz to take a look, thanks a lot


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] starsz commented on a change in pull request #1812: fix: can not configure upstream with no nodes

Posted by GitBox <gi...@apache.org>.
starsz commented on a change in pull request #1812:
URL: https://github.com/apache/apisix-dashboard/pull/1812#discussion_r619600269



##########
File path: api/internal/core/entity/format_test.go
##########
@@ -101,3 +101,53 @@ func TestNodesFormat_Map(t *testing.T) {
 	assert.Contains(t, jsonStr, `"port":8080`)
 	assert.Contains(t, jsonStr, `"host":"127.0.0.1"`)
 }
+
+func TestNodesFormat_empty_struct(t *testing.T) {
+	// route data saved in ETCD
+	routeStr := `{
+		"uris": ["/*"],
+		"upstream": {
+			"type": "roundrobin",
+			"nodes": []
+		}
+	}`
+
+	// bind struct
+	var route Route
+	err := json.Unmarshal([]byte(routeStr), &route)
+	assert.Nil(t, err)
+
+	// nodes format
+	nodes := NodesFormat(route.Upstream.Nodes)
+
+	// json encode for client
+	res, err := json.Marshal(nodes)
+	assert.Nil(t, err)
+	jsonStr := string(res)
+	assert.Contains(t, jsonStr, `[]`)
+}
+
+func TestNodesFormat_empty_map(t *testing.T) {
+	// route data saved in ETCD
+	routeStr := `{
+		"uris": ["/*"],
+		"upstream": {
+			"type": "roundrobin",
+			"nodes": {}
+		}
+	}`
+
+	// bind struct
+	var route Route
+	err := json.Unmarshal([]byte(routeStr), &route)
+	assert.Nil(t, err)
+
+	// nodes format
+	nodes := NodesFormat(route.Upstream.Nodes)
+
+	// json encode for client
+	res, err := json.Marshal(nodes)
+	assert.Nil(t, err)
+	jsonStr := string(res)
+	assert.Contains(t, jsonStr, `[]`)
+}

Review comment:
       Need to test without the "nodes" field.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] netlify[bot] edited a comment on pull request #1812: fix: can not configure upstream with no nodes

Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #1812:
URL: https://github.com/apache/apisix-dashboard/pull/1812#issuecomment-823852872


   Deploy preview for *apisix-dashboard* processing.
   
   Building with commit 569b91eaaaa8c4641c3cbd681eeb7e8c9f35a757
   
   https://app.netlify.com/sites/apisix-dashboard/deploys/608198c6a1aabb0008131bc6


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] netlify[bot] commented on pull request #1812: fix: can not configure upstream with no nodes

Posted by GitBox <gi...@apache.org>.
netlify[bot] commented on pull request #1812:
URL: https://github.com/apache/apisix-dashboard/pull/1812#issuecomment-823852872


   Deploy preview for *apisix-dashboard* processing.
   
   Building with commit a65465ef0d903a128e36a0b6943052f5616cb56c
   
   https://app.netlify.com/sites/apisix-dashboard/deploys/607fd808c748f6000736891c


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] netlify[bot] edited a comment on pull request #1812: fix: can not configure upstream with no nodes

Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #1812:
URL: https://github.com/apache/apisix-dashboard/pull/1812#issuecomment-823852872


   Deploy preview for *apisix-dashboard* processing.
   
   Building with commit 83ae2bcb3ea1c6f22427908815fb80dd974a0e8c
   
   https://app.netlify.com/sites/apisix-dashboard/deploys/6084cba9cd0005000791567a


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org