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

Replace swagger-based QA client with simple fetch calls #3342

Merged
merged 1 commit into from
Nov 18, 2021

Conversation

justinlittman
Copy link
Contributor

@justinlittman justinlittman commented Nov 17, 2021

Fixes #3262

This commit replaces the swagger-based QA client. Why?

  1. the API specification is incomplete;
  2. it's not clear there is a plan in place to keep the specification up to date; and
  3. we only use a fraction of the QA API in the Sinopia editor

In short, it's to pay down technical debt. This commit otherwise retains the same interface for interacting with the QA API, returning a promise that resolves to the HTTP response.

Why was this change made?

This is an update on @mjgiarlo's earlier PR.

How was this change tested?

Which documentation and/or configurations were updated?

@justinlittman justinlittman marked this pull request as draft November 17, 2021 15:51
@justinlittman justinlittman marked this pull request as ready for review November 17, 2021 17:17
Copy link
Contributor

@ndushay ndushay left a comment

Choose a reason for hiding this comment

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

LGTM; one quibble and a question. You prolly want Mike to review, yes?

* for each type are different, so check the nonldLookup field in the lookup config.
* If the field is not set, assume false.
* There are four types of lookup: linked data and non-linked data, authority
* andsubauthority. The API calls for each type are different, so construct
Copy link
Contributor

Choose a reason for hiding this comment

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

missing a space ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

})
})

describe("when non-LD authority", () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

should there be a test with subauthority for this one? You mention 4 types in the class comments, so ... four cases in the test??

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This actually is an authority with subauthority. In addition, all of our non-LD authorities have subauthorities.

Made this clearer in test.

Fixes #3262

This commit replaces the swagger-based QA client. Why?

1. the API specification is incomplete;
2. it's not clear there is a plan in place to keep the specification up to date; and
3. we only use a fraction of the QA API in the Sinopia editor

In short, it's to pay down technical debt. This commit otherwise retains the same interface for interacting with the QA API, returning a promise that resolves to the HTTP response.
@justinlittman justinlittman merged commit 4efc90a into main Nov 18, 2021
@justinlittman justinlittman deleted the t3262-swagger branch November 18, 2021 20:57
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.

Rewrite QA client
3 participants