Skip to content

Commit

Permalink
bump backstage to 1.20.x (#367)
Browse files Browse the repository at this point in the history
* bump backstage to 1.20.x and fix type errors

there is still one TODO type error that is needs to be dealt with

* coerce field types

* change file
  • Loading branch information
jbolda authored Dec 5, 2023
1 parent e2aaeef commit b6f76c1
Show file tree
Hide file tree
Showing 33 changed files with 1,923 additions and 1,381 deletions.
22 changes: 22 additions & 0 deletions .changeset/giant-pumpkins-carry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
'@frontside/backstage-plugin-graphql-backend-module-catalog': minor
'@frontside/backstage-plugin-incremental-ingestion-backend': minor
'@frontside/backstage-plugin-scaffolder-workflow': minor
'@frontside/scaffolder-yaml-actions': minor
'@frontside/backstage-ingestion-tests': minor
'@frontside/backstage-plugin-batch-loader': minor
'backend': minor
'app': minor
'@frontside/backstage-plugin-incremental-ingestion-github': patch
'@frontside/backstage-plugin-effection-inspector-backend': patch
'@frontside/backstage-plugin-graphql-backend-node': patch
'@frontside/backstage-plugin-effection-inspector': patch
'@frontside/backstage-plugin-humanitec-backend': patch
'@frontside/backstage-plugin-humanitec-common': patch
'@frontside/backstage-plugin-graphql-backend': patch
'@internal/plugin-healthcheck': patch
'@frontside/graphgen-backstage': patch
'@frontside/backstage-plugin-humanitec': patch
---

Bump Backstage to `1.20.x` along with related dependencies. This includes a bump of Knex to v3. Additionally, this version of Backstage begins to shift scaffolder alpha features into the mainline which affects the types in related packages.
2 changes: 1 addition & 1 deletion backstage.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "1.18.4"
"version": "1.20.3"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
]
},
"devDependencies": {
"@backstage/cli": "^0.22.13",
"@backstage/cli": "^0.24.0",
"@changesets/cli": "^2.22.0",
"@spotify/prettier-config": "^12.0.0",
"concurrently": "^7.5.0",
Expand Down
56 changes: 28 additions & 28 deletions packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,39 @@
},
"bundled": true,
"dependencies": {
"@backstage/app-defaults": "^1.4.3",
"@backstage/catalog-model": "^1.4.2",
"@backstage/cli": "^0.22.13",
"@backstage/core-app-api": "^1.10.0",
"@backstage/core-components": "^0.13.5",
"@backstage/core-plugin-api": "^1.6.0",
"@backstage/integration-react": "^1.1.19",
"@backstage/plugin-api-docs": "^0.9.11",
"@backstage/plugin-catalog": "^1.13.0",
"@backstage/plugin-catalog-graph": "^0.2.36",
"@backstage/plugin-catalog-import": "^0.10.0",
"@backstage/plugin-catalog-react": "^1.8.4",
"@backstage/plugin-catalog-unprocessed-entities": "^0.1.3",
"@backstage/plugin-github-actions": "^0.6.5",
"@backstage/plugin-graphiql": "^0.2.54",
"@backstage/plugin-org": "^0.6.14",
"@backstage/plugin-scaffolder": "^1.15.0",
"@backstage/plugin-scaffolder-react": "^1.5.5",
"@backstage/plugin-search": "^1.4.0",
"@backstage/plugin-search-react": "^1.7.0",
"@backstage/plugin-tech-radar": "^0.6.8",
"@backstage/plugin-techdocs": "^1.7.0",
"@backstage/plugin-techdocs-module-addons-contrib": "^1.1.0",
"@backstage/plugin-techdocs-react": "^1.1.11",
"@backstage/plugin-user-settings": "^0.7.10",
"@backstage/theme": "^0.4.2",
"@backstage/app-defaults": "^1.4.5",
"@backstage/catalog-model": "^1.4.3",
"@backstage/cli": "^0.24.0",
"@backstage/core-app-api": "^1.11.1",
"@backstage/core-components": "^0.13.8",
"@backstage/core-plugin-api": "^1.8.0",
"@backstage/integration-react": "^1.1.21",
"@backstage/plugin-api-docs": "^0.10.1",
"@backstage/plugin-catalog": "^1.15.1",
"@backstage/plugin-catalog-graph": "^0.3.1",
"@backstage/plugin-catalog-import": "^0.10.3",
"@backstage/plugin-catalog-react": "^1.9.1",
"@backstage/plugin-catalog-unprocessed-entities": "^0.1.5",
"@backstage/plugin-github-actions": "^0.6.8",
"@backstage/plugin-graphiql": "^0.3.0",
"@backstage/plugin-org": "^0.6.17",
"@backstage/plugin-scaffolder": "^1.16.1",
"@backstage/plugin-scaffolder-react": "^1.6.1",
"@backstage/plugin-search": "^1.4.3",
"@backstage/plugin-search-react": "^1.7.3",
"@backstage/plugin-tech-radar": "^0.6.10",
"@backstage/plugin-techdocs": "^1.9.1",
"@backstage/plugin-techdocs-module-addons-contrib": "^1.1.2",
"@backstage/plugin-techdocs-react": "^1.1.13",
"@backstage/plugin-user-settings": "^0.7.13",
"@backstage/theme": "^0.4.4",
"@backstage/types": "^1.1.1",
"@frontside/backstage-plugin-effection-inspector": "^0.1.10",
"@frontside/backstage-plugin-humanitec": "^0.3.11",
"@frontside/backstage-plugin-scaffolder-workflow": "^0.8.1",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@rjsf/utils": "^5.8.1",
"@rjsf/utils": "5.13.6",
"assert-ts": "^0.3.4",
"classnames": "^2.3.2",
"history": "^5.0.0",
Expand All @@ -50,7 +50,7 @@
"react-use": "^17.2.4"
},
"devDependencies": {
"@backstage/test-utils": "^1.4.3",
"@backstage/test-utils": "^1.4.5",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^12.1.3",
"@testing-library/user-event": "^14.5.1",
Expand Down
9 changes: 6 additions & 3 deletions packages/app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
catalogImportPlugin,
} from '@backstage/plugin-catalog-import';
import { scaffolderPlugin } from '@backstage/plugin-scaffolder';
import { NextScaffolderPage } from '@backstage/plugin-scaffolder/alpha';
import { ScaffolderPage } from '@backstage/plugin-scaffolder';
import { SearchPage } from '@backstage/plugin-search';
import { TechRadarPage } from '@backstage/plugin-tech-radar';
import {
Expand Down Expand Up @@ -103,7 +103,10 @@ const routes = (
<ReportIssue />
</TechDocsAddons>
</Route>
<Route path="/create" element={<NextScaffolderPage FormProps={{ noHtml5Validate: true }} />} />
<Route
path="/create"
element={<ScaffolderPage formProps={{ noHtml5Validate: true }} />}
/>
<Route path="/api-docs" element={<ApiExplorerPage />} />
<Route
path="/tech-radar"
Expand Down Expand Up @@ -148,5 +151,5 @@ export default app.createRoot(
<AppRouter>
<Root>{routes}</Root>
</AppRouter>
</SecretsContextProvider>
</SecretsContextProvider>,
);
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,18 @@ const useStyles = makeStyles<BackstageTheme>(theme => ({
function OnboardingActions({
stepper,
workflow,
formRef,
whichComponent,
}: {
formRef?: any;
stepper?: Stepper;
workflow: RunWorkflow;
whichComponent: string;
}) {
const errors = formRef?.current?.state?.errors ?? [];
const styles = useStyles();
if (stepper)
if (stepper) {
console.log(whichComponent, errors);
return (
<div className={styles.formFooter}>
<Button
Expand Down Expand Up @@ -94,6 +100,7 @@ function OnboardingActions({
)}
</div>
);
}
return null;
}

Expand Down Expand Up @@ -162,7 +169,9 @@ export function EntityOnboardingWorkflow(
manifest={manifest}
workflow={workflow}
initialState={{ entityRef, catalogInfoUrl }}
formFooter={<OnboardingActions workflow={workflow} />}
formFooter={
<OnboardingActions workflow={workflow} whichComponent="footer" />
}
stepperProgress={<StepperProgress />}
reviewComponent={<EntityOnboardingReview workflow={workflow} />}
>
Expand Down Expand Up @@ -192,7 +201,11 @@ function EntityOnboardingReview({
return (
<div className={styles.formWrapper}>
<ReviewState schemas={stepper.steps} formState={stepper.formState} />
<OnboardingActions workflow={workflow} stepper={stepper} />
<OnboardingActions
workflow={workflow}
stepper={stepper}
whichComponent="review"
/>
</div>
);
}
Expand Down
12 changes: 5 additions & 7 deletions packages/app/src/extensions/AsyncFieldExtension.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import React from 'react';
import { FormControl, InputLabel, Input, makeStyles } from '@material-ui/core';
import { FieldValidation } from '@rjsf/utils';
import {
NextFieldExtensionOptions,
NextFieldExtensionComponentProps,
} from '@backstage/plugin-scaffolder-react/alpha';
FieldExtensionOptions,
FieldExtensionComponentProps,
} from '@backstage/plugin-scaffolder-react';
import { MarkdownContent } from '@backstage/core-components';

const useStyles = makeStyles(theme => ({
Expand All @@ -19,9 +19,7 @@ const useStyles = makeStyles(theme => ({
},
}));

const CharacterField = (
props: NextFieldExtensionComponentProps<string, any>,
) => {
const CharacterField = (props: FieldExtensionComponentProps<string, any>) => {
const {
displayLabel = true,
rawErrors = [],
Expand Down Expand Up @@ -78,7 +76,7 @@ export const validateAsync = async (
}
};

export const characterTextField: NextFieldExtensionOptions<string, any> = {
export const characterTextField: FieldExtensionOptions<string, any> = {
name: 'CharacterText',
component: CharacterField,
validation: validateAsync,
Expand Down
4 changes: 2 additions & 2 deletions packages/app/src/extensions/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { characterTextField } from './AsyncFieldExtension';
import { scaffolderPlugin } from '@backstage/plugin-scaffolder';
import { createNextScaffolderFieldExtension } from '@backstage/plugin-scaffolder-react/alpha';
import { createScaffolderFieldExtension } from '@backstage/plugin-scaffolder-react';

export const configuredFieldExtensions = [characterTextField].map(extension =>
scaffolderPlugin.provide(createNextScaffolderFieldExtension(extension)),
scaffolderPlugin.provide(createScaffolderFieldExtension(extension)),
);
49 changes: 24 additions & 25 deletions packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,29 @@
"migrate:create": "knex migrate:make -x ts"
},
"dependencies": {
"@backstage/backend-common": "^0.19.7",
"@backstage/backend-tasks": "^0.5.10",
"@backstage/catalog-client": "^1.4.4",
"@backstage/catalog-model": "^1.4.2",
"@backstage/config": "^1.1.0",
"@backstage/errors": "^1.2.2",
"@backstage/integration": "^1.7.0",
"@backstage/plugin-app-backend": "^0.3.53",
"@backstage/plugin-auth-backend": "^0.19.2",
"@backstage/plugin-auth-node": "^0.3.2",
"@backstage/plugin-catalog-backend": "^1.13.3",
"@backstage/plugin-catalog-backend-module-github": "^0.4.3",
"@backstage/plugin-catalog-backend-module-unprocessed": "^0.3.2",
"@backstage/plugin-catalog-graph": "^0.2.36",
"@backstage/plugin-permission-common": "^0.7.8",
"@backstage/plugin-permission-node": "^0.7.16",
"@backstage/plugin-proxy-backend": "^0.4.2",
"@backstage/plugin-scaffolder-backend": "^1.17.3",
"@backstage/plugin-scaffolder-node": "^0.2.5",
"@backstage/plugin-search-backend": "^1.4.5",
"@backstage/plugin-search-backend-module-pg": "^0.5.14",
"@backstage/plugin-search-backend-node": "^1.2.9",
"@backstage/plugin-techdocs-backend": "^1.7.2",
"@backstage/backend-common": "^0.19.9",
"@backstage/backend-tasks": "^0.5.12",
"@backstage/catalog-client": "^1.4.6",
"@backstage/catalog-model": "^1.4.3",
"@backstage/config": "^1.1.1",
"@backstage/errors": "^1.2.3",
"@backstage/integration": "^1.7.2",
"@backstage/plugin-app-backend": "^0.3.55",
"@backstage/plugin-auth-backend": "^0.20.0",
"@backstage/plugin-auth-node": "^0.4.1",
"@backstage/plugin-catalog-backend": "^1.15.0",
"@backstage/plugin-catalog-backend-module-github": "^0.4.5",
"@backstage/plugin-catalog-backend-module-unprocessed": "^0.3.4",
"@backstage/plugin-catalog-graph": "^0.3.1",
"@backstage/plugin-permission-common": "^0.7.10",
"@backstage/plugin-permission-node": "^0.7.18",
"@backstage/plugin-proxy-backend": "^0.4.5",
"@backstage/plugin-scaffolder-backend": "^1.19.1",
"@backstage/plugin-scaffolder-node": "^0.2.8",
"@backstage/plugin-search-backend": "^1.4.7",
"@backstage/plugin-search-backend-module-pg": "^0.5.16",
"@backstage/plugin-search-backend-node": "^1.2.11",
"@backstage/plugin-techdocs-backend": "^1.9.0",
"@frontside/backstage-plugin-batch-loader": "0.3.6",
"@frontside/backstage-plugin-effection-inspector-backend": "0.1.10",
"@frontside/backstage-plugin-graphql-backend": "^0.1.3",
Expand All @@ -62,7 +62,6 @@
"git-url-parse": "^13.1.0",
"graphql-modules": "^2.1.0",
"js-yaml": "^4.1.0",
"knex": "^2.0.0",
"luxon": "^2.3.1",
"octokit": "^2.0.9",
"pg": "^8.3.0",
Expand All @@ -72,7 +71,7 @@
"zod": "^3.21.4"
},
"devDependencies": {
"@backstage/cli": "^0.22.13",
"@backstage/cli": "^0.24.0",
"@octokit/types": "^6.34.0",
"@types/dockerode": "^3.3.0",
"@types/express": "^4.17.6",
Expand Down
Loading

0 comments on commit b6f76c1

Please sign in to comment.