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

[ChaosCenter]: Migrating graphql-server from Gorilla mux to Gin (#3923) #3923

Merged
merged 13 commits into from
Apr 7, 2023

Conversation

namkyu1999
Copy link
Member

Proposed changes

Migrate from Gorilla Mux to Gin because of two main reasons.

  • Gorilla Mux is no longer actively maintained
  • Unifying the router framework used in backend applications (Authentication, GraphQL ...)

Issue No. #3919

Types of changes

What types of changes does your code introduce to Litmus? Put an x in the boxes that apply

  • New feature (non-breaking change which adds functionality)
  • Bugfix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices applies)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING doc
  • I have signed the commit for DCO to be passed.
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have added necessary documentation (if appropriate)

Dependency

  • Please add the links to the dependent PR need to be merged before this (if any).

Special notes for your reviewer: @S-ayanide @amityt

@namkyu1999 namkyu1999 force-pushed the mux-to-gin branch 2 times, most recently from 0df3e8c to 44ca043 Compare March 16, 2023 07:38
Signed-off-by: Namkyu Park <lak9348@gmail.com>
Signed-off-by: namkyu1999 <lak9348@konkuk.ac.kr>
@S-ayanide
Copy link
Member

There seems to be some linting and import order issues, can you run a gofmt in your change files!

@S-ayanide S-ayanide self-requested a review March 17, 2023 07:39
Signed-off-by: namkyu1999 <lak9348@konkuk.ac.kr>
@namkyu1999
Copy link
Member Author

There seems to be some linting and import order issues, can you run a gofmt in your change files!

I fixed all @S-ayanide !

…ux-to-gin

Signed-off-by: namkyu1999 <lak9348@konkuk.ac.kr>
@amityt amityt requested a review from S-ayanide March 27, 2023 04:04
Signed-off-by: namkyu1999 <lak9348@konkuk.ac.kr>
@namkyu1999 namkyu1999 requested review from gdsoumya and removed request for S-ayanide March 27, 2023 07:43
Signed-off-by: namkyu1999 <lak9348@konkuk.ac.kr>
Copy link
Member

@imrajdas imrajdas left a comment

Choose a reason for hiding this comment

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

Please fix requested codeql issues in your PR

namkyu1999 and others added 5 commits April 7, 2023 17:35
…schaos#3933)

* fix: Move to using interface for better mocking at chaoshub

Signed-off-by: namkyu1999 <lak9348@konkuk.ac.kr>

* fix: delete operator interface and linting codes

Signed-off-by: namkyu1999 <lak9348@konkuk.ac.kr>

* fix: change db instance to local variable

Signed-off-by: namkyu1999 <lak9348@konkuk.ac.kr>

* fix: passing operator interface for better mocking

Signed-off-by: namkyu1999 <lak9348@konkuk.ac.kr>

---------

Signed-off-by: namkyu1999 <lak9348@konkuk.ac.kr>
Signed-off-by: namkyu1999 <lak9348@konkuk.ac.kr>
Signed-off-by: namkyu1999 <lak9348@konkuk.ac.kr>
Signed-off-by: namkyu1999 <lak9348@konkuk.ac.kr>
Signed-off-by: namkyu1999 <lak9348@konkuk.ac.kr>
@namkyu1999 namkyu1999 force-pushed the mux-to-gin branch 5 times, most recently from 9145dad to 9b8b5cb Compare April 7, 2023 09:15
Signed-off-by: namkyu1999 <lak9348@konkuk.ac.kr>
Signed-off-by: namkyu1999 <lak9348@konkuk.ac.kr>
@namkyu1999 namkyu1999 force-pushed the mux-to-gin branch 2 times, most recently from 25890b4 to 04842e5 Compare April 7, 2023 09:32
…ux-to-gin

Signed-off-by: namkyu1999 <lak9348@konkuk.ac.kr>
@namkyu1999
Copy link
Member Author

namkyu1999 commented Apr 7, 2023

Please fix requested codeql issues in your PR

Hey @imrajdas,
CodeQL issues that I encountered is one that existed before my PR.
The problem is our backend code use variable given by user to os file open.
I think this task is independently from this pr. So If ok, can I raise another issue to handle it?

As a temporary measure, I wrote code to remove "../" , "..", etc. if they were added to the data by the API requestor.
replacer := strings.NewReplacer("../", "", "./", "", "/", "", "..", "")

@namkyu1999 namkyu1999 requested a review from imrajdas April 7, 2023 10:33
@imrajdas
Copy link
Member

imrajdas commented Apr 7, 2023

As a temporary measure, I wrote code to remove "../" , "..", etc. if they were added to the data by the API requestor.

Ok, we can take it in other PR.

@imrajdas
Copy link
Member

imrajdas commented Apr 7, 2023

@amityt - please do a final review before the merge

@@ -6,11 +6,12 @@ require (
github.com/99designs/gqlgen v0.11.3
github.com/argoproj/argo-workflows/v3 v3.3.1
github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32
github.com/gin-contrib/cors v1.3.1
github.com/gin-gonic/gin v1.7.7
Copy link
Member

@imrajdas imrajdas Apr 7, 2023

Choose a reason for hiding this comment

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

1.7.7 is released in 2021. Can we use the latest one? If no major code change is required

Copy link
Contributor

Choose a reason for hiding this comment

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

@imrajdas let's take it in a different PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

1.9.0 is the latest version.
But higher than 1.7.7, We need to upgrade the version of Go 1.17.
So I just use that version like the authentication server in litmusChaos

스크린샷 2023-04-07 오후 9 25 40

Copy link
Member

Choose a reason for hiding this comment

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

okay, lets do it in other PR

@imrajdas imrajdas changed the title Migrate from Gorilla mux to Gin [ChaosCenter]: Migrating graphql-server from Gorilla mux to Gin (#3923) Apr 7, 2023
@imrajdas imrajdas merged commit c6cda32 into litmuschaos:master Apr 7, 2023
@namkyu1999 namkyu1999 mentioned this pull request May 18, 2023
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LFX-MENTORSHIP Linux Foundation Mentor ship Issue litmus-portal /refactor Refactoring litmus-portal READY-FOR-REVIEW
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants