diff --git a/API.md b/API.md index be788b0f0..288f02d5f 100644 --- a/API.md +++ b/API.md @@ -94,6 +94,7 @@ Any object. | highSeverityAlarms | aws-cdk-lib.aws_cloudwatch.IAlarm[] | Returns a list of all high-severity alarms from this ConstructHub instance. | | ingestionQueue | aws-cdk-lib.aws_sqs.IQueue | *No description.* | | lowSeverityAlarms | aws-cdk-lib.aws_cloudwatch.IAlarm[] | Returns a list of all low-severity alarms from this ConstructHub instance. | +| regenerateAllDocumentationPerPackage | aws-cdk-lib.aws_stepfunctions.IStateMachine | The function operators can use to reprocess a specific package version through the backend data pipeline. | --- @@ -174,6 +175,18 @@ that something unusual (not necessarily bad) is happening. --- +##### `regenerateAllDocumentationPerPackage`Required + +```typescript +public readonly regenerateAllDocumentationPerPackage: IStateMachine; +``` + +- *Type:* aws-cdk-lib.aws_stepfunctions.IStateMachine + +The function operators can use to reprocess a specific package version through the backend data pipeline. + +--- + ### S3StorageFactory diff --git a/src/backend/orchestration/index.ts b/src/backend/orchestration/index.ts index 31f48aa17..90b1f719e 100644 --- a/src/backend/orchestration/index.ts +++ b/src/backend/orchestration/index.ts @@ -181,6 +181,12 @@ export class Orchestration extends Construct { */ public readonly regenerateAllDocumentation: IStateMachine; + /** + * The function operators can use to reprocess a specific package version + * through the backend data pipeline. + */ + public readonly regenerateAllDocumentationPerPackage: IStateMachine; + /** * The function that builds the catalog. */ @@ -513,14 +519,17 @@ export class Orchestration extends Construct { // The workflow is intended to be manually triggered by an operator to // reprocess all package versions currently in store through the orchestrator. - this.regenerateAllDocumentation = new RegenerateAllDocumentation( + const regenerateAllDocumentation = new RegenerateAllDocumentation( this, 'RegenerateAllDocumentation', { bucket: props.bucket, stateMachine: this.stateMachine, } - ).stateMachine; + ); + this.regenerateAllDocumentation = regenerateAllDocumentation.stateMachine; + this.regenerateAllDocumentationPerPackage = + regenerateAllDocumentation.processPackageVersions; props.overviewDashboard.addConcurrentExecutionMetricToDashboard( needsCatalogUpdateFunction, @@ -671,6 +680,7 @@ interface RegenerateAllDocumentationProps { class RegenerateAllDocumentation extends Construct { public readonly stateMachine: StateMachine; + public readonly processPackageVersions: StateMachine; public constructor( scope: Construct, @@ -772,6 +782,7 @@ class RegenerateAllDocumentation extends Construct { timeout: Duration.hours(1), tracingEnabled: true, }); + this.processPackageVersions = processPackageVersions; // This workflow is broken into two sub-workflows because otherwise it hits the 25K events limit // of StepFunction executions relatively quickly. diff --git a/src/construct-hub.ts b/src/construct-hub.ts index d5fbe9de4..1e1a9567a 100644 --- a/src/construct-hub.ts +++ b/src/construct-hub.ts @@ -41,6 +41,7 @@ import { FeatureFlags, Category, } from './webapp'; +import { IStateMachine } from 'aws-cdk-lib/aws-stepfunctions'; /** * Configuration for generating RSS and ATOM feed for the latest packages @@ -269,6 +270,12 @@ export interface CodeArtifactDomainProps { * Construct Hub. */ export class ConstructHub extends Construct implements iam.IGrantable { + /** + * The function operators can use to reprocess a specific package version + * through the backend data pipeline. + */ + public readonly regenerateAllDocumentationPerPackage: IStateMachine; + private readonly ingestion: Ingestion; private readonly monitoring: Monitoring; @@ -407,6 +414,8 @@ export class ConstructHub extends Construct implements iam.IGrantable { vpcSecurityGroups, feedBuilder, }); + this.regenerateAllDocumentationPerPackage = + orchestration.regenerateAllDocumentationPerPackage; // rebuild the catalog when the deny list changes. denyList.prune.onChangeInvoke(orchestration.catalogBuilder.function);