Closed jsfour closed 1 year ago
We need to be able to pull the related issue from the pull request description and log it here: https://github.com/octaviuslabs/walter/blob/main/index.ts#L189
Queued for processing...
Here's the pseudocode to extract the related issue from the pull request description and log it:
Modify the existing webhook event listener to listen for pull_request
events instead of pull_request_review_comment.created
.
Create a new function extractRelatedIssue
that takes the pull request description as input and returns the related issue number.
Call the extractRelatedIssue
function inside the modified webhook event listener and log the extracted issue number.
Here's the modified pseudocode:
// Modify the webhook event listener
webhooks.on("pull_request", async (event: any) => {
const pullRequest = event.payload.pull_request;
Log.info("Pull request description:", pullRequest.body);
// Extract the related issue number
const relatedIssueNumber = extractRelatedIssue(pullRequest.body);
// Log the related issue number
Log.info("Related issue number:", relatedIssueNumber);
});
function extractRelatedIssue(description: string): number {
// Define a regular expression pattern to match issue numbers
const issueNumberRegex = /#(\d+)/;
// Search for the issue number in the description
const match = description.match(issueNumberRegex);
// If a match is found, return the issue number as an integer
if (match && match[1]) {
return parseInt(match[1], 10);
}
// If no match is found, return -1 to indicate no related issue
return -1;
}
Remember to replace the existing webhook event listener with the modified one in the code.
@imwalterbot APPROVED
@imwalterbot APPROVED
Queued for processing...
@imwalterbot APPROVED
Processing this now
@APPROVED changes on https://github.com/octaviuslabs/walter/blob/main/index.ts#L189
We need to be able to pull the related issue from the pull request description and log it here: https://github.com/octaviuslabs/walter/blob/main/index.ts#L189
We need to be able to pull the related issue from the pull request description and log it here: https://github.com/octaviuslabs/walter/blob/main/index.ts#L189
Queued for processing...
We need to be able to pull the related issue from the pull request description and log it here: https://github.com/octaviuslabs/walter/blob/main/index.ts#L189
We need to be able to pull the related issue from the pull request description and log it here: https://github.com/octaviuslabs/walter/blob/main/index.ts#L189
Queued for processing...
We need to be able to pull the related issue from the pull request description and log it here: https://github.com/octaviuslabs/walter/blob/main/src/index.ts#L189
We need to be able to pull the related issue from the pull request description and log it here: https://github.com/octaviuslabs/walter/blob/main/src/index.ts#L189
Queued for processing...
Here's the pseudocode to extract the related issue from the pull request description and log it at the specified line:
Modify the existing webhook event listener to listen for pull_request
events instead of pull_request_review_comment.created
.
Create a new function extractRelatedIssue
that takes the pull request description as input and returns the related issue number.
Call the extractRelatedIssue
function inside the modified webhook event listener and log the extracted issue number.
Here's the modified pseudocode:
// Modify the webhook event listener
webhooks.on("pull_request", async (event: any) => {
const pullRequest = event.payload.pull_request;
Log.info("Pull request description:", pullRequest.body);
// Extract the related issue number
const relatedIssueNumber = extractRelatedIssue(pullRequest.body);
// Log the related issue number
Log.info("Related issue number:", relatedIssueNumber);
});
function extractRelatedIssue(description: string): number {
// Define a regular expression pattern to match issue numbers
const issueNumberRegex = /#(\d+)/;
// Search for the issue number in the description
const match = description.match(issueNumberRegex);
// If a match is found, return the issue number as an integer
if (match && match[1]) {
return parseInt(match[1], 10);
}
// If no match is found, return -1 to indicate no related issue
return -1;
}
Remember to replace the existing webhook event listener with the modified one in the code.
@imwalterbot APPROVED for changes on https://github.com/octaviuslabs/walter/blob/main/src/index.ts#L189
@imwalterbot APPROVED for changes on https://github.com/octaviuslabs/walter/blob/main/src/index.ts#L189
@imwalterbot APPROVED for changes on https://github.com/octaviuslabs/walter/blob/main/src/index.ts#L189
Queued for processing...
@imwalterbot APPROVED for changes on https://github.com/octaviuslabs/walter/blob/main/src/index.ts#L189
Processing this now
We need to be able to pull the related issue from the pull request description and log it here: https://github.com/octaviuslabs/walter/blob/main/index.ts#L189