Skip to content

Commit e6cd934

Browse files
authored
Merge branch 'main' into pr/agent-build-robustness
2 parents b99f049 + 6b40f5f commit e6cd934

25 files changed

Lines changed: 1253 additions & 79 deletions

.github/workflows/deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ jobs:
153153
github-token: ${{ github.token }}
154154

155155
- name: Configure AWS credentials
156-
uses: aws-actions/configure-aws-credentials@254c19bd240aabef8777f48595e9d2d7b972184b # v6.2.1
156+
uses: aws-actions/configure-aws-credentials@517a711dbcd0e402f90c77e7e2f81e849156e31d # v6.2.2
157157
with:
158158
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
159159
aws-region: ${{ vars.AWS_REGION }}
@@ -228,7 +228,7 @@ jobs:
228228
github-token: ${{ github.token }}
229229

230230
- name: Configure AWS credentials
231-
uses: aws-actions/configure-aws-credentials@254c19bd240aabef8777f48595e9d2d7b972184b # v6.2.1
231+
uses: aws-actions/configure-aws-credentials@517a711dbcd0e402f90c77e7e2f81e849156e31d # v6.2.2
232232
with:
233233
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
234234
aws-region: ${{ vars.AWS_REGION }}

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/integ.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ jobs:
199199
persist-credentials: false
200200

201201
- name: Configure AWS credentials
202-
uses: aws-actions/configure-aws-credentials@254c19bd240aabef8777f48595e9d2d7b972184b # v6.2.1
202+
uses: aws-actions/configure-aws-credentials@517a711dbcd0e402f90c77e7e2f81e849156e31d # v6.2.2
203203
with:
204204
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
205205
# Fall back to us-east-1 if the repo variable is unset, so the action

.github/workflows/monthly-repo-metrics.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
echo "last_month=$first_day..$last_day" >> "$GITHUB_ENV"
4242
4343
- name: Report on issues
44-
uses: github/issue-metrics@44173f9e0a3b2144a777a10a340e4c09a25ac9f8 # v4.2.8
44+
uses: github/issue-metrics@df8c49d20958f9345281fa2124858bd0ad227e1f # v5.0.0
4545
env:
4646
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4747
SEARCH_QUERY: repo:aws-samples/sample-autonomous-cloud-coding-agents is:issue created:${{ env.last_month }} -reason:"not planned"
@@ -54,7 +54,7 @@ jobs:
5454
content-filepath: ./issue_metrics.md
5555

5656
- name: Report on PRs
57-
uses: github/issue-metrics@44173f9e0a3b2144a777a10a340e4c09a25ac9f8 # v4.2.8
57+
uses: github/issue-metrics@df8c49d20958f9345281fa2124858bd0ad227e1f # v5.0.0
5858
env:
5959
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6060
SEARCH_QUERY: repo:aws-samples/sample-autonomous-cloud-coding-agents is:pr created:${{ env.last_month }} -is:draft

agent/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ARG GH_VERSION=2.93.0
44
FROM --platform=$TARGETPLATFORM jdxcode/mise:latest AS mise
55

66
# Build gh with a patched Go toolchain; upstream packages can lag Go CVE fixes.
7-
FROM --platform=$TARGETPLATFORM golang:1.26.3-bookworm AS gh-builder
7+
FROM --platform=$TARGETPLATFORM golang:1.26.4-bookworm AS gh-builder
88
ARG GH_VERSION
99
RUN GOPROXY=direct GOBIN=/out go install "github.com/cli/cli/v2/cmd/gh@v${GH_VERSION}"
1010

cdk/src/constructs/jira-integration.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ export class JiraIntegration extends Construct {
148148
*/
149149
public readonly workspaceRegistryTable: dynamodb.Table;
150150

151-
/** Webhook dedup table — `{issueKey}#{webhookEvent}#{timestamp}` keys with 8h TTL. */
151+
/** Webhook dedup table — issue timestamps or stable comment IDs, with an 8h TTL. */
152152
public readonly webhookDedupTable: dynamodb.Table;
153153

154154
/** Jira webhook signing secret (placeholder — populated by `bgagent jira setup`). */
@@ -168,7 +168,8 @@ export class JiraIntegration extends Construct {
168168
this.workspaceRegistryTable = workspaceRegistry.table;
169169

170170
// Dedup table: Jira webhook retries collapse to a single processor invoke
171-
// within the 8h TTL window. Keyed on `{issueKey}#{webhookEvent}#{timestamp}`.
171+
// within the 8h TTL window. Issue events use the event timestamp; comment
172+
// events use the stable Jira comment ID.
172173
this.webhookDedupTable = new dynamodb.Table(this, 'WebhookDedupTable', {
173174
partitionKey: { name: 'dedup_key', type: dynamodb.AttributeType.STRING },
174175
billingMode: dynamodb.BillingMode.PAY_PER_REQUEST,
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
* MIT No Attribution
3+
*
4+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy of
7+
* the Software without restriction, including without limitation the rights to
8+
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9+
* the Software, and to permit persons to whom the Software is furnished to do so.
10+
*
11+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17+
* SOFTWARE.
18+
*/
19+
20+
/**
21+
* GSI name for resolving Jira-origin tasks by tenant and issue key.
22+
*
23+
* Kept dependency-free because both CDK constructs and bundled Lambda handlers
24+
* use this deployment/runtime contract.
25+
*/
26+
export const JIRA_ISSUE_INDEX_NAME = 'JiraIssueIndex';

cdk/src/constructs/task-table.ts

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
import { RemovalPolicy } from 'aws-cdk-lib';
2121
import * as dynamodb from 'aws-cdk-lib/aws-dynamodb';
2222
import { Construct } from 'constructs';
23+
import { JIRA_ISSUE_INDEX_NAME } from './task-table-indexes';
24+
25+
export { JIRA_ISSUE_INDEX_NAME } from './task-table-indexes';
2326

2427
/**
2528
* Properties for TaskTable construct.
@@ -47,13 +50,15 @@ export interface TaskTableProps {
4750
/**
4851
* DynamoDB table for persisting task state across the agent lifecycle.
4952
*
50-
* Schema: task_id (PK) with three GSIs for querying by user+status,
51-
* by status (queue processing), and by idempotency key (dedup).
53+
* Schema: task_id (PK) with GSIs for querying by user+status, by status
54+
* (queue processing), by idempotency key (dedup), and by Jira issue.
5255
*
5356
* GSIs:
5457
* - UserStatusIndex (PK: user_id, SK: status_created_at) — "my tasks" queries
5558
* - StatusIndex (PK: status, SK: created_at) — queue processing, monitoring
5659
* - IdempotencyIndex (PK: idempotency_key) — sparse index for dedup
60+
* - JiraIssueIndex (PK: jira_issue_identity, SK: created_at) — sparse index
61+
* for resolving a Jira issue to its newest PR-producing task
5762
*/
5863
export class TaskTable extends Construct {
5964
/**
@@ -74,6 +79,12 @@ export class TaskTable extends Construct {
7479
*/
7580
public static readonly IDEMPOTENCY_INDEX = 'IdempotencyIndex';
7681

82+
/**
83+
* GSI for resolving a tenant-scoped Jira issue to its newest ABCA task.
84+
* PK: jira_issue_identity (`{cloudId}#{issueKey}`), SK: created_at.
85+
*/
86+
public static readonly JIRA_ISSUE_INDEX = JIRA_ISSUE_INDEX_NAME;
87+
7788
/**
7889
* The underlying DynamoDB table. Use this to grant access or read the table name.
7990
*/
@@ -118,5 +129,16 @@ export class TaskTable extends Construct {
118129
partitionKey: { name: 'idempotency_key', type: dynamodb.AttributeType.STRING },
119130
projectionType: dynamodb.ProjectionType.KEYS_ONLY,
120131
});
132+
133+
// Sparse: only Jira-origin tasks with issue metadata carry the top-level
134+
// jira_issue_identity attribute. Keep the projection limited to fields the
135+
// comment-trigger resolver needs.
136+
this.table.addGlobalSecondaryIndex({
137+
indexName: TaskTable.JIRA_ISSUE_INDEX,
138+
partitionKey: { name: 'jira_issue_identity', type: dynamodb.AttributeType.STRING },
139+
sortKey: { name: 'created_at', type: dynamodb.AttributeType.STRING },
140+
projectionType: dynamodb.ProjectionType.INCLUDE,
141+
nonKeyAttributes: ['pr_url', 'pr_number', 'status', 'repo', 'user_id', 'channel_metadata'],
142+
});
121143
}
122144
}

0 commit comments

Comments
 (0)