diff --git a/.changeset/popular-starfishes-reflect.md b/.changeset/popular-starfishes-reflect.md new file mode 100644 index 0000000000..e02eaf7102 --- /dev/null +++ b/.changeset/popular-starfishes-reflect.md @@ -0,0 +1,10 @@ +--- +'@backstage/backend-common': patch +'@backstage/integration': patch +'@backstage/plugin-catalog-import': patch +'@backstage/plugin-git-release-manager': patch +'@backstage/plugin-github-actions': patch +'@backstage/plugin-github-pull-requests-board': patch +--- + +Upgrade @octokit/rest to 19.0.3 diff --git a/package.json b/package.json index b1230c81d4..5e76d863eb 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ }, "devDependencies": { "@changesets/cli": "^2.14.0", - "@octokit/rest": "^18.12.0", + "@octokit/rest": "^19.0.3", "@spotify/prettier-config": "^13.0.0", "@types/node": "^16.11.26", "@types/webpack": "^5.28.0", diff --git a/packages/app/package.json b/packages/app/package.json index 5e4cf307ec..08833ca1a3 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -65,7 +65,7 @@ "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.57", - "@octokit/rest": "^18.5.3", + "@octokit/rest": "^19.0.3", "@roadiehq/backstage-plugin-buildkite": "^2.0.0", "@roadiehq/backstage-plugin-github-insights": "^2.0.0", "@roadiehq/backstage-plugin-github-pull-requests": "^2.0.0", diff --git a/packages/backend-common/package.json b/packages/backend-common/package.json index 6846153476..cb2f653277 100644 --- a/packages/backend-common/package.json +++ b/packages/backend-common/package.json @@ -42,7 +42,7 @@ "@backstage/types": "^1.0.0", "@google-cloud/storage": "^6.0.0", "@manypkg/get-packages": "^1.1.3", - "@octokit/rest": "^18.5.3", + "@octokit/rest": "^19.0.3", "@types/cors": "^2.8.6", "@types/dockerode": "^3.3.0", "@types/express": "^4.17.6", diff --git a/packages/backend/package.json b/packages/backend/package.json index e98c5d064f..67070bfeee 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -60,7 +60,7 @@ "@backstage/plugin-tech-insights-backend-module-jsonfc": "^0.1.18-next.2", "@backstage/plugin-todo-backend": "^0.1.31-next.2", "@gitbeaker/node": "^35.1.0", - "@octokit/rest": "^18.5.3", + "@octokit/rest": "^19.0.3", "better-sqlite3": "^7.5.0", "azure-devops-node-api": "^11.0.1", "dockerode": "^3.3.1", diff --git a/packages/integration/package.json b/packages/integration/package.json index 7f055d2051..68b6ba369c 100644 --- a/packages/integration/package.json +++ b/packages/integration/package.json @@ -37,7 +37,7 @@ "@backstage/errors": "^1.1.0-next.0", "cross-fetch": "^3.1.5", "git-url-parse": "^12.0.0", - "@octokit/rest": "^18.5.3", + "@octokit/rest": "^19.0.3", "@octokit/auth-app": "^4.0.0", "luxon": "^3.0.0", "lodash": "^4.17.21" diff --git a/packages/integration/src/github/SingleInstanceGithubCredentialsProvider.ts b/packages/integration/src/github/SingleInstanceGithubCredentialsProvider.ts index bfc360cbe2..e56c1521dd 100644 --- a/packages/integration/src/github/SingleInstanceGithubCredentialsProvider.ts +++ b/packages/integration/src/github/SingleInstanceGithubCredentialsProvider.ts @@ -119,7 +119,7 @@ class GithubAppManager { const repos = await installationClient.paginate( installationClient.apps.listReposAccessibleToInstallation, ); - const hasRepo = repos.some(repository => { + const hasRepo = repos.repositories.some(repository => { return repository.name === repo; }); if (!hasRepo) { diff --git a/plugins/catalog-import/package.json b/plugins/catalog-import/package.json index 0903c79bf5..65a3c89bd5 100644 --- a/plugins/catalog-import/package.json +++ b/plugins/catalog-import/package.json @@ -46,7 +46,7 @@ "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.57", - "@octokit/rest": "^18.5.3", + "@octokit/rest": "^19.0.3", "git-url-parse": "^12.0.0", "js-base64": "^3.6.0", "lodash": "^4.17.21", diff --git a/plugins/git-release-manager/package.json b/plugins/git-release-manager/package.json index 6946d39e62..27bf139560 100644 --- a/plugins/git-release-manager/package.json +++ b/plugins/git-release-manager/package.json @@ -31,7 +31,7 @@ "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.57", - "@octokit/rest": "^18.5.3", + "@octokit/rest": "^19.0.3", "luxon": "^3.0.0", "qs": "^6.10.1", "react-router": "6.0.0-beta.0", diff --git a/plugins/github-actions/api-report.md b/plugins/github-actions/api-report.md index 08761bad56..4e5c7f30e9 100644 --- a/plugins/github-actions/api-report.md +++ b/plugins/github-actions/api-report.md @@ -214,14 +214,14 @@ export { isGithubActionsAvailable as isPluginApplicableToEntity }; // // @public (undocumented) export type Job = { - html_url: string; + html_url?: string; status: string; - conclusion: string; + conclusion?: string; started_at: string; - completed_at: string; + completed_at?: string; id: number; name: string; - steps: Step[]; + steps?: Step[]; }; // Warning: (ae-missing-release-tag) "Jobs" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) @@ -272,7 +272,7 @@ export type Step = { status: string; conclusion?: string; number: number; - started_at: string; - completed_at: string; + started_at?: string; + completed_at?: string; }; ``` diff --git a/plugins/github-actions/package.json b/plugins/github-actions/package.json index a2bd7dd1db..3e0b6f5055 100644 --- a/plugins/github-actions/package.json +++ b/plugins/github-actions/package.json @@ -45,7 +45,7 @@ "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.57", - "@octokit/rest": "^18.5.3", + "@octokit/rest": "^19.0.3", "luxon": "^3.0.0", "react-router": "6.0.0-beta.0", "react-router-dom": "6.0.0-beta.0", diff --git a/plugins/github-actions/src/__fixtures__/get-workflow-run.json b/plugins/github-actions/src/__fixtures__/get-workflow-run.json index 5527b356f1..38c3513b15 100644 --- a/plugins/github-actions/src/__fixtures__/get-workflow-run.json +++ b/plugins/github-actions/src/__fixtures__/get-workflow-run.json @@ -4,8 +4,9 @@ "node_id": "MDEyOldvcmtmbG93IFJ1bjI2OTI4OQ==", "check_suite_id": 42, "check_suite_node_id": "MDEwOkNoZWNrU3VpdGU0Mg==", - "head_branch": "master", + "head_branch": "main", "head_sha": "acb5820ced9479c074f688cc328bf03f341a511d", + "path": ".github/workflows/build.yml@main", "run_number": 562, "event": "push", "status": "queued", @@ -16,12 +17,71 @@ "pull_requests": [], "created_at": "2020-01-22T19:33:08Z", "updated_at": "2020-01-22T19:33:08Z", + "actor": { + "login": "octocat", + "id": 1, + "node_id": "MDQ6VXNlcjE=", + "avatar_url": "https://github.com/images/error/octocat_happy.gif", + "gravatar_id": "", + "url": "https://api.github.com/users/octocat", + "html_url": "https://github.com/octocat", + "followers_url": "https://api.github.com/users/octocat/followers", + "following_url": "https://api.github.com/users/octocat/following{/other_user}", + "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", + "organizations_url": "https://api.github.com/users/octocat/orgs", + "repos_url": "https://api.github.com/users/octocat/repos", + "events_url": "https://api.github.com/users/octocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/octocat/received_events", + "type": "User", + "site_admin": false + }, + "run_attempt": 1, + "referenced_workflows": [ + { + "path": "octocat/Hello-World/.github/workflows/deploy.yml@main", + "sha": "86e8bc9ecf7d38b1ed2d2cfb8eb87ba9b35b01db", + "ref": "refs/heads/main" + }, + { + "path": "octo-org/octo-repo/.github/workflows/report.yml@v2", + "sha": "79e9790903e1c3373b1a3e3a941d57405478a232", + "ref": "refs/tags/v2" + }, + { + "path": "octo-org/octo-repo/.github/workflows/secure.yml@1595d4b6de6a9e9751fb270a41019ce507d4099e", + "sha": "1595d4b6de6a9e9751fb270a41019ce507d4099e" + } + ], + "run_started_at": "2020-01-22T19:33:08Z", + "triggering_actor": { + "login": "octocat", + "id": 1, + "node_id": "MDQ6VXNlcjE=", + "avatar_url": "https://github.com/images/error/octocat_happy.gif", + "gravatar_id": "", + "url": "https://api.github.com/users/octocat", + "html_url": "https://github.com/octocat", + "followers_url": "https://api.github.com/users/octocat/followers", + "following_url": "https://api.github.com/users/octocat/following{/other_user}", + "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", + "organizations_url": "https://api.github.com/users/octocat/orgs", + "repos_url": "https://api.github.com/users/octocat/repos", + "events_url": "https://api.github.com/users/octocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/octocat/received_events", + "type": "User", + "site_admin": false + }, "jobs_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/jobs", "logs_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/logs", "check_suite_url": "https://api.github.com/repos/octo-org/octo-repo/check-suites/414944374", "artifacts_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/artifacts", "cancel_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/cancel", "rerun_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/rerun", + "previous_attempt_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/attempts/1", "workflow_url": "https://api.github.com/repos/octo-org/octo-repo/actions/workflows/159038", "head_commit": { "id": "acb5820ced9479c074f688cc328bf03f341a511d", diff --git a/plugins/github-actions/src/api/types.ts b/plugins/github-actions/src/api/types.ts index c405dc9373..db926d9c03 100644 --- a/plugins/github-actions/src/api/types.ts +++ b/plugins/github-actions/src/api/types.ts @@ -19,19 +19,19 @@ export type Step = { status: string; conclusion?: string; number: number; // starts from 1 - started_at: string; - completed_at: string; + started_at?: string; + completed_at?: string; }; export type Job = { - html_url: string; + html_url?: string; status: string; - conclusion: string; + conclusion?: string; started_at: string; - completed_at: string; + completed_at?: string; id: number; name: string; - steps: Step[]; + steps?: Step[]; }; export type Jobs = { diff --git a/plugins/github-actions/src/components/Cards/RecentWorkflowRunsCard.tsx b/plugins/github-actions/src/components/Cards/RecentWorkflowRunsCard.tsx index 4e37a2b19b..3eba4981e7 100644 --- a/plugins/github-actions/src/components/Cards/RecentWorkflowRunsCard.tsx +++ b/plugins/github-actions/src/components/Cards/RecentWorkflowRunsCard.tsx @@ -18,7 +18,7 @@ import { useEntity } from '@backstage/plugin-catalog-react'; import React, { useEffect } from 'react'; import { generatePath, Link as RouterLink } from 'react-router-dom'; import { GITHUB_ACTIONS_ANNOTATION } from '../getProjectNameFromEntity'; -import { useWorkflowRuns } from '../useWorkflowRuns'; +import { useWorkflowRuns, WorkflowRun } from '../useWorkflowRuns'; import { WorkflowRunStatus } from '../WorkflowRunStatus'; import { Typography } from '@material-ui/core'; @@ -90,7 +90,7 @@ export const RecentWorkflowRunsCard = ({ ) : ( -