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/09 04:44:28 UTC
[GitHub] [apisix-dashboard] LiteSun opened a new pull request #1725: feat: add proxy-mirror plugin form
LiteSun opened a new pull request #1725:
URL: https://github.com/apache/apisix-dashboard/pull/1725
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?**
Add proxy-mirror plugin form
**Related issues**
fix/resolve #0001
**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] LiteSun commented on a change in pull request #1725: feat: add proxy-mirror plugin form
Posted by GitBox <gi...@apache.org>.
LiteSun commented on a change in pull request #1725:
URL: https://github.com/apache/apisix-dashboard/pull/1725#discussion_r611636913
##########
File path: web/cypress/integration/consumer/create-consumer-with-proxy-mirror-form.spec.js
##########
@@ -0,0 +1,103 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/* eslint-disable no-undef */
+
+context('Create and Delete Consumer', () => {
Review comment:
Got 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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] LiteSun commented on pull request #1725: feat: add proxy-mirror plugin form
Posted by GitBox <gi...@apache.org>.
LiteSun commented on pull request #1725:
URL: https://github.com/apache/apisix-dashboard/pull/1725#issuecomment-817241649
> Please file a new PR to update the `Drawer`:
>
> * [ ] i18n
> * [ ] Form Style
updated.
--
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 #1725: feat: add proxy-mirror plugin form
Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #1725:
URL: https://github.com/apache/apisix-dashboard/pull/1725#issuecomment-817850088
Deploy preview for *apisix-dashboard* ready!
Built with commit 2b13d81bb7c846835fefb0dcacf7f44ebcf8435d
https://deploy-preview-1725--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] juzhiyuan commented on a change in pull request #1725: feat: add proxy-mirror plugin form
Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on a change in pull request #1725:
URL: https://github.com/apache/apisix-dashboard/pull/1725#discussion_r613070726
##########
File path: web/src/components/Plugin/UI/proxy-mirror.tsx
##########
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import React from 'react';
+import type { FormInstance } from 'antd/es/form';
+import { Form, Input } from 'antd';
+import { useIntl } from 'umi';
+
+type Props = {
+ form: FormInstance;
+};
+
+const FORM_ITEM_LAYOUT = {
+ labelCol: {
+ span: 4,
+ },
+ wrapperCol: {
+ span: 10
+ },
+};
+
+const ProxyMirror: React.FC<Props> = ({ form }) => {
+ const { formatMessage } = useIntl();
+
+ return (
+ <Form
+ form={form}
+ {...FORM_ITEM_LAYOUT}
+ >
+ <Form.Item
+ label="host"
+ name="host"
+ extra={formatMessage({ id: 'component.pluginForm.proxy-mirror.host.extra' })}
+ tooltip={formatMessage({ id: 'component.pluginForm.proxy-mirror.host.tooltip' })}
+ rules={[
+ {
+ pattern: new RegExp(/^http(s)?:\/\/[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+(:[0-9]{1,5})?$/, 'g'),
+ message: formatMessage({ id: 'component.pluginForm.proxy-mirror.host.ruletip' }),
+ }
+ ]}
+ >
+ <Input />
Review comment:
Does this need `disable` property? When we edit a Route & in the preview page, all properties should be readonly.
##########
File path: web/src/components/Plugin/UI/proxy-mirror.tsx
##########
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import React from 'react';
+import type { FormInstance } from 'antd/es/form';
+import { Form, Input } from 'antd';
+import { useIntl } from 'umi';
+
+type Props = {
+ form: FormInstance;
+};
+
+const FORM_ITEM_LAYOUT = {
+ labelCol: {
+ span: 4,
+ },
+ wrapperCol: {
+ span: 10
+ },
+};
+
+const ProxyMirror: React.FC<Props> = ({ form }) => {
+ const { formatMessage } = useIntl();
+
+ return (
+ <Form
+ form={form}
+ {...FORM_ITEM_LAYOUT}
+ >
+ <Form.Item
+ label="host"
+ name="host"
+ extra={formatMessage({ id: 'component.pluginForm.proxy-mirror.host.extra' })}
Review comment:
Because we have `tooltip`, so we don't need this `extra`.
##########
File path: web/src/components/Plugin/locales/en-US.ts
##########
@@ -22,6 +22,11 @@ export default {
'component.plugin.pluginTemplate.tip1': '1. When a route already have plugins field configured, the plugins in the plugin template will be merged into it.',
'component.plugin.pluginTemplate.tip2': '2. The same plugin in the plugin template will override one in the plugins',
+ // proxy-mirror
+ 'component.pluginForm.proxy-mirror.host.tooltip': 'Specify a mirror service address, e.g. http://127.0.0.1:9797 (address needs to contain schema: http or https, not URI part)',
Review comment:
```suggestion
'component.pluginForm.proxy-mirror.host.tooltip': 'Mirror service address. e.g. http://127.0.0.1:9797 (address needs to start with http or https, no URI part)',
```
##########
File path: web/src/components/Plugin/locales/zh-CN.ts
##########
@@ -22,6 +22,11 @@ export default {
'component.plugin.pluginTemplate.tip1': '1. 若路由已配置插件,则插件模板数据将与已配置的插件数据合并。',
'component.plugin.pluginTemplate.tip2': '2. 插件模板相同的插件会覆盖掉原有的插件。',
+ // proxy-mirror
+ 'component.pluginForm.proxy-mirror.host.tooltip': '指定镜像服务地址,例如:http://127.0.0.1:9797(地址中需要包含 schema :http或https,不能包含 URI 部分)',
Review comment:
When users input an invalid URL, we could popup the error. We don't need this long text actually 😂
--
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 #1725: feat: add proxy-mirror plugin form
Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #1725:
URL: https://github.com/apache/apisix-dashboard/pull/1725#issuecomment-817850088
Deploy preview for *apisix-dashboard* processing.
Building with commit 2b13d81bb7c846835fefb0dcacf7f44ebcf8435d
https://app.netlify.com/sites/apisix-dashboard/deploys/60745d7041093f00089b4c68
--
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] LiteSun commented on pull request #1725: feat: add proxy-mirror plugin form
Posted by GitBox <gi...@apache.org>.
LiteSun commented on pull request #1725:
URL: https://github.com/apache/apisix-dashboard/pull/1725#issuecomment-816617722
> Can you provide a screenshot of the effect?
sure.
--
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-io edited a comment on pull request #1725: feat: add proxy-mirror plugin form
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #1725:
URL: https://github.com/apache/apisix-dashboard/pull/1725#issuecomment-816442886
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=h1) Report
> Merging [#1725](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=desc) (d84d919) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/990662a8b2b16bafb11f4c48d243ae72abead0d1?el=desc) (990662a) will **decrease** coverage by `10.26%`.
> The diff coverage is `n/a`.
> :exclamation: Current head d84d919 differs from pull request most recent head 814892b. Consider uploading reports for the commit 814892b to get more accurate results
[![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #1725 +/- ##
===========================================
- Coverage 62.55% 52.29% -10.27%
===========================================
Files 123 38 -85
Lines 5253 2660 -2593
Branches 649 0 -649
===========================================
- Hits 3286 1391 -1895
+ Misses 1779 1081 -698
Partials 188 188
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-unit-test | `52.29% <ø> (ø)` | |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [web/src/components/ActionBar/ActionBar.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-d2ViL3NyYy9jb21wb25lbnRzL0FjdGlvbkJhci9BY3Rpb25CYXIudHN4) | | |
| [web/src/pages/Consumer/List.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9Db25zdW1lci9MaXN0LnRzeA==) | | |
| [web/src/components/RightContent/index.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-d2ViL3NyYy9jb21wb25lbnRzL1JpZ2h0Q29udGVudC9pbmRleC50c3g=) | | |
| [web/src/pages/Service/components/Preview.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9TZXJ2aWNlL2NvbXBvbmVudHMvUHJldmlldy50c3g=) | | |
| [...Route/components/DebugViews/AuthenticationView.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9Sb3V0ZS9jb21wb25lbnRzL0RlYnVnVmlld3MvQXV0aGVudGljYXRpb25WaWV3LnRzeA==) | | |
| [web/src/components/Upstream/constant.ts](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-d2ViL3NyYy9jb21wb25lbnRzL1Vwc3RyZWFtL2NvbnN0YW50LnRz) | | |
| [...src/pages/SSL/components/CertificateForm/index.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9TU0wvY29tcG9uZW50cy9DZXJ0aWZpY2F0ZUZvcm0vaW5kZXgudHN4) | | |
| [...eb/src/components/PluginOrchestration/constants.ts](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-d2ViL3NyYy9jb21wb25lbnRzL1BsdWdpbk9yY2hlc3RyYXRpb24vY29uc3RhbnRzLnRz) | | |
| [web/src/pages/Dashboard/service.ts](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9EYXNoYm9hcmQvc2VydmljZS50cw==) | | |
| [web/src/components/Plugin/data.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-d2ViL3NyYy9jb21wb25lbnRzL1BsdWdpbi9kYXRhLnRzeA==) | | |
| ... and [74 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=footer). Last update [990662a...814892b](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
--
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] LiteSun commented on a change in pull request #1725: feat: add proxy-mirror plugin form
Posted by GitBox <gi...@apache.org>.
LiteSun commented on a change in pull request #1725:
URL: https://github.com/apache/apisix-dashboard/pull/1725#discussion_r611273131
##########
File path: web/cypress/support/commands.js
##########
@@ -66,6 +66,18 @@ Cypress.Commands.add('configurePlugins', (cases) => {
// NOTE: wait for the Drawer to appear on the DOM
cy.focused(domSelector.drawer).should('exist');
+
+ cy.get(domSelector.codeMirrorMode).invoke('text').then(text => {
+ if (text === 'Form') {
+ // FIXME: https://github.com/cypress-io/cypress/issues/7306
Review comment:
Refer issue: https://github.com/apache/apisix-dashboard/issues/1738
--
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] LiteSun commented on a change in pull request #1725: feat: add proxy-mirror plugin form
Posted by GitBox <gi...@apache.org>.
LiteSun commented on a change in pull request #1725:
URL: https://github.com/apache/apisix-dashboard/pull/1725#discussion_r612067202
##########
File path: web/src/components/Plugin/locales/zh-CN.ts
##########
@@ -21,4 +21,7 @@ export default {
'component.step.select.pluginTemplate.select.option': '手动配置',
'component.plugin.pluginTemplate.tip1': '1. 若路由已配置插件,则插件模板数据将与已配置的插件数据合并。',
'component.plugin.pluginTemplate.tip2': '2. 插件模板相同的插件会覆盖掉原有的插件。',
+
+ // proxxy-mirror
+ 'component.pluginForm.proxy-mirror.host.tooltip': '指定镜像服务地址,例如:http://127.0.0.1:9797(地址中需要包含 schema :http或https,不能包含 URI 部分)',
Review comment:
IMO, we should keep the documentation consistent, otherwise, it can confuse users when explanations are inconsistent. I've this in this issue https://github.com/apache/apisix-dashboard/issues/1724.
--
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-io edited a comment on pull request #1725: feat: add proxy-mirror plugin form
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #1725:
URL: https://github.com/apache/apisix-dashboard/pull/1725#issuecomment-816442886
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=h1) Report
> Merging [#1725](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=desc) (814892b) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/990662a8b2b16bafb11f4c48d243ae72abead0d1?el=desc) (990662a) will **increase** coverage by `0.09%`.
> The diff coverage is `100.00%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #1725 +/- ##
==========================================
+ Coverage 62.55% 62.65% +0.09%
==========================================
Files 123 124 +1
Lines 5253 5259 +6
Branches 649 650 +1
==========================================
+ Hits 3286 3295 +9
+ Misses 1779 1776 -3
Partials 188 188
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-unit-test | `52.29% <ø> (ø)` | |
| frontend-e2e-test | `73.25% <100.00%> (+0.17%)` | :arrow_up: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [web/src/components/Plugin/UI/plugin.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-d2ViL3NyYy9jb21wb25lbnRzL1BsdWdpbi9VSS9wbHVnaW4udHN4) | `63.63% <100.00%> (+19.19%)` | :arrow_up: |
| [web/src/components/Plugin/UI/proxy-mirror.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-d2ViL3NyYy9jb21wb25lbnRzL1BsdWdpbi9VSS9wcm94eS1taXJyb3IudHN4) | `100.00% <100.00%> (ø)` | |
| [web/src/helpers.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-d2ViL3NyYy9oZWxwZXJzLnRzeA==) | `70.49% <0.00%> (-3.28%)` | :arrow_down: |
| [web/src/components/Plugin/PluginDetail.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-d2ViL3NyYy9jb21wb25lbnRzL1BsdWdpbi9QbHVnaW5EZXRhaWwudHN4) | `59.54% <0.00%> (+3.05%)` | :arrow_up: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=footer). Last update [990662a...814892b](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
--
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-io edited a comment on pull request #1725: feat: add proxy-mirror plugin form
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #1725:
URL: https://github.com/apache/apisix-dashboard/pull/1725#issuecomment-816442886
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=h1) Report
> Merging [#1725](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=desc) (814892b) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/990662a8b2b16bafb11f4c48d243ae72abead0d1?el=desc) (990662a) will **decrease** coverage by `10.26%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #1725 +/- ##
===========================================
- Coverage 62.55% 52.29% -10.27%
===========================================
Files 123 38 -85
Lines 5253 2660 -2593
Branches 649 0 -649
===========================================
- Hits 3286 1391 -1895
+ Misses 1779 1081 -698
Partials 188 188
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-unit-test | `52.29% <ø> (ø)` | |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [web/src/components/PluginOrchestration/index.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-d2ViL3NyYy9jb21wb25lbnRzL1BsdWdpbk9yY2hlc3RyYXRpb24vaW5kZXgudHN4) | | |
| [web/src/global.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-d2ViL3NyYy9nbG9iYWwudHN4) | | |
| [web/src/pages/Route/List.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9Sb3V0ZS9MaXN0LnRzeA==) | | |
| [web/src/pages/User/Login.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9Vc2VyL0xvZ2luLnRzeA==) | | |
| [web/src/services/user.ts](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-d2ViL3NyYy9zZXJ2aWNlcy91c2VyLnRz) | | |
| [...Route/components/DebugViews/AuthenticationView.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9Sb3V0ZS9jb21wb25lbnRzL0RlYnVnVmlld3MvQXV0aGVudGljYXRpb25WaWV3LnRzeA==) | | |
| [web/src/pages/Consumer/List.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9Db25zdW1lci9MaXN0LnRzeA==) | | |
| [web/src/components/RightContent/AvatarDropdown.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-d2ViL3NyYy9jb21wb25lbnRzL1JpZ2h0Q29udGVudC9BdmF0YXJEcm9wZG93bi50c3g=) | | |
| [web/src/components/Upstream/UpstreamForm.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-d2ViL3NyYy9jb21wb25lbnRzL1Vwc3RyZWFtL1Vwc3RyZWFtRm9ybS50c3g=) | | |
| [...pages/Route/components/Step1/RequestConfigView.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9Sb3V0ZS9jb21wb25lbnRzL1N0ZXAxL1JlcXVlc3RDb25maWdWaWV3LnRzeA==) | | |
| ... and [74 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=footer). Last update [990662a...814892b](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
--
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 #1725: feat: add proxy-mirror plugin form
Posted by GitBox <gi...@apache.org>.
netlify[bot] commented on pull request #1725:
URL: https://github.com/apache/apisix-dashboard/pull/1725#issuecomment-817850088
Deploy preview for *apisix-dashboard* processing.
Building with commit 53e7ac3c19674025f783dd458c6e09d82b3f9666
https://app.netlify.com/sites/apisix-dashboard/deploys/60745603833c0b00083da7fb
--
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-io edited a comment on pull request #1725: feat: add proxy-mirror plugin form
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #1725:
URL: https://github.com/apache/apisix-dashboard/pull/1725#issuecomment-816442886
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=h1) Report
> Merging [#1725](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=desc) (2b5df55) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/8b6080d2fc87bb5936650a647b67e1480745721a?el=desc) (8b6080d) will **decrease** coverage by `4.02%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #1725 +/- ##
==========================================
- Coverage 71.86% 67.83% -4.03%
==========================================
Files 47 47
Lines 3128 3128
==========================================
- Hits 2248 2122 -126
- Misses 638 761 +123
- Partials 242 245 +3
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `?` | |
| backend-e2e-test-ginkgo | `49.16% <ø> (+0.06%)` | :arrow_up: |
| backend-unit-test | `52.29% <ø> (ø)` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [api/internal/handler/data\_loader/route\_import.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZGF0YV9sb2FkZXIvcm91dGVfaW1wb3J0Lmdv) | `35.08% <0.00%> (-29.84%)` | :arrow_down: |
| [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `75.00% <0.00%> (-25.00%)` | :arrow_down: |
| [api/internal/handler/global\_rule/global\_rule.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZ2xvYmFsX3J1bGUvZ2xvYmFsX3J1bGUuZ28=) | `66.12% <0.00%> (-17.75%)` | :arrow_down: |
| [api/internal/utils/utils.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL3V0aWxzL3V0aWxzLmdv) | `54.11% <0.00%> (-11.77%)` | :arrow_down: |
| [api/internal/route.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL3JvdXRlLmdv) | `76.47% <0.00%> (-8.83%)` | :arrow_down: |
| [api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=) | `67.28% <0.00%> (-7.48%)` | :arrow_down: |
| [api/internal/core/storage/etcd.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmFnZS9ldGNkLmdv) | `43.63% <0.00%> (-7.28%)` | :arrow_down: |
| [api/internal/core/store/validate.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvdmFsaWRhdGUuZ28=) | `67.03% <0.00%> (-2.24%)` | :arrow_down: |
| [api/internal/handler/label/label.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvbGFiZWwvbGFiZWwuZ28=) | `80.18% <0.00%> (-1.89%)` | :arrow_down: |
| [api/internal/core/store/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmUuZ28=) | `87.95% <0.00%> (-1.21%)` | :arrow_down: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=footer). Last update [8b6080d...2b5df55](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
--
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-io edited a comment on pull request #1725: feat: add proxy-mirror plugin form
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #1725:
URL: https://github.com/apache/apisix-dashboard/pull/1725#issuecomment-816442886
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=h1) Report
> Merging [#1725](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=desc) (2b5df55) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/8b6080d2fc87bb5936650a647b67e1480745721a?el=desc) (8b6080d) will **decrease** coverage by `0.31%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #1725 +/- ##
==========================================
- Coverage 71.86% 71.54% -0.32%
==========================================
Files 47 47
Lines 3128 3128
==========================================
- Hits 2248 2238 -10
- Misses 638 646 +8
- Partials 242 244 +2
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `62.30% <ø> (-0.42%)` | :arrow_down: |
| backend-e2e-test-ginkgo | `49.16% <ø> (+0.06%)` | :arrow_up: |
| backend-unit-test | `52.29% <ø> (ø)` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=) | `71.02% <0.00%> (-3.74%)` | :arrow_down: |
| [api/internal/core/storage/etcd.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmFnZS9ldGNkLmdv) | `47.27% <0.00%> (-3.64%)` | :arrow_down: |
| [api/internal/core/store/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmUuZ28=) | `87.95% <0.00%> (-1.21%)` | :arrow_down: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=footer). Last update [8b6080d...2b5df55](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
--
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 #1725: feat: add proxy-mirror plugin form
Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on a change in pull request #1725:
URL: https://github.com/apache/apisix-dashboard/pull/1725#discussion_r611269829
##########
File path: web/src/components/Plugin/UI/plugin.tsx
##########
@@ -38,6 +39,8 @@ export const PluginForm: React.FC<Props> = ({ name, renderForm, form }) => {
switch (name) {
case 'basic-auth':
return <BasicAuth form={form} />
+ case 'proxy-mirror':
+ return <ProxyMirror form={form} />
Review comment:
This Form receives Plug-in Name and returns the target Component, use Switch-Case is ok 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 #1725: feat: add proxy-mirror plugin form
Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #1725:
URL: https://github.com/apache/apisix-dashboard/pull/1725#issuecomment-817850088
Deploy preview for *apisix-dashboard* ready!
Built with commit 53e7ac3c19674025f783dd458c6e09d82b3f9666
https://deploy-preview-1725--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] netlify[bot] edited a comment on pull request #1725: feat: add proxy-mirror plugin form
Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #1725:
URL: https://github.com/apache/apisix-dashboard/pull/1725#issuecomment-817850088
Deploy preview for *apisix-dashboard* processing.
Building with commit 43a6890d5f2e7873c7a5febe5039fdb5dad4e8c2
https://app.netlify.com/sites/apisix-dashboard/deploys/6076b7ae8ad4450008e59a9b
--
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 #1725: feat: add proxy-mirror plugin form
Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #1725:
URL: https://github.com/apache/apisix-dashboard/pull/1725#issuecomment-817850088
Deploy preview for *apisix-dashboard* ready!
Built with commit 4b4ff4208f9b15d9d5abc6a42779f294fedfb9f3
https://deploy-preview-1725--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-io edited a comment on pull request #1725: feat: add proxy-mirror plugin form
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #1725:
URL: https://github.com/apache/apisix-dashboard/pull/1725#issuecomment-816442886
--
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] moonming commented on a change in pull request #1725: feat: add proxy-mirror plugin form
Posted by GitBox <gi...@apache.org>.
moonming commented on a change in pull request #1725:
URL: https://github.com/apache/apisix-dashboard/pull/1725#discussion_r611266776
##########
File path: web/cypress/support/commands.js
##########
@@ -66,6 +66,18 @@ Cypress.Commands.add('configurePlugins', (cases) => {
// NOTE: wait for the Drawer to appear on the DOM
cy.focused(domSelector.drawer).should('exist');
+
+ cy.get(domSelector.codeMirrorMode).invoke('text').then(text => {
+ if (text === 'Form') {
+ // FIXME: https://github.com/cypress-io/cypress/issues/7306
Review comment:
we need an issue instead of a comment.
##########
File path: web/src/components/Plugin/locales/zh-CN.ts
##########
@@ -21,4 +21,7 @@ export default {
'component.step.select.pluginTemplate.select.option': '手动配置',
'component.plugin.pluginTemplate.tip1': '1. 若路由已配置插件,则插件模板数据将与已配置的插件数据合并。',
'component.plugin.pluginTemplate.tip2': '2. 插件模板相同的插件会覆盖掉原有的插件。',
+
+ // proxxy-mirror
+ 'component.pluginForm.proxy-mirror.host.tooltip': '指定镜像服务地址,例如:http://127.0.0.1:9797(地址中需要包含 schema :http或https,不能包含 URI 部分)',
Review comment:
You should add judgment on the front end
##########
File path: web/src/components/Plugin/UI/plugin.tsx
##########
@@ -38,6 +39,8 @@ export const PluginForm: React.FC<Props> = ({ name, renderForm, form }) => {
switch (name) {
case 'basic-auth':
return <BasicAuth form={form} />
+ case 'proxy-mirror':
+ return <ProxyMirror form={form} />
Review comment:
why we need this switch?
--
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] moonming commented on a change in pull request #1725: feat: add proxy-mirror plugin form
Posted by GitBox <gi...@apache.org>.
moonming commented on a change in pull request #1725:
URL: https://github.com/apache/apisix-dashboard/pull/1725#discussion_r611276922
##########
File path: web/cypress/integration/consumer/create-consumer-with-proxy-mirror-form.spec.js
##########
@@ -0,0 +1,103 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/* eslint-disable no-undef */
+
+context('Create and Delete Consumer', () => {
Review comment:
We need to test the setting of plugins in routing, which is the most commonly used
--
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 merged pull request #1725: feat: add proxy-mirror plugin form
Posted by GitBox <gi...@apache.org>.
juzhiyuan merged pull request #1725:
URL: https://github.com/apache/apisix-dashboard/pull/1725
--
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] LiteSun commented on a change in pull request #1725: feat: add proxy-mirror plugin form
Posted by GitBox <gi...@apache.org>.
LiteSun commented on a change in pull request #1725:
URL: https://github.com/apache/apisix-dashboard/pull/1725#discussion_r611365884
##########
File path: web/cypress/integration/consumer/create-consumer-with-proxy-mirror-form.spec.js
##########
@@ -0,0 +1,103 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/* eslint-disable no-undef */
+
+context('Create and Delete Consumer', () => {
+ beforeEach(() => {
+ cy.login();
+
+ cy.fixture('selector.json').as('domSelector');
+ cy.fixture('data.json').as('data');
+ });
+
+ const selector = {
+ host: "#host"
+ }
+
+ const data = {
+ correctHost: 'http://127.0.0.1',
+ wrongHost: '127.0.0.1:1999'
+ }
Review comment:
TBH, I think it's more intuitive to write it this way.
--
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] LiteSun commented on a change in pull request #1725: feat: add proxy-mirror plugin form
Posted by GitBox <gi...@apache.org>.
LiteSun commented on a change in pull request #1725:
URL: https://github.com/apache/apisix-dashboard/pull/1725#discussion_r611637186
##########
File path: web/cypress/support/commands.js
##########
@@ -66,6 +66,18 @@ Cypress.Commands.add('configurePlugins', (cases) => {
// NOTE: wait for the Drawer to appear on the DOM
cy.focused(domSelector.drawer).should('exist');
+
+ cy.get(domSelector.codeMirrorMode).invoke('text').then(text => {
+ if (text === 'Form') {
+ // FIXME: https://github.com/cypress-io/cypress/issues/7306
Review comment:
ok
--
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 #1725: feat: add proxy-mirror plugin form
Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on a change in pull request #1725:
URL: https://github.com/apache/apisix-dashboard/pull/1725#discussion_r611281834
##########
File path: web/src/components/Plugin/locales/zh-CN.ts
##########
@@ -21,4 +21,7 @@ export default {
'component.step.select.pluginTemplate.select.option': '手动配置',
'component.plugin.pluginTemplate.tip1': '1. 若路由已配置插件,则插件模板数据将与已配置的插件数据合并。',
'component.plugin.pluginTemplate.tip2': '2. 插件模板相同的插件会覆盖掉原有的插件。',
+
+ // proxxy-mirror
+ 'component.pluginForm.proxy-mirror.host.tooltip': '指定镜像服务地址,例如:http://127.0.0.1:9797(地址中需要包含 schema :http或https,不能包含 URI 部分)',
Review comment:
After some searches, I noticed there should be `Path` instead of `URI`?
In APISIX, we use `URI` to refer to `HTTP Request Path`, it's not appropriate IMO.
```suggestion
'component.pluginForm.proxy-mirror.host.tooltip': '指定镜像服务地址(如 http://127.0.0.1:9797),地址中需包含协议:http 或 https,不能包含 PATH 部分)',
```
--
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-io commented on pull request #1725: feat: add proxy-mirror plugin form
Posted by GitBox <gi...@apache.org>.
codecov-io commented on pull request #1725:
URL: https://github.com/apache/apisix-dashboard/pull/1725#issuecomment-816442886
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=h1) Report
> Merging [#1725](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=desc) (11bf7f9) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/82ab89e2f208eeca1e6f03d9dae885ee7e4b19d3?el=desc) (82ab89e) will **decrease** coverage by `19.78%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #1725 +/- ##
===========================================
- Coverage 72.04% 52.25% -19.79%
===========================================
Files 132 38 -94
Lines 5687 2660 -3027
Branches 660 0 -660
===========================================
- Hits 4097 1390 -2707
+ Misses 1346 1082 -264
+ Partials 244 188 -56
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `?` | |
| backend-e2e-test-ginkgo | `?` | |
| backend-unit-test | `52.25% <ø> (-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#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/filter/request\_id.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9yZXF1ZXN0X2lkLmdv) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=) | `0.00% <0.00%> (-71.03%)` | :arrow_down: |
| [api/internal/filter/cors.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9jb3JzLmdv) | `0.00% <0.00%> (-66.67%)` | :arrow_down: |
| [api/internal/filter/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#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/1725/diff?src=pr&el=tree#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/1725/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZGF0YV9sb2FkZXIvcm91dGVfaW1wb3J0Lmdv) | `27.41% <0.00%> (-37.50%)` | :arrow_down: |
| [api/internal/handler/handler.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvaGFuZGxlci5nbw==) | `42.59% <0.00%> (-35.19%)` | :arrow_down: |
| [api/internal/handler/schema/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvc2NoZW1hL3NjaGVtYS5nbw==) | `66.66% <0.00%> (-33.34%)` | :arrow_down: |
| ... and [117 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=footer). Last update [82ab89e...11bf7f9](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
--
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] LiteSun commented on a change in pull request #1725: feat: add proxy-mirror plugin form
Posted by GitBox <gi...@apache.org>.
LiteSun commented on a change in pull request #1725:
URL: https://github.com/apache/apisix-dashboard/pull/1725#discussion_r611273896
##########
File path: web/src/components/Plugin/locales/zh-CN.ts
##########
@@ -21,4 +21,7 @@ export default {
'component.step.select.pluginTemplate.select.option': '手动配置',
'component.plugin.pluginTemplate.tip1': '1. 若路由已配置插件,则插件模板数据将与已配置的插件数据合并。',
'component.plugin.pluginTemplate.tip2': '2. 插件模板相同的插件会覆盖掉原有的插件。',
+
+ // proxxy-mirror
+ 'component.pluginForm.proxy-mirror.host.tooltip': '指定镜像服务地址,例如:http://127.0.0.1:9797(地址中需要包含 schema :http或https,不能包含 URI 部分)',
Review comment:
1. Here is tip for user
2. the front-end will do a schema check on the data entered by the user
--
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] moonming commented on a change in pull request #1725: feat: add proxy-mirror plugin form
Posted by GitBox <gi...@apache.org>.
moonming commented on a change in pull request #1725:
URL: https://github.com/apache/apisix-dashboard/pull/1725#discussion_r611266148
##########
File path: web/cypress/integration/consumer/create-consumer-with-proxy-mirror-form.spec.js
##########
@@ -0,0 +1,103 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/* eslint-disable no-undef */
+
+context('Create and Delete Consumer', () => {
Review comment:
What is the relationship between this plugin and consumer?
##########
File path: web/cypress/integration/consumer/create-consumer-with-proxy-mirror-form.spec.js
##########
@@ -0,0 +1,103 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/* eslint-disable no-undef */
+
+context('Create and Delete Consumer', () => {
+ beforeEach(() => {
+ cy.login();
+
+ cy.fixture('selector.json').as('domSelector');
+ cy.fixture('data.json').as('data');
+ });
+
+ const selector = {
+ host: "#host"
+ }
+
+ const data = {
+ correctHost: 'http://127.0.0.1',
+ wrongHost: '127.0.0.1:1999'
+ }
+
+ it('creates consumer with proxy-mirror form', function () {
Review comment:
why we need consumer?
##########
File path: web/cypress/integration/consumer/create-consumer-with-proxy-mirror-form.spec.js
##########
@@ -0,0 +1,103 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/* eslint-disable no-undef */
+
+context('Create and Delete Consumer', () => {
+ beforeEach(() => {
+ cy.login();
+
+ cy.fixture('selector.json').as('domSelector');
+ cy.fixture('data.json').as('data');
+ });
+
+ const selector = {
+ host: "#host"
+ }
+
+ const data = {
+ correctHost: 'http://127.0.0.1',
+ wrongHost: '127.0.0.1:1999'
+ }
Review comment:
Please write directly in the test case, not this layer of data structure
--
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 #1725: feat: add proxy-mirror plugin form
Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #1725:
URL: https://github.com/apache/apisix-dashboard/pull/1725#issuecomment-817850088
Deploy preview for *apisix-dashboard* processing.
Building with commit dd5d8494eca092c302b4c96e7e9e2fd18b427cd9
https://app.netlify.com/sites/apisix-dashboard/deploys/6074e121b2fefe000726af0f
--
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 #1725: feat: add proxy-mirror plugin form
Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #1725:
URL: https://github.com/apache/apisix-dashboard/pull/1725#issuecomment-817850088
--
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 #1725: feat: add proxy-mirror plugin form
Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #1725:
URL: https://github.com/apache/apisix-dashboard/pull/1725#issuecomment-817850088
Deploy preview for *apisix-dashboard* ready!
Built with commit 6191a40cd81cf161754c4a488a55b2e740e63f16
https://deploy-preview-1725--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] membphis commented on pull request #1725: feat: add proxy-mirror plugin form
Posted by GitBox <gi...@apache.org>.
membphis commented on pull request #1725:
URL: https://github.com/apache/apisix-dashboard/pull/1725#issuecomment-816577906
Can you provide a screenshot of the effect?
--
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] moonming commented on a change in pull request #1725: feat: add proxy-mirror plugin form
Posted by GitBox <gi...@apache.org>.
moonming commented on a change in pull request #1725:
URL: https://github.com/apache/apisix-dashboard/pull/1725#discussion_r611267498
##########
File path: web/cypress/integration/consumer/create-consumer-with-proxy-mirror-form.spec.js
##########
@@ -0,0 +1,103 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/* eslint-disable no-undef */
+
+context('Create and Delete Consumer', () => {
+ beforeEach(() => {
+ cy.login();
+
+ cy.fixture('selector.json').as('domSelector');
+ cy.fixture('data.json').as('data');
+ });
+
+ const selector = {
+ host: "#host"
+ }
+
+ const data = {
+ correctHost: 'http://127.0.0.1',
+ wrongHost: '127.0.0.1:1999'
+ }
+
+ it('creates consumer with proxy-mirror form', function () {
+ cy.visit('/');
+ cy.contains('Consumer').click();
+ cy.get(this.domSelector.empty).should('be.visible');
+ cy.contains('Create').click();
+ // basic information
+ cy.get(this.domSelector.username).type(this.data.consumerName);
+ cy.get(this.domSelector.description).type(this.data.description);
+ cy.contains('Next').click();
+
+ // config auth plugin
+ cy.contains(this.domSelector.pluginCard, 'key-auth').within(() => {
+ cy.contains('Enable').click({
+ force: true,
+ });
+ });
+ cy.focused(this.domSelector.drawer).should('exist');
+ cy.get(this.domSelector.disabledSwitcher).click();
+ // edit codemirror
+ cy.get(this.domSelector.codeMirror)
+ .first()
+ .then((editor) => {
+ editor[0].CodeMirror.setValue(
+ JSON.stringify({
+ key: 'test',
+ }),
+ );
+ cy.contains('button', 'Submit').click();
+ });
+
Review comment:
why we need key-auth plugin?
--
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 #1725: feat: add proxy-mirror plugin form
Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on a change in pull request #1725:
URL: https://github.com/apache/apisix-dashboard/pull/1725#discussion_r611271080
##########
File path: web/cypress/integration/consumer/create-consumer-with-proxy-mirror-form.spec.js
##########
@@ -0,0 +1,103 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/* eslint-disable no-undef */
+
+context('Create and Delete Consumer', () => {
Review comment:
1. All Plug-ins in Consumers need to configured, but in other entities like Service/Route, Auth plugins don't need to be configured, only enable or disable.
2. To improve the Test case coverage as full as possible, we choose to test plugins in Consumer, we need to configure at least one Auth plugin and target plugin.
3. Do you mean only need test the target plugin component? It's more like a Single Component test.
--
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-io edited a comment on pull request #1725: feat: add proxy-mirror plugin form
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #1725:
URL: https://github.com/apache/apisix-dashboard/pull/1725#issuecomment-816442886
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?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 [#1725](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (02baecd) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/c68e2d2b3d4cfc2602e6667f91c77aaff69b6038?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (c68e2d2) will **increase** coverage by `0.06%`.
> The diff coverage is `100.00%`.
> :exclamation: Current head 02baecd differs from pull request most recent head 2b13d81. Consider uploading reports for the commit 2b13d81 to get more accurate results
[![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/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/1725?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 #1725 +/- ##
==========================================
+ Coverage 72.01% 72.07% +0.06%
==========================================
Files 160 161 +1
Lines 5820 5826 +6
Branches 651 652 +1
==========================================
+ Hits 4191 4199 +8
+ Misses 1385 1383 -2
Partials 244 244
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `62.30% <ø> (ø)` | |
| backend-e2e-test-ginkgo | `49.29% <ø> (+0.22%)` | :arrow_up: |
| backend-unit-test | `52.29% <ø> (ø)` | |
| frontend-e2e-test | `72.68% <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/1725?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [web/src/components/Plugin/UI/plugin.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/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-d2ViL3NyYy9jb21wb25lbnRzL1BsdWdpbi9VSS9wbHVnaW4udHN4) | `69.23% <100.00%> (+5.59%)` | :arrow_up: |
| [web/src/components/Plugin/UI/proxy-mirror.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/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-d2ViL3NyYy9jb21wb25lbnRzL1BsdWdpbi9VSS9wcm94eS1taXJyb3IudHN4) | `100.00% <100.00%> (ø)` | |
| [web/src/components/Plugin/PluginDetail.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/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-d2ViL3NyYy9jb21wb25lbnRzL1BsdWdpbi9QbHVnaW5EZXRhaWwudHN4) | `59.54% <0.00%> (+1.52%)` | :arrow_up: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?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/1725?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 [c68e2d2...2b13d81](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?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 #1725: feat: add proxy-mirror plugin form
Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #1725:
URL: https://github.com/apache/apisix-dashboard/pull/1725#issuecomment-817850088
Deploy preview for *apisix-dashboard* processing.
Building with commit 4b4ff4208f9b15d9d5abc6a42779f294fedfb9f3
https://app.netlify.com/sites/apisix-dashboard/deploys/6076520729f7b200085db59c
--
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] LiteSun commented on a change in pull request #1725: feat: add proxy-mirror plugin form
Posted by GitBox <gi...@apache.org>.
LiteSun commented on a change in pull request #1725:
URL: https://github.com/apache/apisix-dashboard/pull/1725#discussion_r611366921
##########
File path: web/cypress/integration/consumer/create-consumer-with-proxy-mirror-form.spec.js
##########
@@ -0,0 +1,103 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/* eslint-disable no-undef */
+
+context('Create and Delete Consumer', () => {
+ beforeEach(() => {
+ cy.login();
+
+ cy.fixture('selector.json').as('domSelector');
+ cy.fixture('data.json').as('data');
+ });
+
+ const selector = {
+ host: "#host"
+ }
+
+ const data = {
+ correctHost: 'http://127.0.0.1',
+ wrongHost: '127.0.0.1:1999'
+ }
+
+ it('creates consumer with proxy-mirror form', function () {
+ cy.visit('/');
+ cy.contains('Consumer').click();
+ cy.get(this.domSelector.empty).should('be.visible');
+ cy.contains('Create').click();
+ // basic information
+ cy.get(this.domSelector.username).type(this.data.consumerName);
+ cy.get(this.domSelector.description).type(this.data.description);
+ cy.contains('Next').click();
+
+ // config auth plugin
+ cy.contains(this.domSelector.pluginCard, 'key-auth').within(() => {
+ cy.contains('Enable').click({
+ force: true,
+ });
+ });
+ cy.focused(this.domSelector.drawer).should('exist');
+ cy.get(this.domSelector.disabledSwitcher).click();
+ // edit codemirror
+ cy.get(this.domSelector.codeMirror)
+ .first()
+ .then((editor) => {
+ editor[0].CodeMirror.setValue(
+ JSON.stringify({
+ key: 'test',
+ }),
+ );
+ cy.contains('button', 'Submit').click();
+ });
+
Review comment:
This is because an authentication plugin is required when creating a Consumer.
--
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] moonming commented on a change in pull request #1725: feat: add proxy-mirror plugin form
Posted by GitBox <gi...@apache.org>.
moonming commented on a change in pull request #1725:
URL: https://github.com/apache/apisix-dashboard/pull/1725#discussion_r611276713
##########
File path: web/cypress/support/commands.js
##########
@@ -66,6 +66,18 @@ Cypress.Commands.add('configurePlugins', (cases) => {
// NOTE: wait for the Drawer to appear on the DOM
cy.focused(domSelector.drawer).should('exist');
+
+ cy.get(domSelector.codeMirrorMode).invoke('text').then(text => {
+ if (text === 'Form') {
+ // FIXME: https://github.com/cypress-io/cypress/issues/7306
Review comment:
so please remove this comment
--
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 pull request #1725: feat: add proxy-mirror plugin form
Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on pull request #1725:
URL: https://github.com/apache/apisix-dashboard/pull/1725#issuecomment-817143756
Please file a new PR to update the `Drawer`:
- [ ] i18n
- [ ] Form Style
--
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-io edited a comment on pull request #1725: feat: add proxy-mirror plugin form
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #1725:
URL: https://github.com/apache/apisix-dashboard/pull/1725#issuecomment-816442886
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=h1) Report
> Merging [#1725](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=desc) (2b5df55) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/8b6080d2fc87bb5936650a647b67e1480745721a?el=desc) (8b6080d) will **not change** coverage.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #1725 +/- ##
=======================================
Coverage 52.29% 52.29%
=======================================
Files 38 38
Lines 2660 2660
=======================================
Hits 1391 1391
Misses 1081 1081
Partials 188 188
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-unit-test | `52.29% <ø> (ø)` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=footer). Last update [8b6080d...2b5df55](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
--
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-io edited a comment on pull request #1725: feat: add proxy-mirror plugin form
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #1725:
URL: https://github.com/apache/apisix-dashboard/pull/1725#issuecomment-816442886
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=h1) Report
> Merging [#1725](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=desc) (f02d0c5) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/82ab89e2f208eeca1e6f03d9dae885ee7e4b19d3?el=desc) (82ab89e) will **decrease** coverage by `19.74%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #1725 +/- ##
===========================================
- Coverage 72.04% 52.29% -19.75%
===========================================
Files 132 38 -94
Lines 5687 2660 -3027
Branches 660 0 -660
===========================================
- Hits 4097 1391 -2706
+ Misses 1346 1081 -265
+ Partials 244 188 -56
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `?` | |
| backend-e2e-test-ginkgo | `?` | |
| backend-unit-test | `52.29% <ø> (ø)` | |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/filter/request\_id.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9yZXF1ZXN0X2lkLmdv) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=) | `0.00% <0.00%> (-71.03%)` | :arrow_down: |
| [api/internal/filter/cors.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9jb3JzLmdv) | `0.00% <0.00%> (-66.67%)` | :arrow_down: |
| [api/internal/filter/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#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/1725/diff?src=pr&el=tree#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/1725/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZGF0YV9sb2FkZXIvcm91dGVfaW1wb3J0Lmdv) | `27.41% <0.00%> (-37.50%)` | :arrow_down: |
| [api/internal/handler/handler.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvaGFuZGxlci5nbw==) | `42.59% <0.00%> (-35.19%)` | :arrow_down: |
| [api/internal/handler/schema/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvc2NoZW1hL3NjaGVtYS5nbw==) | `66.66% <0.00%> (-33.34%)` | :arrow_down: |
| ... and [117 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1725/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=footer). Last update [82ab89e...f02d0c5](https://codecov.io/gh/apache/apisix-dashboard/pull/1725?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
--
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] LiteSun commented on a change in pull request #1725: feat: add proxy-mirror plugin form
Posted by GitBox <gi...@apache.org>.
LiteSun commented on a change in pull request #1725:
URL: https://github.com/apache/apisix-dashboard/pull/1725#discussion_r611366506
##########
File path: web/cypress/integration/consumer/create-consumer-with-proxy-mirror-form.spec.js
##########
@@ -0,0 +1,103 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/* eslint-disable no-undef */
+
+context('Create and Delete Consumer', () => {
+ beforeEach(() => {
+ cy.login();
+
+ cy.fixture('selector.json').as('domSelector');
+ cy.fixture('data.json').as('data');
+ });
+
+ const selector = {
+ host: "#host"
+ }
+
+ const data = {
+ correctHost: 'http://127.0.0.1',
+ wrongHost: '127.0.0.1:1999'
+ }
+
+ it('creates consumer with proxy-mirror form', function () {
Review comment:
This is because an authentication plugin is required when creating a Consumer.
--
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 #1725: feat: add proxy-mirror plugin form
Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #1725:
URL: https://github.com/apache/apisix-dashboard/pull/1725#issuecomment-817850088
Deploy preview for *apisix-dashboard* ready!
Built with commit 43a6890d5f2e7873c7a5febe5039fdb5dad4e8c2
https://deploy-preview-1725--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] juzhiyuan commented on a change in pull request #1725: feat: add proxy-mirror plugin form
Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on a change in pull request #1725:
URL: https://github.com/apache/apisix-dashboard/pull/1725#discussion_r611269829
##########
File path: web/src/components/Plugin/UI/plugin.tsx
##########
@@ -38,6 +39,8 @@ export const PluginForm: React.FC<Props> = ({ name, renderForm, form }) => {
switch (name) {
case 'basic-auth':
return <BasicAuth form={form} />
+ case 'proxy-mirror':
+ return <ProxyMirror form={form} />
Review comment:
This FormComponent receives Plug-in Name and returns the target Component, use Switch-Case is ok 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