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

feat: Create Connection between Fed Server and Next Gen #137

Merged
merged 67 commits into from
Mar 2, 2024
Merged

Conversation

rainandbare
Copy link
Contributor

@rainandbare rainandbare commented Mar 1, 2024

Pull Request

JIRA Ticket

CZID-8731

Description

This PR pulls in the connection code to main so that we are all synced up between sandbox and main.

This will allow us to work together on creating connections for individual resolvers.

There are a lot of formatting changes in this PR unfortunately but the main work is done in httpUtils. I changed the get function to receive an object and pulled out getFromRails and fetchFromNextGen into their own functions so that we can call them directly in the resolvers if needed.

We can either call fetchFromNextGen using the passed through context.params.query with a formatting function that pulls out the 'fed' prefix and the input: {} wrapper or we can pass an optional custom query if we need something specific in the resolvers.

Tests

Updated unit tests to cover new fedConsensusGenome functionality
Smoke tested with main branch of czid-web to ensure no changes in functionality

Saquib Kothawala and others added 30 commits October 30, 2023 15:58
routing based on feature flags
Co-authored-by: Jake Heath <76011913+jakeyheath@users.noreply.github.com>
Co-authored-by: Saquib Kothawala <saquib.kothawala@contractor.chanzuckerberg.com>
Co-authored-by: Jerry Fu <2072627+jfoo1984@users.noreply.github.com>
Co-authored-by: Jake Heath <76011913+jakeyheath@users.noreply.github.com>
Co-authored-by: czi-github-helper[bot] <95879977+czi-github-helper[bot]@users.noreply.github.com>
Co-authored-by: rzlim08 <37033997+rzlim08@users.noreply.github.com>
Co-authored-by: bchu1 <151689101+bchu1@users.noreply.github.com>
Co-authored-by: Suzette McCanny <smccanny@deloitte.ca>
Co-authored-by: Erin Hoops <109251328+ehoops-cz@users.noreply.github.com>
@rainandbare rainandbare changed the title feat: Create Connection between Fed Server and Next Gen (demo work) feat: Create Connection between Fed Server and Next Gen Mar 1, 2024
@rainandbare rainandbare marked this pull request as ready for review March 1, 2024 15:51
tests/FormatNextGenQuery.test.ts Outdated Show resolved Hide resolved
tests/FormatNextGenQuery.test.ts Show resolved Hide resolved
utils/httpUtils.ts Outdated Show resolved Hide resolved
utils/httpUtils.ts Outdated Show resolved Hide resolved
utils/httpUtils.ts Outdated Show resolved Hide resolved
resolvers.ts Show resolved Hide resolved
utils/httpUtils.ts Outdated Show resolved Hide resolved
utils/httpUtils.ts Outdated Show resolved Hide resolved
utils/httpUtils.ts Outdated Show resolved Hide resolved
utils/httpUtils.ts Outdated Show resolved Hide resolved

const checkForLogin = (responseUrl: string | null) => {
if (responseUrl?.includes("/auth0/refresh_token?mode=login")) {
throw new Error("You must be logged in to perform this action.");
Copy link
Collaborator

@jfoo1984 jfoo1984 Mar 1, 2024

Choose a reason for hiding this comment

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

In my experience, in mesh, if you throw an error and it isn't caught, it will kill the mesh process this code was running in (although it automatically attempts to restart it). Looking above, I believe this error should be caught and we reject the Promise, right? Just wanted to verify so we don't kill the server processes 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Mmm yeah, this function has been there for a while but now that the functions are modular maybe I need try catch statements in the fetchFromNextGen and the getFromRails incase they are called on their own

Copy link
Collaborator

@jfoo1984 jfoo1984 left a comment

Choose a reason for hiding this comment

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

Thanks for getting all this together in a state where we can merge it!

@rainandbare rainandbare merged commit b98dd14 into main Mar 2, 2024
7 checks passed
@rainandbare rainandbare deleted the sandbox branch March 2, 2024 03:27
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