Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Skip creating the Owlbot post-processor check if .OwlBot.lock.yaml does not exist. #5312

Merged
merged 4 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions packages/owl-bot/src/owl-bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@
return;
} else {
logger.warn(`Error acquiring datastore lock for target ${target}`, err);
logger.warn(err as any);

Check warning on line 539 in packages/owl-bot/src/owl-bot.ts

View workflow job for this annotation

GitHub Actions / test (owl-bot)

Unexpected any. Specify a different type
throw err;
}
}
Expand Down Expand Up @@ -629,15 +629,10 @@
return;
}
if (!lockText) {
logger.info(`no .OwlBot.lock.yaml found for ${opts.head}`);
// If OwlBot is not configured on repo, indicate success. This makes
// it easier to enable OwlBot as a required check during migration:
await createCheck({
text: 'OwlBot is not yet enabled on this repository',
summary: 'OwlBot is not yet enabled on this repository',
conclusion: 'success',
title: '🦉 OwlBot - success',
});
// If OwlBot is not configured on a repo, skip creating the check.
logger.info(
`no .OwlBot.lock.yaml found for ${opts.head}, skip creating the check.`
);
return;
}
try {
Expand Down
5 changes: 1 addition & 4 deletions packages/owl-bot/test/owl-bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1567,10 +1567,7 @@ describe('OwlBot', () => {
payload: payload as any,
id: 'abc123',
});
sandbox.assert.calledWith(
createCheckStub,
sinon.match.has('conclusion', 'success')
);
sandbox.assert.notCalled(createCheckStub);
githubMock.done();
});
it('returns early and adds success status if base is not default branch', async () => {
Expand Down
Loading