From 71ce2d1c62d3440de19e86a94242576cd6f37f1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 19 Aug 2022 13:16:21 +0200 Subject: [PATCH] cloudbuild MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- plugins/cloudbuild/api-report.md | 52 ------------------- plugins/cloudbuild/src/api/CloudbuildApi.ts | 1 + plugins/cloudbuild/src/api/types.ts | 16 ++++++ .../cloudbuild/src/components/Cards/Cards.tsx | 3 ++ .../cloudbuild/src/components/Cards/index.ts | 1 + plugins/cloudbuild/src/components/Router.tsx | 2 + .../src/components/useProjectName.ts | 1 + plugins/cloudbuild/src/plugin.ts | 4 ++ plugins/firehydrant/api-report.md | 4 -- plugins/firehydrant/src/plugin.ts | 2 + scripts/api-extractor.ts | 2 - 11 files changed, 30 insertions(+), 58 deletions(-) diff --git a/plugins/cloudbuild/api-report.md b/plugins/cloudbuild/api-report.md index 34b50b54d8..deacf96acd 100644 --- a/plugins/cloudbuild/api-report.md +++ b/plugins/cloudbuild/api-report.md @@ -11,8 +11,6 @@ import { Entity } from '@backstage/catalog-model'; import { OAuthApi } from '@backstage/core-plugin-api'; import { RouteRef } from '@backstage/core-plugin-api'; -// Warning: (ae-missing-release-tag) "ActionsGetWorkflowResponseData" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type ActionsGetWorkflowResponseData = { id: string; @@ -37,16 +35,12 @@ export type ActionsGetWorkflowResponseData = { timing: Timing2; }; -// Warning: (ae-missing-release-tag) "ActionsListWorkflowRunsForRepoResponseData" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface ActionsListWorkflowRunsForRepoResponseData { // (undocumented) builds: ActionsGetWorkflowResponseData[]; } -// Warning: (ae-missing-release-tag) "BUILD" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface BUILD { // (undocumented) @@ -55,8 +49,6 @@ export interface BUILD { startTime: string; } -// Warning: (ae-missing-release-tag) "CLOUDBUILD_ANNOTATION" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const CLOUDBUILD_ANNOTATION = 'google.com/cloudbuild-project-slug'; @@ -79,8 +71,6 @@ export type CloudbuildApi = { }) => Promise; }; -// Warning: (ae-missing-release-tag) "cloudbuildApiRef" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const cloudbuildApiRef: ApiRef; @@ -107,8 +97,6 @@ export class CloudbuildClient implements CloudbuildApi { reRunWorkflow(options: { projectId: string; runId: string }): Promise; } -// Warning: (ae-missing-release-tag) "cloudbuildPlugin" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) const cloudbuildPlugin: BackstagePlugin< { @@ -120,27 +108,19 @@ const cloudbuildPlugin: BackstagePlugin< export { cloudbuildPlugin }; export { cloudbuildPlugin as plugin }; -// Warning: (ae-missing-release-tag) "EntityCloudbuildContent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const EntityCloudbuildContent: () => JSX.Element; -// Warning: (ae-missing-release-tag) "EntityLatestCloudbuildRunCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const EntityLatestCloudbuildRunCard: (props: { branch: string; }) => JSX.Element; -// Warning: (ae-missing-release-tag) "EntityLatestCloudbuildsForBranchCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const EntityLatestCloudbuildsForBranchCard: (props: { branch: string; }) => JSX.Element; -// Warning: (ae-missing-release-tag) "FETCHSOURCE" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface FETCHSOURCE { // (undocumented) @@ -149,27 +129,19 @@ export interface FETCHSOURCE { startTime: string; } -// Warning: (ae-missing-release-tag) "isCloudbuildAvailable" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) const isCloudbuildAvailable: (entity: Entity) => boolean; export { isCloudbuildAvailable }; export { isCloudbuildAvailable as isPluginApplicableToEntity }; -// Warning: (ae-missing-release-tag) "LatestWorkflowRunCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const LatestWorkflowRunCard: (props: { branch: string }) => JSX.Element; -// Warning: (ae-missing-release-tag) "LatestWorkflowsForBranchCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const LatestWorkflowsForBranchCard: (props: { branch: string; }) => JSX.Element; -// Warning: (ae-missing-release-tag) "Options" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface Options { // (undocumented) @@ -182,8 +154,6 @@ export interface Options { substitutionOption: string; } -// Warning: (ae-missing-release-tag) "PullTiming" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface PullTiming { // (undocumented) @@ -192,8 +162,6 @@ export interface PullTiming { startTime: string; } -// Warning: (ae-missing-release-tag) "ResolvedStorageSource" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface ResolvedStorageSource { // (undocumented) @@ -204,8 +172,6 @@ export interface ResolvedStorageSource { object: string; } -// Warning: (ae-missing-release-tag) "Results" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface Results { // (undocumented) @@ -214,21 +180,15 @@ export interface Results { buildStepOutputs: string[]; } -// Warning: (ae-missing-release-tag) "Router" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const Router: () => JSX.Element; -// Warning: (ae-missing-release-tag) "Source" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface Source { // (undocumented) storageSource: StorageSource; } -// Warning: (ae-missing-release-tag) "SourceProvenance" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface SourceProvenance { // (undocumented) @@ -237,8 +197,6 @@ export interface SourceProvenance { resolvedStorageSource: {}; } -// Warning: (ae-missing-release-tag) "Step" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface Step { // (undocumented) @@ -263,8 +221,6 @@ export interface Step { waitFor: string[]; } -// Warning: (ae-missing-release-tag) "StorageSource" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface StorageSource { // (undocumented) @@ -273,8 +229,6 @@ export interface StorageSource { object: string; } -// Warning: (ae-missing-release-tag) "Substitutions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface Substitutions { // (undocumented) @@ -289,8 +243,6 @@ export interface Substitutions { SHORT_SHA: string; } -// Warning: (ae-missing-release-tag) "Timing" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface Timing { // (undocumented) @@ -299,8 +251,6 @@ export interface Timing { startTime: string; } -// Warning: (ae-missing-release-tag) "Timing2" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface Timing2 { // (undocumented) @@ -309,8 +259,6 @@ export interface Timing2 { FETCHSOURCE: FETCHSOURCE; } -// Warning: (ae-missing-release-tag) "Volume" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface Volume { // (undocumented) diff --git a/plugins/cloudbuild/src/api/CloudbuildApi.ts b/plugins/cloudbuild/src/api/CloudbuildApi.ts index eeaf269cde..cb29b49fbf 100644 --- a/plugins/cloudbuild/src/api/CloudbuildApi.ts +++ b/plugins/cloudbuild/src/api/CloudbuildApi.ts @@ -20,6 +20,7 @@ import { } from '../api/types'; import { createApiRef } from '@backstage/core-plugin-api'; +/** @public */ export const cloudbuildApiRef = createApiRef({ id: 'plugin.cloudbuild.service', }); diff --git a/plugins/cloudbuild/src/api/types.ts b/plugins/cloudbuild/src/api/types.ts index c9f6481b9e..1dd03265bc 100644 --- a/plugins/cloudbuild/src/api/types.ts +++ b/plugins/cloudbuild/src/api/types.ts @@ -14,10 +14,12 @@ * limitations under the License. */ +/** @public */ export interface ActionsListWorkflowRunsForRepoResponseData { builds: ActionsGetWorkflowResponseData[]; } +/** @public */ export type ActionsGetWorkflowResponseData = { id: string; status: string; @@ -41,6 +43,7 @@ export type ActionsGetWorkflowResponseData = { timing: Timing2; }; +/** @public */ export interface Step { name: string; args: string[]; @@ -54,16 +57,19 @@ export interface Step { pullTiming: PullTiming; } +/** @public */ export interface Timing2 { BUILD: BUILD; FETCHSOURCE: FETCHSOURCE; } +/** @public */ export interface SourceProvenance { resolvedStorageSource: {}; fileHashes: {}; } +/** @public */ export interface Options { machineType: string; substitutionOption: string; @@ -71,6 +77,7 @@ export interface Options { dynamicSubstitutions: boolean; } +/** @public */ export interface Substitutions { COMMIT_SHA: string; SHORT_SHA: string; @@ -79,45 +86,54 @@ export interface Substitutions { REVISION_ID: string; } +/** @public */ export interface Results { buildStepImages: string[]; buildStepOutputs: string[]; } +/** @public */ export interface BUILD { startTime: string; endTime: string; } +/** @public */ export interface FETCHSOURCE { startTime: string; endTime: string; } +/** @public */ export interface StorageSource { bucket: string; object: string; } +/** @public */ export interface Source { storageSource: StorageSource; } +/** @public */ export interface Volume { name: string; path: string; } +/** @public */ export interface Timing { startTime: string; endTime: string; } +/** @public */ export interface PullTiming { startTime: string; endTime: string; } +/** @public */ export interface ResolvedStorageSource { bucket: string; object: string; diff --git a/plugins/cloudbuild/src/components/Cards/Cards.tsx b/plugins/cloudbuild/src/components/Cards/Cards.tsx index 75c9ee432b..2b7a8607b7 100644 --- a/plugins/cloudbuild/src/components/Cards/Cards.tsx +++ b/plugins/cloudbuild/src/components/Cards/Cards.tsx @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import React, { useEffect } from 'react'; import { useWorkflowRuns, WorkflowRun } from '../useWorkflowRuns'; import { WorkflowRunsTable } from '../WorkflowRunsTable'; @@ -72,6 +73,7 @@ const WidgetContent = ({ ); }; +/** @public */ export const LatestWorkflowRunCard = (props: { branch: string }) => { const { branch = 'master' } = props; const { entity } = useEntity(); @@ -100,6 +102,7 @@ export const LatestWorkflowRunCard = (props: { branch: string }) => { ); }; +/** @public */ export const LatestWorkflowsForBranchCard = (props: { branch: string }) => { const { branch = 'master' } = props; const { entity } = useEntity(); diff --git a/plugins/cloudbuild/src/components/Cards/index.ts b/plugins/cloudbuild/src/components/Cards/index.ts index 669f723c2d..7149bdf3ca 100644 --- a/plugins/cloudbuild/src/components/Cards/index.ts +++ b/plugins/cloudbuild/src/components/Cards/index.ts @@ -13,4 +13,5 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + export { LatestWorkflowRunCard, LatestWorkflowsForBranchCard } from './Cards'; diff --git a/plugins/cloudbuild/src/components/Router.tsx b/plugins/cloudbuild/src/components/Router.tsx index e4c590bcaf..6ac025fef1 100644 --- a/plugins/cloudbuild/src/components/Router.tsx +++ b/plugins/cloudbuild/src/components/Router.tsx @@ -23,9 +23,11 @@ import { WorkflowRunsTable } from './WorkflowRunsTable'; import { CLOUDBUILD_ANNOTATION } from './useProjectName'; import { MissingAnnotationEmptyState } from '@backstage/core-components'; +/** @public */ export const isCloudbuildAvailable = (entity: Entity) => Boolean(entity.metadata.annotations?.[CLOUDBUILD_ANNOTATION]); +/** @public */ export const Router = () => { const { entity } = useEntity(); diff --git a/plugins/cloudbuild/src/components/useProjectName.ts b/plugins/cloudbuild/src/components/useProjectName.ts index 3f314aaa47..ae6ae07b56 100644 --- a/plugins/cloudbuild/src/components/useProjectName.ts +++ b/plugins/cloudbuild/src/components/useProjectName.ts @@ -17,6 +17,7 @@ import useAsync from 'react-use/lib/useAsync'; import { Entity } from '@backstage/catalog-model'; +/** @public */ export const CLOUDBUILD_ANNOTATION = 'google.com/cloudbuild-project-slug'; export const useProjectName = (entity: Entity) => { diff --git a/plugins/cloudbuild/src/plugin.ts b/plugins/cloudbuild/src/plugin.ts index fc96d154b7..2933bfb0be 100644 --- a/plugins/cloudbuild/src/plugin.ts +++ b/plugins/cloudbuild/src/plugin.ts @@ -23,6 +23,7 @@ import { createComponentExtension, } from '@backstage/core-plugin-api'; +/** @public */ export const cloudbuildPlugin = createPlugin({ id: 'cloudbuild', apis: [ @@ -39,6 +40,7 @@ export const cloudbuildPlugin = createPlugin({ }, }); +/** @public */ export const EntityCloudbuildContent = cloudbuildPlugin.provide( createRoutableExtension({ name: 'EntityCloudbuildContent', @@ -47,6 +49,7 @@ export const EntityCloudbuildContent = cloudbuildPlugin.provide( }), ); +/** @public */ export const EntityLatestCloudbuildRunCard = cloudbuildPlugin.provide( createComponentExtension({ name: 'EntityLatestCloudbuildRunCard', @@ -57,6 +60,7 @@ export const EntityLatestCloudbuildRunCard = cloudbuildPlugin.provide( }), ); +/** @public */ export const EntityLatestCloudbuildsForBranchCard = cloudbuildPlugin.provide( createComponentExtension({ name: 'EntityLatestCloudbuildsForBranchCard', diff --git a/plugins/firehydrant/api-report.md b/plugins/firehydrant/api-report.md index c12048e81f..2e3bcf6385 100644 --- a/plugins/firehydrant/api-report.md +++ b/plugins/firehydrant/api-report.md @@ -8,13 +8,9 @@ import { BackstagePlugin } from '@backstage/core-plugin-api'; import { RouteRef } from '@backstage/core-plugin-api'; -// Warning: (ae-missing-release-tag) "FirehydrantCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const FirehydrantCard: () => JSX.Element; -// Warning: (ae-missing-release-tag) "firehydrantPlugin" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const firehydrantPlugin: BackstagePlugin< { diff --git a/plugins/firehydrant/src/plugin.ts b/plugins/firehydrant/src/plugin.ts index df21ee7f9c..6deefe4fce 100644 --- a/plugins/firehydrant/src/plugin.ts +++ b/plugins/firehydrant/src/plugin.ts @@ -23,6 +23,7 @@ import { import { rootRouteRef } from './routes'; +/** @public */ export const firehydrantPlugin = createPlugin({ id: 'firehydrant', apis: [ @@ -37,6 +38,7 @@ export const firehydrantPlugin = createPlugin({ }, }); +/** @public */ export const FirehydrantCard = firehydrantPlugin.provide( createComponentExtension({ name: 'FirehydrantCard', diff --git a/scripts/api-extractor.ts b/scripts/api-extractor.ts index 7e79e14ade..5718f7a458 100644 --- a/scripts/api-extractor.ts +++ b/scripts/api-extractor.ts @@ -208,13 +208,11 @@ const ALLOW_WARNINGS = [ 'plugins/catalog-import', 'plugins/cicd-statistics', 'plugins/circleci', - 'plugins/cloudbuild', 'plugins/config-schema', 'plugins/cost-insights', 'plugins/dynatrace', 'plugins/explore', 'plugins/explore-react', - 'plugins/firehydrant', 'plugins/git-release-manager', 'plugins/github-actions', 'plugins/github-deployments',