Skip to content

Commit

Permalink
Create bitbucket pull request parser stub
Browse files Browse the repository at this point in the history
  • Loading branch information
rick-nu committed Jul 10, 2024
1 parent 50313b0 commit 5c1b962
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 1,671 deletions.
14 changes: 14 additions & 0 deletions backend/parser/bitbucket/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Slugify from 'backend/parser/slug';
import {
BitBucketChangeWrapper,
BitBucketCommitStatusWebhook,
BitBucketPullRequestWebhook,
BitBucketPushWebhook,
BitBucketRepository,
} from 'types/bitbucket';
Expand Down Expand Up @@ -53,6 +54,19 @@ class BitBucketParser {

return BitBucketBuildParser.parse(id, build);
}

parsePullRequest(pr: BitBucketPullRequestWebhook): Status {
console.log('[parser/bitbucket] Parsing pull request...');

const id = this.getInternalId(pr.repository, pr.pullrequest.source.branch.name);

// TODO: parse the PR
console.log('[parser/bitbucket] TODO.');
id;
return null;

// return BitBucketPullRequestParser.parse(id, build);
}
}

export default new BitBucketParser();
2 changes: 2 additions & 0 deletions backend/router/route/webhook/bitbucket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ router.post('/', (request, response) => {
break;
case 'pullrequest:created':
case 'pullrequest:updated':
status = Parser.parsePullRequest(request.body);
break;
default:
console.log(`[route/webhook/bitbucket] No parser for webhook type ${webhookType}.`);
}
Expand Down
187 changes: 0 additions & 187 deletions cypress/fixtures/bitbucket/temporary/commit_status_created--last.json

This file was deleted.

Loading

0 comments on commit 5c1b962

Please sign in to comment.