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

Fix type for grpcWeb.Error to grpcweb.RpcError #5072

Merged
merged 1 commit into from
Jul 25, 2024

Conversation

ffjlabo
Copy link
Member

@ffjlabo ffjlabo commented Jul 25, 2024

What this PR does / why we need it:

I found the type some errors. This is for type grpcWeb.RpcError.

From grpc-web 1.3.0, grpcWeb.Error has changed to grpcWeb.RpcError.
https://github.com/grpc/grpc-web/releases/tag/1.3.0

Major Features
#1139 Improve error type with RpcError & internal code sync (contributor: @TomiBelan)
(experimental) Typescript users need to update type references from Error -> RpcError

I checked the type error for grpcWeb.Error disappeared.

Before

% npm run typecheck                                                                   (git)-[fix-type-for-grpcWeb-error]

> pipecd-web@1.0.0 typecheck
> tsc --noEmit

src/__fixtures__/dummy-application-live-state.ts:60:14 - error TS2741: Property 'ecs' is missing in type '{ applicationId: string; healthStatus: ApplicationLiveStateSnapshot.Status.HEALTHY; kind: ApplicationKind.KUBERNETES; pipedId: string; version: { index: number; timestamp: number; }; ... 4 more ...; kubernetes: { ...; }; }' but required in type 'Required<AsObject>'.

60 export const dummyApplicationLiveState: ApplicationLiveState = {
                ~~~~~~~~~~~~~~~~~~~~~~~~~

  model/application_live_state_pb.d.ts:72:5
    72     ecs?: ECSApplicationLiveState.AsObject,
           ~~~
    'ecs' is declared here.

src/api/client.ts:10:17 - error TS2694: Namespace '"grpc-web"' has no exported member 'Error'.

10   (err: grpcWeb.Error, response: { toObject: () => Res }): void;
                   ~~~~~


Found 2 errors.

After

% npm run typecheck                                                                   (git)-[fix-type-for-grpcWeb-error]

> pipecd-web@1.0.0 typecheck
> tsc --noEmit

src/__fixtures__/dummy-application-live-state.ts:60:14 - error TS2741: Property 'ecs' is missing in type '{ applicationId: string; healthStatus: ApplicationLiveStateSnapshot.Status.HEALTHY; kind: ApplicationKind.KUBERNETES; pipedId: string; version: { index: number; timestamp: number; }; ... 4 more ...; kubernetes: { ...; }; }' but required in type 'Required<AsObject>'.

60 export const dummyApplicationLiveState: ApplicationLiveState = {
                ~~~~~~~~~~~~~~~~~~~~~~~~~

  model/application_live_state_pb.d.ts:72:5
    72     ecs?: ECSApplicationLiveState.AsObject,
           ~~~
    'ecs' is declared here.


Found 1 error.

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?:

  • How are users affected by this change:
  • Is this breaking change:
  • How to migrate (if breaking change):

Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>
Copy link
Member

@khanhtc1202 khanhtc1202 left a comment

Choose a reason for hiding this comment

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

👍

Copy link

codecov bot commented Jul 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 22.79%. Comparing base (b0e40d5) to head (4dbd150).
Report is 105 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5072   +/-   ##
=======================================
  Coverage   22.79%   22.79%           
=======================================
  Files         410      410           
  Lines       43382    43382           
=======================================
  Hits         9891     9891           
  Misses      32712    32712           
  Partials      779      779           

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

@ffjlabo ffjlabo merged commit 8a39eca into master Jul 25, 2024
16 of 18 checks passed
@ffjlabo ffjlabo deleted the fix-type-for-grpcWeb-error branch July 25, 2024 08:59
@TomiBelan
Copy link

Sorry about that, lol.

github-actions bot pushed a commit that referenced this pull request Jul 26, 2024
Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>
github-actions bot pushed a commit that referenced this pull request Jul 26, 2024
Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>
Signed-off-by: pipecd-bot <pipecd.dev@gmail.com>
This was referenced Jul 26, 2024
ffjlabo added a commit that referenced this pull request Jul 29, 2024
Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>
t-kikuc added a commit that referenced this pull request Jul 29, 2024
)

* fix: upgrade dotenv from 8.2.0 to 8.6.0 (#5037)

Snyk has created this PR to upgrade dotenv from 8.2.0 to 8.6.0.

See this package in yarn:
dotenv

See this project in Snyk:
https://app.snyk.io/org/pipecd/project/f41c5767-b506-4f59-beb9-ef662258eb9a?utm_source=github&utm_medium=referral&page=upgrade-pr

Signed-off-by: t-kikuc <tkikuchi07f@gmail.com>
Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>

* fix: upgrade @types/yup from 0.29.11 to 0.29.14 (#5038)

Snyk has created this PR to upgrade @types/yup from 0.29.11 to 0.29.14.

See this package in yarn:
@types/yup

See this project in Snyk:
https://app.snyk.io/org/pipecd/project/f41c5767-b506-4f59-beb9-ef662258eb9a?utm_source=github&utm_medium=referral&page=upgrade-pr

Signed-off-by: t-kikuc <tkikuchi07f@gmail.com>
Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>

* fix: upgrade react-draggable from 4.4.3 to 4.4.6 (#5039)

Snyk has created this PR to upgrade react-draggable from 4.4.3 to 4.4.6.

See this package in yarn:
react-draggable

See this project in Snyk:
https://app.snyk.io/org/pipecd/project/f41c5767-b506-4f59-beb9-ef662258eb9a?utm_source=github&utm_medium=referral&page=upgrade-pr

Signed-off-by: t-kikuc <tkikuchi07f@gmail.com>
Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>

* fix: upgrade clsx from 1.1.1 to 1.2.1 (#5040)

Snyk has created this PR to upgrade clsx from 1.1.1 to 1.2.1.

See this package in yarn:
clsx

See this project in Snyk:
https://app.snyk.io/org/pipecd/project/f41c5767-b506-4f59-beb9-ef662258eb9a?utm_source=github&utm_medium=referral&page=upgrade-pr

Signed-off-by: t-kikuc <tkikuchi07f@gmail.com>
Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>

* add EphemeralStorage to RegisterTaskDefinition() (#5063)

Signed-off-by: t-kikuc <tkikuchi07f@gmail.com>
Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>

* Remove platform provider migration ops task (#5065)

Signed-off-by: khanhtc1202 <khanhtc1202@gmail.com>
Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>

* Remove unused dependencies: @date-io/dayjs, @material-ui/pickers (#5070)

* yarn remove @date-io/dayjs

Signed-off-by: t-kikuc <tkikuchi07f@gmail.com>

* yarn remove @material-ui/pickers

Signed-off-by: t-kikuc <tkikuchi07f@gmail.com>

---------

Signed-off-by: t-kikuc <tkikuchi07f@gmail.com>
Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>

* Fix type for grpcWeb.Error to grpcweb.RpcError (#5072)

Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>

* Release/init v0.48.3 (#5090)

Signed-off-by: t-kikuc <tkikuchi07f@gmail.com>
Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>

---------

Signed-off-by: t-kikuc <tkikuchi07f@gmail.com>
Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>
Signed-off-by: khanhtc1202 <khanhtc1202@gmail.com>
Co-authored-by: Khanh Tran <32532742+khanhtc1202@users.noreply.github.com>
Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Co-authored-by: Tetsuya Kikuchi <97105818+t-kikuc@users.noreply.github.com>
This was referenced Aug 13, 2024
@github-actions github-actions bot mentioned this pull request Aug 26, 2024
@github-actions github-actions bot mentioned this pull request Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants