Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(api): use direct routes #2066

Merged
merged 6 commits into from Jul 2, 2021

Conversation

g1eny0ung
Copy link
Member

Signed-off-by: Yue Yang g1enyy0ung@gmail.com

What problem does this PR solve?

Close #1500.

Problem Summary

Since the gin-gonic/gin#2706 be merged. Now gin allows param and exact paths to existing on the same route level.

So all of the UI assets can be safely routed by / and /:foo/*bar. This is almost the same as the /*any.

What is changed and how it works?

Except for all descriptions above, this PR also introduces some bug fixes and so on:

  • Fix the problem of duplicate uid indices in SQLite
  • Use gorm.Model to replace dummy fields
  • Bump API server and UI versions
  • Some code formats

Related changes

  • Need to cheery-pick to the release branch

Checklist

Tests

  • Unit test
  • E2E test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Breaking backward compatibility

Release note

Please add a release note.
If you don't think this PR needs a release note then fill it with None.

Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>
@g1eny0ung g1eny0ung requested review from fewdan and STRRL July 1, 2021 09:18
Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>
Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>
@codecov-commenter
Copy link

codecov-commenter commented Jul 1, 2021

Codecov Report

Merging #2066 (cdaa069) into master (18ad845) will increase coverage by 1.72%.
The diff coverage is 44.23%.

❗ Current head cdaa069 differs from pull request most recent head 36b5c21. Consider uploading reports for the commit 36b5c21 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2066      +/-   ##
==========================================
+ Coverage   39.47%   41.19%   +1.72%     
==========================================
  Files          17      127     +110     
  Lines         608     7707    +7099     
==========================================
+ Hits          240     3175    +2935     
- Misses        337     4223    +3886     
- Partials       31      309     +278     
Impacted Files Coverage Δ
api/v1alpha1/awschaos_types.go 0.00% <0.00%> (ø)
api/v1alpha1/dnschaos_type.go 0.00% <0.00%> (ø)
api/v1alpha1/dnschaos_webhook.go 0.00% <0.00%> (ø)
api/v1alpha1/gcpchaos_types.go 0.00% <0.00%> (ø)
api/v1alpha1/httpchaos_types.go 0.00% <0.00%> (ø)
api/v1alpha1/httpchaos_webhook.go 0.00% <0.00%> (ø)
api/v1alpha1/iochaos_types.go 0.00% <0.00%> (-32.56%) ⬇️
api/v1alpha1/jvmchaos_webhook.go 0.00% <0.00%> (ø)
api/v1alpha1/kernelchaos_types.go 0.00% <0.00%> (ø)
api/v1alpha1/networkchaos_types.go 0.00% <0.00%> (-14.44%) ⬇️
... and 197 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e3b091d...36b5c21. Read the comment docs.

Copy link
Member

@fewdan fewdan left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@STRRL STRRL left a comment

Choose a reason for hiding this comment

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

rest LGTM

pkg/apiserver/server.go Show resolved Hide resolved
pkg/apiserver/server.go Outdated Show resolved Hide resolved
STRRL and others added 2 commits July 2, 2021 15:10
Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>
Copy link
Member

@STRRL STRRL left a comment

Choose a reason for hiding this comment

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

LGTM!

@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • STRRL
  • fewdan

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

Copy link
Member

@STRRL STRRL left a comment

Choose a reason for hiding this comment

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

LGTM!

@STRRL
Copy link
Member

STRRL commented Jul 2, 2021

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 95c89fa

@ti-chi-bot ti-chi-bot merged commit 2c98e64 into chaos-mesh:master Jul 2, 2021
@ti-srebot
Copy link
Contributor

cherry pick to release-2.0 in PR #2072

@g1eny0ung g1eny0ung deleted the chore/apiserver branch July 2, 2021 09:45
ti-chi-bot added a commit that referenced this pull request Jul 6, 2021
* chore(api): use direct routes

Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>

* fix: makefile

Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>

* fix(ci): imports

Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>

* chore: address comments

Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>

Co-authored-by: Yue Yang <g1enyy0ung@gmail.com>
Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dashboard takes into account base URL for redirects
6 participants