diff --git a/dashboard/package-lock.json b/dashboard/package-lock.json index d6848b0c5d..bca1197242 100644 --- a/dashboard/package-lock.json +++ b/dashboard/package-lock.json @@ -13,7 +13,7 @@ "@loadable/component": "^5.15.2", "@material-ui/core": "^4.11.3", "@material-ui/lab": "^4.0.0-alpha.61", - "@porter-dev/api-contracts": "^0.2.6", + "@porter-dev/api-contracts": "^0.2.8", "@react-spring/web": "^9.6.1", "@sentry/react": "^6.13.2", "@sentry/tracing": "^6.13.2", @@ -2455,9 +2455,9 @@ } }, "node_modules/@porter-dev/api-contracts": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/@porter-dev/api-contracts/-/api-contracts-0.2.6.tgz", - "integrity": "sha512-IxwcsqQOZs8EfP3K9wzTArhR5y2vZUBEh6YRiXZD/73ORObN4bWI3eRQz39J0TQt5p/D00J8Dqo01nN9QY8rcA==", + "version": "0.2.8", + "resolved": "https://registry.npmjs.org/@porter-dev/api-contracts/-/api-contracts-0.2.8.tgz", + "integrity": "sha512-2eNrLhccKhKWBSYoC31MdfxQKF7XY9nxukA7PRr7k0Zh0LquNMTxDDmT4/a9q4IyLgFe31FzJa+ApdYgW8dAWw==", "dependencies": { "@bufbuild/protobuf": "^1.1.0" } @@ -16956,9 +16956,9 @@ "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==" }, "@porter-dev/api-contracts": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/@porter-dev/api-contracts/-/api-contracts-0.2.6.tgz", - "integrity": "sha512-IxwcsqQOZs8EfP3K9wzTArhR5y2vZUBEh6YRiXZD/73ORObN4bWI3eRQz39J0TQt5p/D00J8Dqo01nN9QY8rcA==", + "version": "0.2.8", + "resolved": "https://registry.npmjs.org/@porter-dev/api-contracts/-/api-contracts-0.2.8.tgz", + "integrity": "sha512-2eNrLhccKhKWBSYoC31MdfxQKF7XY9nxukA7PRr7k0Zh0LquNMTxDDmT4/a9q4IyLgFe31FzJa+ApdYgW8dAWw==", "requires": { "@bufbuild/protobuf": "^1.1.0" } diff --git a/dashboard/package.json b/dashboard/package.json index 625621bbdc..620bfdb193 100644 --- a/dashboard/package.json +++ b/dashboard/package.json @@ -8,7 +8,7 @@ "@loadable/component": "^5.15.2", "@material-ui/core": "^4.11.3", "@material-ui/lab": "^4.0.0-alpha.61", - "@porter-dev/api-contracts": "^0.2.6", + "@porter-dev/api-contracts": "^0.2.8", "@react-spring/web": "^9.6.1", "@sentry/react": "^6.13.2", "@sentry/tracing": "^6.13.2", diff --git a/dashboard/src/lib/hooks/useAppValidation.ts b/dashboard/src/lib/hooks/useAppValidation.ts index d7213c50ec..c16dc92265 100644 --- a/dashboard/src/lib/hooks/useAppValidation.ts +++ b/dashboard/src/lib/hooks/useAppValidation.ts @@ -148,7 +148,9 @@ export const useAppValidation = ({ .parseAsync(res.data); const validatedAppProto = PorterApp.fromJsonString( - atob(validAppData.validate_b64_app_proto) + atob(validAppData.validate_b64_app_proto), { + ignoreUnknownFields: true, + } ); return { validatedAppProto: validatedAppProto, variables, secrets }; diff --git a/dashboard/src/lib/hooks/usePorterYaml.ts b/dashboard/src/lib/hooks/usePorterYaml.ts index 70034d4f79..19f89bb972 100644 --- a/dashboard/src/lib/hooks/usePorterYaml.ts +++ b/dashboard/src/lib/hooks/usePorterYaml.ts @@ -125,7 +125,9 @@ export const usePorterYaml = ({ .optional(), }) .parseAsync(res.data); - const proto = PorterApp.fromJsonString(atob(data.b64_app_proto)); + const proto = PorterApp.fromJsonString(atob(data.b64_app_proto), { + ignoreUnknownFields: true, + }); const { services, predeploy, build } = serviceOverrides({ overrides: proto, @@ -142,7 +144,10 @@ export const usePorterYaml = ({ if (data.preview_app) { const previewProto = PorterApp.fromJsonString( - atob(data.preview_app.b64_app_proto) + atob(data.preview_app.b64_app_proto), + { + ignoreUnknownFields: true, + } ); const { services: previewServices, diff --git a/dashboard/src/main/home/app-dashboard/app-view/AppDataContainer.tsx b/dashboard/src/main/home/app-dashboard/app-view/AppDataContainer.tsx index 821471d441..85ccc3a427 100644 --- a/dashboard/src/main/home/app-dashboard/app-view/AppDataContainer.tsx +++ b/dashboard/src/main/home/app-dashboard/app-view/AppDataContainer.tsx @@ -278,7 +278,9 @@ const AppDataContainer: React.FC = ({ tabParam }) => { reset({ app: clientAppFromProto({ proto: previewRevision - ? PorterApp.fromJsonString(atob(previewRevision.b64_app_proto)) + ? PorterApp.fromJsonString(atob(previewRevision.b64_app_proto), { + ignoreUnknownFields: true, + }) : latestProto, overrides: servicesFromYaml, variables: appEnv?.variables, @@ -303,7 +305,9 @@ const AppDataContainer: React.FC = ({ tabParam }) => { reset({ app: clientAppFromProto({ proto: previewRevision - ? PorterApp.fromJsonString(atob(previewRevision.b64_app_proto)) + ? PorterApp.fromJsonString(atob(previewRevision.b64_app_proto), { + ignoreUnknownFields: true, + }) : latestProto, overrides: servicesFromYaml, variables: appEnv?.variables, diff --git a/dashboard/src/main/home/app-dashboard/app-view/LatestRevisionContext.tsx b/dashboard/src/main/home/app-dashboard/app-view/LatestRevisionContext.tsx index fb60dbcd46..184929504b 100644 --- a/dashboard/src/main/home/app-dashboard/app-view/LatestRevisionContext.tsx +++ b/dashboard/src/main/home/app-dashboard/app-view/LatestRevisionContext.tsx @@ -213,7 +213,9 @@ export const LatestRevisionProvider = ({ return; } - return PorterApp.fromJsonString(atob(latestRevision.b64_app_proto)); + return PorterApp.fromJsonString(atob(latestRevision.b64_app_proto), { + ignoreUnknownFields: true, + }); }, [latestRevision]); if ( diff --git a/dashboard/src/main/home/app-dashboard/apps/AppGrid.tsx b/dashboard/src/main/home/app-dashboard/apps/AppGrid.tsx index 25d813d70b..eb849732cf 100644 --- a/dashboard/src/main/home/app-dashboard/apps/AppGrid.tsx +++ b/dashboard/src/main/home/app-dashboard/apps/AppGrid.tsx @@ -45,7 +45,12 @@ const AppGrid: React.FC = ({ apps, searchValue, view, sort }) => { ...app, app_revision: { ...app.app_revision, - proto: PorterApp.fromJsonString(atob(app.app_revision.b64_app_proto)), + proto: PorterApp.fromJsonString( + atob(app.app_revision.b64_app_proto), + { + ignoreUnknownFields: true, + } + ), }, }; }); diff --git a/dashboard/src/main/home/app-dashboard/validate-apply/revisions-list/RevisionTableContents.tsx b/dashboard/src/main/home/app-dashboard/validate-apply/revisions-list/RevisionTableContents.tsx index ea1d78709b..e56e727cfa 100644 --- a/dashboard/src/main/home/app-dashboard/validate-apply/revisions-list/RevisionTableContents.tsx +++ b/dashboard/src/main/home/app-dashboard/validate-apply/revisions-list/RevisionTableContents.tsx @@ -39,7 +39,9 @@ const RevisionTableContents: React.FC = ({ const revisionsWithProto = revisions.map((revision) => { return { ...revision, - app_proto: PorterApp.fromJsonString(atob(revision.b64_app_proto)), + app_proto: PorterApp.fromJsonString(atob(revision.b64_app_proto), { + ignoreUnknownFields: true, + }), }; }); diff --git a/dashboard/src/main/home/app-dashboard/validate-apply/revisions-list/RevisionsList.tsx b/dashboard/src/main/home/app-dashboard/validate-apply/revisions-list/RevisionsList.tsx index bf084f3eba..cb11d1e364 100644 --- a/dashboard/src/main/home/app-dashboard/validate-apply/revisions-list/RevisionsList.tsx +++ b/dashboard/src/main/home/app-dashboard/validate-apply/revisions-list/RevisionsList.tsx @@ -105,7 +105,9 @@ const RevisionsList: React.FC = ({ setValue( "app", clientAppFromProto({ - proto: PorterApp.fromJsonString(atob(app_revision.b64_app_proto)), + proto: PorterApp.fromJsonString(atob(app_revision.b64_app_proto), { + ignoreUnknownFields: true, + }), overrides: servicesFromYaml, variables: app_revision.env.variables, secrets: app_revision.env.secret_variables,