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: re-order folder structure for types #4090

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

utsabc
Copy link
Member

@utsabc utsabc commented Feb 18, 2025

What are the changes introduced in this PR?

This PR cleans up the siloed type definitions that we have in v0/utils/types/index.ts and distributes them into appropriate files

What is the related Linear task?

Resolves INT-3304

Please explain the objectives of your changes below

Put down any required details on the broader aspect of your changes. If there are any dependent changes, mandatorily mention them here

Any changes to existing capabilities/behaviour, mention the reason & what are the changes ?

N/A

Any new dependencies introduced with this change?

N/A

Any new generic utility introduced or modified. Please explain the changes.

N/A

Any technical or performance related pointers to consider with the change?

N/A

@coderabbitai review


Developer checklist

  • My code follows the style guidelines of this project

  • No breaking changes are being introduced.

  • All related docs linked with the PR?

  • All changes manually tested?

  • Any documentation changes needed with this change?

  • Is the PR limited to 10 file changes?

  • Is the PR limited to one linear task?

  • Are relevant unit and component test-cases added in new readability format?

Reviewer checklist

  • Is the type of change in the PR title appropriate as per the changes?

  • Verified that there are no credentials or confidential data exposed with the changes.

@devops-github-rudderstack
Copy link
Contributor

Allure Test reports for this run are available at:

Copy link

codecov bot commented Feb 18, 2025

Codecov Report

Attention: Patch coverage is 90.62500% with 3 lines in your changes missing coverage. Please review.

Project coverage is 91.16%. Comparing base (ebd305b) to head (78fde45).
Report is 13 commits behind head on develop.

Files with missing lines Patch % Lines
src/v0/destinations/ga4_v2/transform.ts 0.00% 2 Missing ⚠️
...c/v0/destinations/customerio_audience/transform.ts 95.65% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4090      +/-   ##
===========================================
+ Coverage    91.12%   91.16%   +0.03%     
===========================================
  Files          631      632       +1     
  Lines        32944    33112     +168     
  Branches      7807     7838      +31     
===========================================
+ Hits         30021    30186     +165     
- Misses        2673     2708      +35     
+ Partials       250      218      -32     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@devops-github-rudderstack
Copy link
Contributor

Allure Test reports for this run are available at:

koladilip
koladilip previously approved these changes Feb 24, 2025
Config: FixMe;
};

export type Destination<DestinationConfig = FixMe> = {
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we add DestinationConfig type ?

Copy link
Member Author

@utsabc utsabc Feb 24, 2025

Choose a reason for hiding this comment

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

This is dynamic for each specific destination depending on what config is defined in destinationDefinition

Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of FixMe (which is basically any) can we a bit more context sensitive types?

  • unknown
  • Record<string, any> ( for object structures ) etc

Copy link
Collaborator

Choose a reason for hiding this comment

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

At the minimum, we can get the table structure of destConfig. As vinay pointed out, FixMe is the one which I want to avoid

Copy link
Member Author

Choose a reason for hiding this comment

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

addressed

/**
* Router transformation structures
*/
export type RouterTransformationRequestData<
Copy link
Collaborator

Choose a reason for hiding this comment

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

why to define type parameters here ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Can you elaborate?

Copy link
Collaborator

Choose a reason for hiding this comment

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

why to set these parameters
Message = object,
DestinationType = Destination,
ConnectionType = Connection,

Copy link
Member Author

Choose a reason for hiding this comment

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

Cleaned

Comment on lines 70 to 72
export type MessageIdMetadataMap = {
[key: string]: Metadata;
};
Copy link
Contributor

Choose a reason for hiding this comment

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

If there are no know keys and all are optional, we should use this to make it more readable and concise

export type MessageIdMetadataMap = Record<string, Metadata>;

Copy link
Member Author

Choose a reason for hiding this comment

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

Addressed

Comment on lines 121 to 138
export type ProxyV1Request = {
version: string;
type: string;
method: string;
endpoint: string;
userId: string;
headers?: Record<string, unknown>;
params?: Record<string, unknown>;
body?: {
JSON?: Record<string, unknown>;
JSON_ARRAY?: Record<string, unknown>;
XML?: Record<string, unknown>;
FORM?: Record<string, unknown>;
};
files?: Record<string, unknown>;
metadata: ProxyMetdata[];
destinationConfig: Record<string, unknown>;
};
Copy link
Contributor

@vinayteki95 vinayteki95 Feb 25, 2025

Choose a reason for hiding this comment

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

Maybe instead of duplicating the entire type, we can simplify it like this?

export type ProxyV1Request = Omit<ProxyV0Request, "metadata"> & {
  metadata: ProxyMetdata[];
};

This can clearly indicate that the only difference in these 2 times comes from the field metadata

Copy link
Member Author

Choose a reason for hiding this comment

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

Addressed

@devops-github-rudderstack
Copy link
Contributor

Allure Test reports for this run are available at:

@koladilip
Copy link
Contributor

Codecov Report

Attention: Patch coverage is 78.57143% with 6 lines in your changes missing coverage. Please review.

Project coverage is 91.15%. Comparing base (c200518) to head (728e220).
Report is 38 commits behind head on develop.

Files with missing lines Patch % Lines
...c/v0/destinations/customerio_audience/transform.ts 77.77% 4 Missing ⚠️
src/v0/destinations/ga4_v2/transform.ts 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files

☔ View full report in Codecov by Sentry. 📢 Have feedback on the report? Share it here.

fix these

koladilip
koladilip previously approved these changes Feb 26, 2025
@devops-github-rudderstack
Copy link
Contributor

Allure Test reports for this run are available at:

@devops-github-rudderstack
Copy link
Contributor

Allure Test reports for this run are available at:

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.

5 participants