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/02/01 16:12:03 UTC
[GitHub] [apisix-dashboard] guoqqqi opened a new pull request #1413: fix: Upstream information is lost when editing services
guoqqqi opened a new pull request #1413:
URL: https://github.com/apache/apisix-dashboard/pull/1413
Please answer these questions before submitting a pull request
- Why submit this pull request?
- [x] Bugfix
- [ ] New feature provided
- [ ] Improve performance
- [ ] Backport patches
- Related issues
___
### Bugfix
- Description
1. Create the service and select the existing upstream

2. Edit, upstream information is lost

- How to fix?
Added `shouldUpdate` method to update form information.
___
----------------------------------------------------------------
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 #1413: fix: Upstream information is lost when editing services
Posted by GitBox <gi...@apache.org>.
juzhiyuan merged pull request #1413:
URL: https://github.com/apache/apisix-dashboard/pull/1413
----------------------------------------------------------------
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] guoqqqi closed pull request #1413: fix: Upstream information is lost when editing services
Posted by GitBox <gi...@apache.org>.
guoqqqi closed pull request #1413:
URL: https://github.com/apache/apisix-dashboard/pull/1413
----------------------------------------------------------------
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 #1413: fix: Upstream information is lost when editing services
Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on pull request #1413:
URL: https://github.com/apache/apisix-dashboard/pull/1413#issuecomment-771298373
waiting for testcase
----------------------------------------------------------------
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] guoqqqi commented on pull request #1413: fix: Upstream information is lost when editing services
Posted by GitBox <gi...@apache.org>.
guoqqqi commented on pull request #1413:
URL: https://github.com/apache/apisix-dashboard/pull/1413#issuecomment-773081816
> This change also affects the upstream part of the consumer and route, so keep an eye on that. @guoqqqi
Thanks for the suggestion, I've tested them locally and they all work fine.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] liuxiran commented on pull request #1413: fix: Upstream information is lost when editing services
Posted by GitBox <gi...@apache.org>.
liuxiran commented on pull request #1413:
URL: https://github.com/apache/apisix-dashboard/pull/1413#issuecomment-771283437
it worked well when I ran this pr locally :100:
how about add to a test case to cover this situation?
----------------------------------------------------------------
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 #1413: fix: Upstream information is lost when editing services
Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on a change in pull request #1413:
URL: https://github.com/apache/apisix-dashboard/pull/1413#discussion_r569310746
##########
File path: web/cypress/integration/service/edit-service-with-upstream.spec.js
##########
@@ -0,0 +1,104 @@
+/*
+ * 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('edit service with upstream', () => {
+ const domSelector = {
+ name: '#name',
+ desc: '#desc',
+ nodes_0_host: '#nodes_0_host',
+ notification: '.ant-notification-notice-message',
+ search_name: '[title=Name]',
+ custom_upstream: '[title=Custom]',
+ test_upstream: '[title=test_upstream]',
+ input: ':input',
+ };
+ const data = {
+ service_name: 'service',
+ test_upstream: 'test_upstream',
+ desc: 'desc',
+ ip: '127.0.0.1',
+ create_service_success: 'Create Service Successfully',
+ create_upstream_success: 'Create Upstream Successfully',
+ delete_service_success: 'Delete Service Successfully',
+ delete_upstream_success: 'Delete Upstream Successfully',
+ };
+
+ beforeEach(() => {
+ cy.login();
+ });
+
+ it('should create test upstream', () => {
Review comment:
```suggestion
it('should create a test upstream', () => {
```
##########
File path: web/cypress/integration/service/edit-service-with-upstream.spec.js
##########
@@ -0,0 +1,104 @@
+/*
+ * 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('edit service with upstream', () => {
Review comment:
`Edit Service with Upstream`
##########
File path: web/cypress/integration/service/edit-service-with-upstream.spec.js
##########
@@ -0,0 +1,104 @@
+/*
+ * 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('edit service with upstream', () => {
+ const domSelector = {
+ name: '#name',
+ desc: '#desc',
+ nodes_0_host: '#nodes_0_host',
+ notification: '.ant-notification-notice-message',
+ search_name: '[title=Name]',
+ custom_upstream: '[title=Custom]',
+ test_upstream: '[title=test_upstream]',
+ input: ':input',
+ };
+ const data = {
+ service_name: 'service',
+ test_upstream: 'test_upstream',
+ desc: 'desc',
+ ip: '127.0.0.1',
+ create_service_success: 'Create Service Successfully',
+ create_upstream_success: 'Create Upstream Successfully',
+ delete_service_success: 'Delete Service Successfully',
+ delete_upstream_success: 'Delete Upstream Successfully',
+ };
+
+ beforeEach(() => {
+ cy.login();
+ });
+
+ it('should create test upstream', () => {
+ cy.visit('/');
+ cy.contains('Upstream').click();
+ cy.contains('Create').click();
+
+ cy.get(domSelector.name).type(data.test_upstream);
+ cy.get(domSelector.nodes_0_host).type(data.ip);
+ cy.contains('Next').click();
+ cy.contains('Submit').click();
+ cy.get(domSelector.notification).should('contain', data.create_upstream_success);
+ cy.url().should('contains', 'upstream/list');
+ });
+
+ it('should create test service', () => {
+ cy.visit('/');
+ cy.contains('Service').click();
+ cy.contains('Create').click();
+ cy.get(domSelector.name).type(data.service_name);
+ cy.get(domSelector.desc).type(data.desc);
+ cy.get(domSelector.custom_upstream).click();
Review comment:
`custom_upstream` -> `upstream_selector`?
##########
File path: web/cypress/integration/service/edit-service-with-upstream.spec.js
##########
@@ -0,0 +1,104 @@
+/*
+ * 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('edit service with upstream', () => {
+ const domSelector = {
+ name: '#name',
+ desc: '#desc',
+ nodes_0_host: '#nodes_0_host',
+ notification: '.ant-notification-notice-message',
+ search_name: '[title=Name]',
+ custom_upstream: '[title=Custom]',
+ test_upstream: '[title=test_upstream]',
+ input: ':input',
+ };
+ const data = {
+ service_name: 'service',
+ test_upstream: 'test_upstream',
+ desc: 'desc',
+ ip: '127.0.0.1',
+ create_service_success: 'Create Service Successfully',
+ create_upstream_success: 'Create Upstream Successfully',
+ delete_service_success: 'Delete Service Successfully',
+ delete_upstream_success: 'Delete Upstream Successfully',
+ };
+
+ beforeEach(() => {
+ cy.login();
+ });
+
+ it('should create test upstream', () => {
+ cy.visit('/');
+ cy.contains('Upstream').click();
+ cy.contains('Create').click();
+
+ cy.get(domSelector.name).type(data.test_upstream);
+ cy.get(domSelector.nodes_0_host).type(data.ip);
+ cy.contains('Next').click();
+ cy.contains('Submit').click();
+ cy.get(domSelector.notification).should('contain', data.create_upstream_success);
+ cy.url().should('contains', 'upstream/list');
+ });
+
+ it('should create test service', () => {
+ cy.visit('/');
+ cy.contains('Service').click();
+ cy.contains('Create').click();
+ cy.get(domSelector.name).type(data.service_name);
+ cy.get(domSelector.desc).type(data.desc);
+ cy.get(domSelector.custom_upstream).click();
+ cy.contains(data.test_upstream).click();
+ cy.get(domSelector.input).should('be.disabled');
+
+ cy.contains('Next').click();
+ cy.contains('Next').click();
+ cy.contains('Submit').click();
+ cy.get(domSelector.notification).should('contain', data.create_service_success);
+ });
+
+ it('should edit the service', () => {
+ cy.visit('/');
+ cy.contains('Service').click();
+
+ cy.get(domSelector.search_name).type(data.service_name);
+ cy.contains('Search').click();
+ cy.contains(data.service_name).siblings().contains('Edit').click();
+
+ cy.get(domSelector.nodes_0_host).click().should('value', data.ip);
+ cy.get(domSelector.input).should('be.disabled');
+
+ cy.get(domSelector.test_upstream).click();
+ cy.contains('Custom').click();
+ cy.get(domSelector.nodes_0_host).should('not.be.disabled');
+ });
+
+ it('should delete service and upstream', () => {
Review comment:
both and
##########
File path: web/cypress/integration/service/edit-service-with-upstream.spec.js
##########
@@ -0,0 +1,104 @@
+/*
+ * 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('edit service with upstream', () => {
+ const domSelector = {
+ name: '#name',
+ desc: '#desc',
+ nodes_0_host: '#nodes_0_host',
+ notification: '.ant-notification-notice-message',
+ search_name: '[title=Name]',
+ custom_upstream: '[title=Custom]',
+ test_upstream: '[title=test_upstream]',
+ input: ':input',
+ };
+ const data = {
+ service_name: 'service',
+ test_upstream: 'test_upstream',
+ desc: 'desc',
+ ip: '127.0.0.1',
+ create_service_success: 'Create Service Successfully',
+ create_upstream_success: 'Create Upstream Successfully',
+ delete_service_success: 'Delete Service Successfully',
+ delete_upstream_success: 'Delete Upstream Successfully',
+ };
+
+ beforeEach(() => {
+ cy.login();
+ });
+
+ it('should create test upstream', () => {
+ cy.visit('/');
+ cy.contains('Upstream').click();
+ cy.contains('Create').click();
+
+ cy.get(domSelector.name).type(data.test_upstream);
+ cy.get(domSelector.nodes_0_host).type(data.ip);
+ cy.contains('Next').click();
+ cy.contains('Submit').click();
+ cy.get(domSelector.notification).should('contain', data.create_upstream_success);
+ cy.url().should('contains', 'upstream/list');
+ });
+
+ it('should create test service', () => {
Review comment:
`a test xx`
##########
File path: web/cypress/integration/service/edit-service-with-upstream.spec.js
##########
@@ -0,0 +1,104 @@
+/*
+ * 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('edit service with upstream', () => {
+ const domSelector = {
+ name: '#name',
+ desc: '#desc',
+ nodes_0_host: '#nodes_0_host',
+ notification: '.ant-notification-notice-message',
+ search_name: '[title=Name]',
+ custom_upstream: '[title=Custom]',
+ test_upstream: '[title=test_upstream]',
+ input: ':input',
+ };
+ const data = {
+ service_name: 'service',
+ test_upstream: 'test_upstream',
+ desc: 'desc',
+ ip: '127.0.0.1',
+ create_service_success: 'Create Service Successfully',
+ create_upstream_success: 'Create Upstream Successfully',
+ delete_service_success: 'Delete Service Successfully',
+ delete_upstream_success: 'Delete Upstream Successfully',
+ };
+
+ beforeEach(() => {
+ cy.login();
+ });
+
+ it('should create test upstream', () => {
+ cy.visit('/');
+ cy.contains('Upstream').click();
+ cy.contains('Create').click();
+
+ cy.get(domSelector.name).type(data.test_upstream);
+ cy.get(domSelector.nodes_0_host).type(data.ip);
+ cy.contains('Next').click();
+ cy.contains('Submit').click();
+ cy.get(domSelector.notification).should('contain', data.create_upstream_success);
+ cy.url().should('contains', 'upstream/list');
+ });
+
+ it('should create test service', () => {
+ cy.visit('/');
+ cy.contains('Service').click();
+ cy.contains('Create').click();
+ cy.get(domSelector.name).type(data.service_name);
+ cy.get(domSelector.desc).type(data.desc);
+ cy.get(domSelector.custom_upstream).click();
+ cy.contains(data.test_upstream).click();
+ cy.get(domSelector.input).should('be.disabled');
+
+ cy.contains('Next').click();
+ cy.contains('Next').click();
+ cy.contains('Submit').click();
+ cy.get(domSelector.notification).should('contain', data.create_service_success);
+ });
+
+ it('should edit the service', () => {
Review comment:
doesn't edit the service 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] juzhiyuan merged pull request #1413: fix: Upstream information is lost when editing services
Posted by GitBox <gi...@apache.org>.
juzhiyuan merged pull request #1413:
URL: https://github.com/apache/apisix-dashboard/pull/1413
----------------------------------------------------------------
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 #1413: fix: Upstream information is lost when editing services
Posted by GitBox <gi...@apache.org>.
LiteSun commented on a change in pull request #1413:
URL: https://github.com/apache/apisix-dashboard/pull/1413#discussion_r570068299
##########
File path: web/cypress/integration/route/online-debug.spec.js
##########
@@ -61,6 +61,7 @@ context('Online debug', () => {
cy.get(domSelector.uriInput).type(uri);
cy.contains(routeLocaleUS['page.route.button.send']).click({force: true});
+
Review comment:
remove extra line.
----------------------------------------------------------------
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 #1413: fix: Upstream information is lost when editing services
Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on pull request #1413:
URL: https://github.com/apache/apisix-dashboard/pull/1413#issuecomment-771298373
waiting for testcase
----------------------------------------------------------------
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] guoqqqi commented on pull request #1413: fix: Upstream information is lost when editing services
Posted by GitBox <gi...@apache.org>.
guoqqqi commented on pull request #1413:
URL: https://github.com/apache/apisix-dashboard/pull/1413#issuecomment-773081816
> This change also affects the upstream part of the consumer and route, so keep an eye on that. @guoqqqi
Thanks for the suggestion, I've tested them locally and they all work fine.
----------------------------------------------------------------
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] guoqqqi closed pull request #1413: fix: Upstream information is lost when editing services
Posted by GitBox <gi...@apache.org>.
guoqqqi closed pull request #1413:
URL: https://github.com/apache/apisix-dashboard/pull/1413
----------------------------------------------------------------
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 #1413: fix: Upstream information is lost when editing services
Posted by GitBox <gi...@apache.org>.
LiteSun commented on a change in pull request #1413:
URL: https://github.com/apache/apisix-dashboard/pull/1413#discussion_r570068299
##########
File path: web/cypress/integration/route/online-debug.spec.js
##########
@@ -61,6 +61,7 @@ context('Online debug', () => {
cy.get(domSelector.uriInput).type(uri);
cy.contains(routeLocaleUS['page.route.button.send']).click({force: true});
+
Review comment:
remove extra line.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] liuxiran commented on pull request #1413: fix: Upstream information is lost when editing services
Posted by GitBox <gi...@apache.org>.
liuxiran commented on pull request #1413:
URL: https://github.com/apache/apisix-dashboard/pull/1413#issuecomment-771283437
it worked well when I ran this pr locally :100:
how about add to a test case to cover this situation?
----------------------------------------------------------------
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 #1413: fix: Upstream information is lost when editing services
Posted by GitBox <gi...@apache.org>.
LiteSun commented on pull request #1413:
URL: https://github.com/apache/apisix-dashboard/pull/1413#issuecomment-772976103
This change also affects the upstream part of the consumer and route, so keep an eye on that. @guoqqqi
----------------------------------------------------------------
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