lyft / clutch

Extensible platform for infrastructure management
https://clutch.sh
Apache License 2.0
1.7k stars 119 forks source link

resolver: front-end resolution of non-core objects #650

Open danielhochman opened 4 years ago

danielhochman commented 4 years ago

Description

The front-end resolver component resolves the returned objects from the resolve/search call to the protobuf.js object.

However, this currently only resolves objects from the core package @clutch-sh/api. If we have a custom package e.g. my-custom-api-package that we build in a custom gateway, the .fromObject call will fail as the object is not in the core package.

This results in the error: 'Cannot read property 'fromObject' of undefined'., which comes from

import * as $pbclutch from "@clutch-sh/api";

and then

https://github.com/lyft/clutch/blob/5ce6456b376edce0517acf4b8a0a5049512d4ed9/frontend/packages/core/src/Resolver/fetch.tsx#L63

We need to have some way to configure the resolver to also attempt fromObject for other packages.

Slack thread with original report: https://lyftoss.slack.com/archives/C015UJ6LED9/p1604147269019800

Complexity [S/M/L]: S

dschaller commented 4 years ago

Pulling this into this weeks sprint for investigation and resolution.

dschaller commented 3 years ago

Just an update on this - we landed support for dynamic API resolution in #753 but we would eventually like to have this be configuration driven based on the workflow.