Skip to content

Commit 421b60b

Browse files
authored
Merge pull request #179 from rostilos/1.5.7-rc
feat: Add PR title and description fields to PrProcessRequest and ext…
2 parents 159bb3a + b2d969c commit 421b60b

4 files changed

Lines changed: 31 additions & 0 deletions

File tree

java-ecosystem/libs/analysis-engine/src/main/java/org/rostilos/codecrow/analysisengine/dto/request/processor/PrProcessRequest.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,16 @@ public class PrProcessRequest implements AnalysisProcessRequest {
3535
public String prAuthorId;
3636

3737
public String prAuthorUsername;
38+
39+
/**
40+
* PR title — used by QA auto-doc to extract task IDs when configured with PR_TITLE source.
41+
*/
42+
public String prTitle;
43+
44+
/**
45+
* PR description — used by QA auto-doc to extract task IDs when configured with PR_DESCRIPTION source.
46+
*/
47+
public String prDescription;
3848

3949
/**
4050
* Optional pre-acquired lock key. If set, the processor will skip lock acquisition
@@ -71,6 +81,10 @@ public String getSourceBranchName() {
7181
public String getPrAuthorId() { return prAuthorId; }
7282

7383
public String getPrAuthorUsername() { return prAuthorUsername; }
84+
85+
public String getPrTitle() { return prTitle; }
86+
87+
public String getPrDescription() { return prDescription; }
7488

7589
public String getPreAcquiredLockKey() { return preAcquiredLockKey; }
7690
}

java-ecosystem/libs/analysis-engine/src/main/java/org/rostilos/codecrow/analysisengine/processor/analysis/PullRequestAnalysisProcessor.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -640,6 +640,13 @@ private void publishAnalysisCompletedEvent(Project project, PrProcessRequest req
640640
metrics.put("prNumber", request.getPullRequestId());
641641
metrics.put("targetBranch", request.getTargetBranchName());
642642
metrics.put("sourceBranch", request.getSourceBranchName());
643+
metrics.put("commitHash", request.getCommitHash());
644+
if (request.getPrTitle() != null) {
645+
metrics.put("prTitle", request.getPrTitle());
646+
}
647+
if (request.getPrDescription() != null) {
648+
metrics.put("prDescription", request.getPrDescription());
649+
}
643650

644651
AnalysisCompletedEvent event = new AnalysisCompletedEvent(
645652
this,

java-ecosystem/services/pipeline-agent/src/main/java/org/rostilos/codecrow/pipelineagent/bitbucket/webhookhandler/BitbucketCloudPullRequestWebhookHandler.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,11 @@ private WebhookResult handlePullRequestEvent(WebhookPayload payload, Project pro
163163
request.placeholderCommentId = placeholderCommentId;
164164
request.prAuthorId = payload.prAuthorId();
165165
request.prAuthorUsername = payload.prAuthorUsername();
166+
// Extract PR title/description for QA auto-doc task ID extraction
167+
if (payload.rawPayload() != null) {
168+
request.prTitle = payload.rawPayload().path("pullrequest").path("title").asText(null);
169+
request.prDescription = payload.rawPayload().path("pullrequest").path("description").asText(null);
170+
}
166171
// Pass the pre-acquired lock key to avoid double-locking in the processor
167172
request.preAcquiredLockKey = acquiredLockKey;
168173

java-ecosystem/services/pipeline-agent/src/main/java/org/rostilos/codecrow/pipelineagent/github/webhookhandler/GitHubPullRequestWebhookHandler.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,11 @@ private WebhookResult handlePullRequestEvent(
184184
request.placeholderCommentId = placeholderCommentId;
185185
request.prAuthorId = payload.prAuthorId();
186186
request.prAuthorUsername = payload.prAuthorUsername();
187+
// Extract PR title/description for QA auto-doc task ID extraction
188+
if (payload.rawPayload() != null) {
189+
request.prTitle = payload.rawPayload().path("pull_request").path("title").asText(null);
190+
request.prDescription = payload.rawPayload().path("pull_request").path("body").asText(null);
191+
}
187192
// Pass the pre-acquired lock key to avoid double-locking in the processor
188193
request.preAcquiredLockKey = acquiredLockKey;
189194

0 commit comments

Comments
 (0)