Skip to content

Commit

Permalink
WIP feat: adds a debounce for RA deployments
Browse files Browse the repository at this point in the history
  • Loading branch information
nlepage committed Jan 15, 2025
1 parent 124e1c5 commit 475ec47
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions build/controllers/github.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,12 @@ async function _handleCloseRA(request, scalingoClient = ScalingoClient) {
return `Closed RA for PR ${prId} : ${result.join(', ')}.`;
}

async function _handleIssueComment(request, scalingoClient = ScalingoClient, githubService = commonGithubService) {
async function _handleIssueComment(
request,
scalingoClient = ScalingoClient,
githubService = commonGithubService,
reviewAppDeploymentRepository = reviewAppDeploymentRepo,
) {
const payload = request.payload;
const repo = payload.repository.name;
const owner = payload.repository.owner.login;
Expand Down Expand Up @@ -192,7 +197,11 @@ async function _handleIssueComment(request, scalingoClient = ScalingoClient, git

const branchName = await githubService.getPullRequestBranchName({ repo, owner, pull_number });

await client.deployUsingSCM(reviewAppName, branchName);
await reviewAppDeploymentRepository.save({
appName: reviewAppName,
scmRef: branchName,
after: getDeployAfter(),
});

return 'ok';
}
Expand Down

0 comments on commit 475ec47

Please sign in to comment.