Skip to content

Commit

Permalink
fix: don't open bug when .OwlBot.yaml is missing (googleapis#5244)
Browse files Browse the repository at this point in the history
The contents of the repo are the source of truth.
scan-googleapis-gen-and-create-pull requests queries firestore to find
.OwlBot.yaml files. Firestore may have stale data. So if Owl Bot queries
firestore, finds an .OwlBot.yaml, and then can't find the .OwlBot.yaml
in the repo, then that's not actually a problem.

Fixes googleapis#5242

---------

Co-authored-by: Jeff Ching <chingor@google.com>
  • Loading branch information
SurferJeffAtGoogle and chingor13 committed Oct 10, 2023
1 parent 0425359 commit d28d77a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/owl-bot/src/copy-code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ export async function copyCodeIntoCommit(
const localYamlPath = path.join(params.destDir, yamlPath);
let yaml: OwlBotYaml | undefined;
try {
if (!fs.existsSync(localYamlPath)) {
logger.warn(`${localYamlPath} doesn't exist.`);
continue;
}
yaml = await loadOwlBotYaml(localYamlPath);
} catch (e) {
await reportError(e, yamlPath);
Expand Down Expand Up @@ -547,7 +551,7 @@ export async function copyCodeAndAppendOrCreatePullRequest(
const issue = await octokit.issues.create({
owner: params.destRepo.owner,
repo: params.destRepo.repo,
title: `${yamlPath} is missing or defective`,
title: `${yamlPath} is defective`,
body: `While attempting to copy files from
${sourceLink}
Expand Down

0 comments on commit d28d77a

Please sign in to comment.