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

GitUtils.getValidMergedPRs() returns false positives when PRs are merged into feature branches #41718

Closed
marcaaron opened this issue May 7, 2024 · 8 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Daily KSv2

Comments

@marcaaron
Copy link
Contributor

cc @roryabraham coming from https://expensify.slack.com/archives/C07J32337/p1715047410791299

Problem

When we merged a PR from Rushat it broke the markPullRequestsAsDeployed() part of the staging deploy.

The PR in question had some commits that merged in PRs from other contributors into a feature branch e.g. Merge pull request #12 from software-mansion-labs/travel/terms-and-conditions.

AFAICT we:

  1. Get all the commits then pass them to getValidMergedPRs() here
  2. Parse the PR # out using a regex

However, in the case where this failed the PR doesn't exist... so we hit a 404 in the next step. I think around here:

const {data: pr} = await GithubUtils.octokit.pulls.get({
owner: CONST.GITHUB_OWNER,
repo: CONST.APP_REPO,
pull_number: prNumber,
});

Solution

  • We could just skip any RequestError with a 404 status...?
  • Or figure out how to filter out the PRs that are not merged by Expensify?
@marcaaron marcaaron added the Weekly KSv2 label May 7, 2024
@marcaaron marcaaron self-assigned this May 7, 2024
@roryabraham
Copy link
Contributor

Thanks for the detailed report. It's been a while since I worked on this code, but I always use TDD in CIGitLogicTests.sh

@roryabraham
Copy link
Contributor

roryabraham commented May 7, 2024

Probably just ignoring 404s is easier to implement. Seems fine - let's log them though.

@marcaaron
Copy link
Contributor Author

I always use TDD in CIGitLogicTests.sh

Not sure if I followed what you mean there. Gonna raise a PR to catch the RequestError and log, but throw other errors.

Copy link

melvin-bot bot commented May 31, 2024

This issue has not been updated in over 15 days. @marcaaron eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Monthly KSv2 labels Jun 10, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jul 3, 2024
@melvin-bot melvin-bot bot changed the title GitUtils.getValidMergedPRs() returns false positives when PRs are merged into feature branches [HOLD for payment 2024-07-10] GitUtils.getValidMergedPRs() returns false positives when PRs are merged into feature branches Jul 3, 2024
Copy link

melvin-bot bot commented Jul 3, 2024

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jul 3, 2024
Copy link

melvin-bot bot commented Jul 3, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.3-7 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-07-10. 🎊

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jul 10, 2024
Copy link

melvin-bot bot commented Jul 10, 2024

Skipping the payment summary for this issue since all the assignees are employees or vendors. If this is incorrect, please manually add the payment summary SO.

@melvin-bot melvin-bot bot added the Overdue label Jul 12, 2024
@roryabraham
Copy link
Contributor

I think this is done and no payments are due, closing it out

@melvin-bot melvin-bot bot removed the Overdue label Jul 17, 2024
@roryabraham roryabraham changed the title [HOLD for payment 2024-07-10] GitUtils.getValidMergedPRs() returns false positives when PRs are merged into feature branches GitUtils.getValidMergedPRs() returns false positives when PRs are merged into feature branches Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Daily KSv2
Projects
None yet
Development

No branches or pull requests

2 participants