Skip to content

Conversation

@nic-chen
Copy link
Member

@nic-chen nic-chen commented Oct 4, 2020

Please answer these questions before submitting a pull request

  • Why submit this pull request?
  • Bug fix
  • New feature provided
  • Improve performance

New feature or improvement

  • Describe the details and related test reports.

feat: refactor apis for existing check and other apis
such as:
/apisix/admin/notexist/upstreams
/apisix/admin/names/upstreams
/apisix/admin/notexist/routes
/apisix/admin/check_ssl_cert

and so on.

@nic-chen nic-chen marked this pull request as ready for review October 5, 2020 09:05
@nic-chen nic-chen requested review from ShiningRush, gxthrj, juzhiyuan, membphis and moonming and removed request for juzhiyuan October 5, 2020 09:06
* 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.
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

Duplicate header

Copy link
Member

Choose a reason for hiding this comment

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

ping @nic-chen

* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2017 The Kubernetes Authors.
Copy link
Contributor

Choose a reason for hiding this comment

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

are these headers must to be kept ?

Copy link
Member

Choose a reason for hiding this comment

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

Is this file from Kubernetes repo?

Copy link
Member Author

Choose a reason for hiding this comment

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

some code copy from Kubernetes dashboard , so i think it's better to keep their license. what do you think ? @moonming

Copy link
Member

Choose a reason for hiding this comment

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

ping @moonming

* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2017 The Kubernetes Authors.
Copy link
Member

Choose a reason for hiding this comment

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

Is this file from Kubernetes repo?

* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2017 The Kubernetes Authors.
Copy link
Member

Choose a reason for hiding this comment

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

ditto

* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2017 The Kubernetes Authors.
Copy link
Member

Choose a reason for hiding this comment

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

ditto

@moonming
Copy link
Member

moonming commented Oct 5, 2020 via email

@nic-chen
Copy link
Member Author

nic-chen commented Oct 5, 2020

This method is not right. What is the license of the original code?

the Apache License, Version 2.0

@moonming
Copy link
Member

moonming commented Oct 6, 2020

Please add codecov

@nic-chen
Copy link
Member Author

nic-chen commented Oct 9, 2020

@moonming
Copy link
Member

moonming commented Oct 9, 2020

we can leave the lincense issues when merge to master. @nic-chen

@moonming
Copy link
Member

moonming commented Oct 9, 2020

@nic-chen what's the code coverage?

* 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.
*/
Copy link
Member

Choose a reason for hiding this comment

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

ping @nic-chen

* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2017 The Kubernetes Authors.
Copy link
Member

Choose a reason for hiding this comment

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

ping @moonming

r.PATCH("/apisix/admin/ssl/:id", wgin.Wraps(h.Patch,
wrapper.InputType(reflect.TypeOf(UpdateInput{}))))
r.DELETE("/apisix/admin/ssl", wgin.Wraps(h.BatchDelete,
r.DELETE("/apisix/admin/ssl/:ids", wgin.Wraps(h.BatchDelete,
Copy link
Member

Choose a reason for hiding this comment

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

why we use ids here? I think it should be id, the singular should be used here.

@nic-chen
Copy link
Member Author

nic-chen commented Oct 9, 2020

@nic-chen what's the code coverage?

you could see in my repo:
https://github.com/nic-chen/incubator-apisix-dashboard/pull/7/checks?check_run_id=1212879646

main code of refactoring:
coverage: 81.3% of statements
github.com/apisix/manager-api/internal/core/store
coverage: 63.3% of statements
github.com/apisix/manager-api/internal/utils

the handlers using api test, so it couldn't calculate coverage correctly.

@nic-chen
Copy link
Member Author

nic-chen commented Oct 9, 2020

@membphis we leave the license issues and fix it later.

@nic-chen
Copy link
Member Author

nic-chen commented Oct 9, 2020

I will merge this pr.
so that we could move forward.
we could fix other issues later.

@moonming @membphis @juzhiyuan @ShiningRush

@moonming
Copy link
Member

moonming commented Oct 9, 2020

I will merge this pr.
so that we could move forward.
we could fix other issues later.

@moonming @membphis @juzhiyuan @ShiningRush

please create issues for them

@nic-chen
Copy link
Member Author

nic-chen commented Oct 9, 2020

I will merge this pr.
so that we could move forward.
we could fix other issues later.
@moonming @membphis @juzhiyuan @ShiningRush

please create issues for them

ok

@juzhiyuan
Copy link
Member

Please link this PR in those issues :D

@nic-chen nic-chen merged commit caccfb7 into apache:refactor Oct 9, 2020
@nic-chen
Copy link
Member Author

nic-chen commented Oct 9, 2020

Please link this PR in those issues :D

OK

juzhiyuan pushed a commit that referenced this pull request Oct 20, 2020
* feat: refactor some codes and append store core

* refference droplet and write a API demo

* fmt project

* feat: add validator for generic store; add demo error

* feat: upgrade droplet

* chore: add structures (#484)

* add upstream struct

* fix structures

* feat: append stock check for generic store

* feat: add consumer CURD refactoring (#486)

* feat: add consumer CURD refactoring

* remove debug

* remove useless slashes

* feat: add SSL refactoring (#488)

Co-authored-by: Vinci Xu <277040271@qq.com>

* feat: add Service and Upstream refactoring (#497)

* feat: add Service and Upstream refactoring

* fix add license

* feat: add store hub and flake id (#534)

* feat: add store hub and flake id

* feat: add store interface to easy est

* fix: add test cases for refactored apis and fix bugs (#528)

* test: delete mysql version test cases.

* fix: add ssl test cases and bug fix

* fix: list api should return an empty array not a null for client

* test: consumer test cases

* fix: code style

* test: init etcd in github action

* fix: skip checking generated file's license

* feat: add store hub and flake id (#534)

* feat: add store hub and flake id

* feat: add store interface to easy est

* fix CI failed

Co-authored-by: Vinci Xu <277040271@qq.com>

* feat: refactor apis for existing check and other apis (#535)

* fix code style

* fix code style

* feat support query

* feat: support query

* change: `like` to `equal`

* fix api status

* feat: upstream existing check

* feat: refactor api for upstream names

* fix: license

* test: add unit test cases

* fix: update bug

* test: add test cases for route

* fix: unified respond format

* test: remove test bug

* feat: ssl existing check

* fix bug: auto generate id

* fix: improve consumer

* fix: remove key and keys in ssl respond

* fix: when list is empty, should respond an empty array

* fix code style

* feat: plugin orchestration

* fix delete bug

* fix bug

* fix: keep the same request params and respond with the old format

* fix: append sort for list and using sync.Map instead of map

* feature: sync json schema from APISIX and check schema when create or update resource (#551)

* feat: json schema check

* fix: don't need to define struct for each resource, because that may cause json schema check fail.

* test: add handler test cases

* test: complete consumer test cases

* test: add test cases for schema check

* fix code style and license

* feat: add schema check for plugins

* test: add ssl handler test cases

* test: add test cases for upstream and service

* test: add test cases for route

* test: add note for route create

* test: update CI

* fix: remove useless file

* test: fix CI

* fix: ci fail

* test: fix lib `dag-to-lua`'s path in CI

* fix: URI for route may be empty

* fix: remove empty lines

* fix: refactor validator of json schema

* fix code style

* fix cicd

* chore: update docker file

* fix: should check schema after id generated

* fix code style

* chore: page_number -> page

* fix: schema sync script

* fix: code style

* feat: support search for resource list (#557)

* feat: support search for resource list

* fix ci

* feature: refactor plugin api and auth api (#556)

* feat: refactor plugin and healthy api

* feat: refactor authentication api

* fix: remove useless files

* chore: update json schema

* test: add login test

* test: add test for plugin

* fix: license

* fix auth bug

* fix route search by uri

* feat: compatible with PUT method of `admin api` and nodes of upstream (#561)

* feat: support labels

* feat: compatible with PUT method of `admin api`

* fix mock test fail

* feat: upstream nodes format

* test: add test case

* fix code style

* fix: update schema sync tool

* feat: compatible with HTTP status of `admin api` (#563)

* feat: compatible with HTTP status of `admin api`

* test cases and improve

* fix: check input.ID before using it

* fix: remove CI branch

* fix: remove useless dependences

* add license for json.lua

* fix license issue

* remove

* fix: remove viper that depend github.com/hashicorp/hcl

* fix license issue

* fix: skip license check temporarily for CI

Co-authored-by: vincixu <vincixu@tencent.com>
Co-authored-by: ShiningRush <277040271@qq.com>
Co-authored-by: WenMing <moonbingbing@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants