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 2022/05/16 11:08:19 UTC

[GitHub] [apisix-dashboard] jwrookie opened a new pull request, #2454: Feat/use customize route prefix

jwrookie opened a new pull request, #2454:
URL: https://github.com/apache/apisix-dashboard/pull/2454

   Please answer these questions before submitting a pull request, **or your PR will get closed**.
   
   **Why submit this pull request?**
   
   - [ ] Bugfix
   - [x] New feature provided
   - [ ] Improve performance
   - [ ] Backport patches
   
   **What changes will this PR take into?**
   Support customize route prefix
   
   **Related issues**
   
   fix/resolve #1713
   
   **Checklist:**
   
   - [x] Did you explain what problem does this PR solve? Or what new features have been added?
   - [x] Have you added corresponding test cases?
   - [ ] Have you modified the corresponding document?
   - [x] 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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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


[GitHub] [apisix-dashboard] bzp2010 commented on pull request #2454: feat: support customize route prefix

Posted by GitBox <gi...@apache.org>.
bzp2010 commented on PR #2454:
URL: https://github.com/apache/apisix-dashboard/pull/2454#issuecomment-1168172380

   Hi, @jwrookie.
   
   I noticed that this PR does not include front-end related changes, so I don't think configuring it will work. 
   
   The current front-end code cannot dynamically adapt to changes in the root directory (baseURL), it can only be changed at the compiler, so I don't think it will work properly just by changing it.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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


[GitHub] [apisix-dashboard] jwrookie closed pull request #2454: feat: support customize route prefix

Posted by "jwrookie (via GitHub)" <gi...@apache.org>.
jwrookie closed pull request #2454: feat: support customize route prefix
URL: https://github.com/apache/apisix-dashboard/pull/2454


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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


[GitHub] [apisix-dashboard] starsz commented on a diff in pull request #2454: feat: support customize route prefix

Posted by GitBox <gi...@apache.org>.
starsz commented on code in PR #2454:
URL: https://github.com/apache/apisix-dashboard/pull/2454#discussion_r894266311


##########
api/test/shell/cli_test.sh:
##########
@@ -483,6 +483,39 @@ stop_dashboard() {
   stop_dashboard 6
 }
 
+#16
+@test "Check route prefix" {
+  recover_conf
+
+  # modify route prefix config to /test
+  if [[ $KERNEL = "Darwin" ]]; then
+      sed -i "" 's/route_prefix: \//route_prefix: \/test/g' ${CONF_FILE}
+    else
+      sed -i 's/route_prefix: \//route_prefix: \/test/g' ${CONF_FILE}
+  fi
+
+  mkdir -p /usr/local/apisix-dashboard/html
+  echo "hi~" > /usr/local/apisix-dashboard/html/index.html
+
+  start_dashboard 3
+
+  # check api
+  run curl http://127.0.0.1:9000/test/apisix/admin/user/login -H "Content-Type: application/json" -d '{"username":"admin", "password": "admin"}'
+  respCode=$(echo "$output" | sed 's/{/\n/g'| sed 's/,/\n/g' | grep "code" | sed 's/:/\n/g' | sed '1d')
+  echo $respCode
+  [ "$respCode" = "0" ]
+
+  # 404
+  result=$(curl "http://127.0.0.1:9000/apisix/admin/user/login")
+  [ "$result" = "hi~" ]

Review Comment:
   Can this pass?



##########
api/test/shell/cli_test.sh:
##########
@@ -483,6 +483,39 @@ stop_dashboard() {
   stop_dashboard 6
 }
 
+#16
+@test "Check route prefix" {
+  recover_conf
+
+  # modify route prefix config to /test
+  if [[ $KERNEL = "Darwin" ]]; then
+      sed -i "" 's/route_prefix: \//route_prefix: \/test/g' ${CONF_FILE}
+    else
+      sed -i 's/route_prefix: \//route_prefix: \/test/g' ${CONF_FILE}
+  fi
+
+  mkdir -p /usr/local/apisix-dashboard/html
+  echo "hi~" > /usr/local/apisix-dashboard/html/index.html
+
+  start_dashboard 3
+
+  # check api
+  run curl http://127.0.0.1:9000/test/apisix/admin/user/login -H "Content-Type: application/json" -d '{"username":"admin", "password": "admin"}'
+  respCode=$(echo "$output" | sed 's/{/\n/g'| sed 's/,/\n/g' | grep "code" | sed 's/:/\n/g' | sed '1d')
+  echo $respCode
+  [ "$respCode" = "0" ]
+
+  # 404
+  result=$(curl "http://127.0.0.1:9000/apisix/admin/user/login")
+  [ "$result" = "hi~" ]

Review Comment:
   Missing check of 404.



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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


[GitHub] [apisix-dashboard] jwrookie commented on a diff in pull request #2454: feat: support customize route prefix

Posted by GitBox <gi...@apache.org>.
jwrookie commented on code in PR #2454:
URL: https://github.com/apache/apisix-dashboard/pull/2454#discussion_r894272877


##########
api/test/shell/cli_test.sh:
##########
@@ -483,6 +483,39 @@ stop_dashboard() {
   stop_dashboard 6
 }
 
+#16
+@test "Check route prefix" {
+  recover_conf
+
+  # modify route prefix config to /test
+  if [[ $KERNEL = "Darwin" ]]; then
+      sed -i "" 's/route_prefix: \//route_prefix: \/test/g' ${CONF_FILE}
+    else
+      sed -i 's/route_prefix: \//route_prefix: \/test/g' ${CONF_FILE}
+  fi
+
+  mkdir -p /usr/local/apisix-dashboard/html
+  echo "hi~" > /usr/local/apisix-dashboard/html/index.html
+
+  start_dashboard 3
+
+  # check api
+  run curl http://127.0.0.1:9000/test/apisix/admin/user/login -H "Content-Type: application/json" -d '{"username":"admin", "password": "admin"}'
+  respCode=$(echo "$output" | sed 's/{/\n/g'| sed 's/,/\n/g' | grep "code" | sed 's/:/\n/g' | sed '1d')
+  echo $respCode
+  [ "$respCode" = "0" ]
+
+  # 404
+  result=$(curl "http://127.0.0.1:9000/apisix/admin/user/login")
+  [ "$result" = "hi~" ]

Review Comment:
   404 was handled
   
   https://github.com/apache/apisix-dashboard/blob/a2fe71d0644927eb71ef3dd06b902ea9f4ce81f6/api/internal/route.go#L52-L65



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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


[GitHub] [apisix-dashboard] codecov-commenter commented on pull request #2454: feat: support customize route prefix

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

   # [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2454?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 [#2454](https://codecov.io/gh/apache/apisix-dashboard/pull/2454?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (0ea8ac6) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/92f46d9d2fa8438659131eedecf9cab4c87b0f9d?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (92f46d9) will **decrease** coverage by `20.31%`.
   > The diff coverage is `85.71%`.
   
   ```diff
   @@             Coverage Diff             @@
   ##           master    #2454       +/-   ##
   ===========================================
   - Coverage   70.27%   49.95%   -20.32%     
   ===========================================
     Files         189       43      -146     
     Lines        7492     3411     -4081     
     Branches      845        0      -845     
   ===========================================
   - Hits         5265     1704     -3561     
   + Misses       1922     1489      -433     
   + Partials      305      218       -87     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | backend-e2e-test | `?` | |
   | backend-e2e-test-ginkgo | `?` | |
   | backend-unit-test | `49.95% <85.71%> (+0.33%)` | :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/2454?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/filter/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2454/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%> (-56.00%)` | :arrow_down: |
   | [api/internal/conf/conf.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2454/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-YXBpL2ludGVybmFsL2NvbmYvY29uZi5nbw==) | `64.08% <100.00%> (+0.25%)` | :arrow_up: |
   | [api/internal/filter/authentication.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2454/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-YXBpL2ludGVybmFsL2ZpbHRlci9hdXRoZW50aWNhdGlvbi5nbw==) | `78.94% <100.00%> (+1.16%)` | :arrow_up: |
   | [api/main.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2454/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-YXBpL21haW4uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2454/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/2454/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/2454/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%> (-90.91%)` | :arrow_down: |
   | [api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2454/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%> (-73.11%)` | :arrow_down: |
   | [api/internal/handler/proto/proto.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2454/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-YXBpL2ludGVybmFsL2hhbmRsZXIvcHJvdG8vcHJvdG8uZ28=) | `0.00% <0.00%> (-67.26%)` | :arrow_down: |
   | [api/internal/utils/closer.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2454/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-YXBpL2ludGVybmFsL3V0aWxzL2Nsb3Nlci5nbw==) | `0.00% <0.00%> (-66.67%)` | :arrow_down: |
   | ... and [175 more](https://codecov.io/gh/apache/apisix-dashboard/pull/2454/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/2454?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/2454?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 [92f46d9...0ea8ac6](https://codecov.io/gh/apache/apisix-dashboard/pull/2454?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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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


[GitHub] [apisix-dashboard] jwrookie commented on pull request #2454: feat: support customize route prefix

Posted by GitBox <gi...@apache.org>.
jwrookie commented on PR #2454:
URL: https://github.com/apache/apisix-dashboard/pull/2454#issuecomment-1162528725

   @bzp2010 @nic-chen  have a check , 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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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


[GitHub] [apisix-dashboard] jwrookie commented on pull request #2454: feat: support customize route prefix

Posted by GitBox <gi...@apache.org>.
jwrookie commented on PR #2454:
URL: https://github.com/apache/apisix-dashboard/pull/2454#issuecomment-1168174951

   > Hi, @jwrookie.
   > 
   > I noticed that this PR does not include front-end related changes, so I don't think configuring it will work.
   > 
   > The current front-end code cannot dynamically adapt to changes in the root directory (baseURL), it can only be changed at the compiler, so I don't think it will work properly just by changing it.
   
   ok, let me check


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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


[GitHub] [apisix-dashboard] macdoor commented on pull request #2454: feat: support customize route prefix

Posted by "macdoor (via GitHub)" <gi...@apache.org>.
macdoor commented on PR #2454:
URL: https://github.com/apache/apisix-dashboard/pull/2454#issuecomment-1424988014

   This feature is very useful. Please keep moving forward 


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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