Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions cdk/src/constructs/jira-integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,18 @@ export interface JiraIntegrationProps {
/** The DynamoDB task events table. */
readonly taskEventsTable: dynamodb.ITable;

/** Shared orchestration DAG table. Omit to retain one-issue/one-task mode. */
readonly orchestrationTable?: dynamodb.ITable;

/**
* User concurrency counter table. When provided with ``orchestrationTable``,
* seed and retry releases are limited to the user's current free slots.
*/
readonly userConcurrencyTable?: dynamodb.ITable;

/** Per-user concurrency cap shared with task admission. Default 10. */
readonly maxConcurrentTasksPerUser?: number;

/** The DynamoDB repo config table (optional — for repo onboarding checks). */
readonly repoTable?: dynamodb.ITable;

Expand Down Expand Up @@ -232,6 +244,15 @@ export class JiraIntegration extends Construct {
if (props.attachmentsBucket) {
createTaskEnv.ATTACHMENTS_BUCKET_NAME = props.attachmentsBucket.bucketName;
}
if (props.orchestrationTable) {
createTaskEnv.ORCHESTRATION_TABLE_NAME = props.orchestrationTable.tableName;
}
if (props.orchestrationTable && props.userConcurrencyTable) {
createTaskEnv.USER_CONCURRENCY_TABLE_NAME = props.userConcurrencyTable.tableName;
createTaskEnv.MAX_CONCURRENT_TASKS_PER_USER = String(
props.maxConcurrentTasksPerUser ?? 10,
);
}

// --- Cognito Authorizer (for /jira/link) ---
const cognitoAuthorizer = new apigw.CognitoUserPoolsAuthorizer(this, 'JiraCognitoAuthorizer', {
Expand Down Expand Up @@ -286,6 +307,12 @@ export class JiraIntegration extends Construct {
}));
props.taskTable.grantReadWriteData(webhookProcessorFn);
props.taskEventsTable.grantReadWriteData(webhookProcessorFn);
if (props.orchestrationTable) {
props.orchestrationTable.grantReadWriteData(webhookProcessorFn);
}
if (props.orchestrationTable && props.userConcurrencyTable) {
props.userConcurrencyTable.grantReadData(webhookProcessorFn);
}
if (props.repoTable) {
props.repoTable.grantReadData(webhookProcessorFn);
}
Expand Down
Loading
Loading