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

refactor: Migrate Identity API Client to TypeScript #948

Conversation

alexs-mparticle
Copy link
Collaborator

@alexs-mparticle alexs-mparticle commented Nov 8, 2024

Instructions

  1. PR target branch should be against development
  2. PR title name should follow this format: https://github.com/mParticle/mparticle-workflows/blob/main/.github/workflows/pr-title-check.yml
  3. PR branch prefix should follow this format: https://github.com/mParticle/mparticle-workflows/blob/main/.github/workflows/pr-branch-check-name.yml

Summary

  • Migrates Identity API Client code to TypeScript and adds more tests coverage.

Testing Plan

  • Was this tested locally? If not, explain why.
  • Run automated tests and use sample app to verify that identity methods work as expected

Reference Issue (For mParticle employees only. Ignore if you are an outside contributor)

@alexs-mparticle alexs-mparticle changed the title Refactor/sqdsdks 6679 migrate identity api client typescript refactor: Migrate Identity API Client to TypeScript Nov 8, 2024
@alexs-mparticle alexs-mparticle marked this pull request as ready for review November 13, 2024 20:46
@alexs-mparticle alexs-mparticle force-pushed the refactor/SQDSDKS-6679-migrate-identity-api-client-typescript branch 3 times, most recently from 7a613e8 to 8a2e225 Compare November 13, 2024 20:51
@rmi22186 rmi22186 self-requested a review November 14, 2024 18:55
Copy link
Member

@rmi22186 rmi22186 left a comment

Choose a reason for hiding this comment

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

looks great overall. the number of comments is high, but it's mostly the same thing over and over...if we are migrating to ts...let's keep everything typed!

src/identityApiClient.ts Outdated Show resolved Hide resolved
src/identityApiClient.ts Outdated Show resolved Hide resolved
src/identityApiClient.interfaces.ts Show resolved Hide resolved
src/identityApiClient.ts Outdated Show resolved Hide resolved
src/identityApiClient.ts Outdated Show resolved Hide resolved
src/identityApiClient.ts Outdated Show resolved Hide resolved
src/identityApiClient.ts Outdated Show resolved Hide resolved
src/identityApiClient.ts Outdated Show resolved Hide resolved
src/identityApiClient.ts Outdated Show resolved Hide resolved
test/src/tests-identityApiClient.ts Outdated Show resolved Hide resolved
Copy link
Member

@rmi22186 rmi22186 left a comment

Choose a reason for hiding this comment

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

minor nits

src/uploaders.ts Show resolved Hide resolved
src/identityApiClient.ts Show resolved Hide resolved
src/identityApiClient.ts Outdated Show resolved Hide resolved
src/identityApiClient.ts Outdated Show resolved Hide resolved
@alexs-mparticle alexs-mparticle force-pushed the refactor/SQDSDKS-6679-migrate-identity-api-client-typescript branch from 5864e6f to cc84d6f Compare November 20, 2024 15:29
false
);
} catch (err) {
const errorMessage = (err as Error).message || 'Unknown Error';
Copy link
Member

Choose a reason for hiding this comment

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

I think Unknown error is too generic. While we will know it is only coming from here if we do a global search for it, it might be more helpful to provide more context.

I actually think here is a good instance to do something like a toString which you had before if there is no message. That will allow us to debug further. What do you think?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think I would prefer err.toString() if error.message is not available.

Copy link
Member

@rmi22186 rmi22186 left a comment

Choose a reason for hiding this comment

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

looks great!

@alexs-mparticle alexs-mparticle changed the base branch from development to refactor/ts-migration-blackout-2024 November 24, 2024 20:42
@alexs-mparticle alexs-mparticle force-pushed the refactor/SQDSDKS-6679-migrate-identity-api-client-typescript branch from fcb96db to 3d03859 Compare November 25, 2024 19:47
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
13.4% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@alexs-mparticle alexs-mparticle added the refactor Changes to the structure of the code label Nov 25, 2024
@alexs-mparticle alexs-mparticle merged commit 68a0fee into refactor/ts-migration-blackout-2024 Nov 27, 2024
30 of 35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Changes to the structure of the code wait to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants