Skip to content

Fix part of #3926: Add support for GitHub merge queues plus a bunch of other CI improvements#6150

Merged
BenHenning merged 8 commits intodevelopfrom
add-merge-queue-support-and-other-ci-improvements
Mar 21, 2026
Merged

Fix part of #3926: Add support for GitHub merge queues plus a bunch of other CI improvements#6150
BenHenning merged 8 commits intodevelopfrom
add-merge-queue-support-and-other-ci-improvements

Conversation

@BenHenning
Copy link
Copy Markdown
Member

@BenHenning BenHenning commented Mar 12, 2026

Explanation

Fixes part of #3926

This PR introduces support for GitHub merge queues by:

  • Enabling merge groups as a trigger for all required workflows (GitHub doesn't currently support configuring differrent required workflows for PRs vs. merge groups so the two must match).
  • Of all the required workflows, those that depend on PR-specific properties (like title or base branch) have been updated to support merge group varieties.
    • For unit tests & code coverage this is far more complex because of the diffing behavior and how the synthetic PR branch differs in history from the linear merge group branch.
    • This is further complicated by '[RunAllTests]' needing to trigger a full CI run since it can be any of the commits in the merge group.
    • For the check base branch CI check it should just be skipped.

Besides adding support for merge groups, this PR does a bunch of other things:

  • It updates the setup Android workflow to read the SDK and build tools versions from build_vars.bzl so that we never need to update it again to keep things in sync (Bazel still requires an update).
  • It updates the new workflows introduced in Fix #6141: Add workflows for issue assignment & force push checking #6142 to specifically ignore the translatewiki-prs branch since it does not need to use the PR template nor is it prohibited from force pushes (this was missed in the original implementation).
  • It refines the message for force push closes per @harshsomankar123-tech's suggestion at Fix #6141: Add workflows for issue assignment & force push checking #6142 (comment).
  • It fixes a weird quirk with the script that reopens TODOs. If the script fails to build it will actually still continue running which leads to the issue being reopened (see [Feature Request]: Add workflows for catching common new contributor mistakes #6141 (comment)). This is being mitigated in two ways:
    • First by introducing a prior step to try and pre-build the script. If this fails then todoIssueResolvedCheck will be skipped which will lead to the other subsequent steps failing to run (because they rely on the workflow being failure status).
    • Building robustness in if there is a build failure. The issue is still reopened and a new message is left indicating that something probably went wrong. Hopefully we don't see this happen often but it's a nice catch to avoid issues being incorrectly closed when they haven't been fully resolved due to a CI flake.
    • One other change: 'reopened' was dropped because it was never actually used.
  • It updates all of the third-party CI dependencies to their very latest (which actually made me realize we should be using something else for Bazel but the full audit of that is probably more work than this whole PR so I skipped it--see [Feature Request]: Use official setup-bazel workflow #6149).
  • It fixes a problem that we noticed with the PR issue description check mysteriously auto-marking PRs as draft that seemed to correctly reference issues. We discovered this is because of an overly strict regex match on the template where it wasn't allowing trailing whitespace. Both regexes have been updated to allow all non-newline whitespaces (equivalent to the \h regex class which isn't supported in native JavaScript).

Important: I did not test these changes, and simply running through CI on this PR won't be sufficient. However I'm fairly sure most of these changes won't cause problems and should work without issue except maybe the merge groups (which we will see once merge queues are enabled after this PR is merged and another PR is sent to be merged). We may discover certain dependency upgrades causing problems. If that happens we can fix them forward since it shouldn't really be necessary to revert this PR.

For actual merge queues I am planning to set them up so that PRs are merged 3 times per day (every 8 hours) so try and maximize the chance of more than one PR being merged at once (though I think we average fewer than 1 PRs per day so this probably won't happen). This may be tweaked in the future to be much longer (I'm considering 24 hours) since merge queues actually overall increase the CI burden on the project (and this is causing some fairly substantial issues on Oppia web right now).

Finally, a fairly significant amount of this PR was either authored by Gemini (for the new logic portions) or otherwise helped in investigation (for merge queues and the TODO check bits). The version checks I did myself fully since there wasn't much advantage to an LLM there, and I basically rewrote everything that was suggested in one way or another. The tool was helpful in bouncing ideas mostly, though I will note it caught the potential deep fetch issue for the compute affected targets check for unit tests & code coverage--I likely would have missed that an would have needed to do a follow-up fix once we tried to use merge queues and saw it fail.

Essential Checklist

  • The PR title starts with "Fix #bugnum: " (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
  • The explanation section above starts with "Fixes #bugnum: " (If this PR fixes part of an issue, use instead: "Fixes part of #bugnum: ...".)
  • Any changes to scripts/assets files have their rationale included in the PR explanation.
  • The PR follows the style guide.
  • The PR does not contain any unnecessary code changes from Android Studio (reference).
  • The PR is made from a branch that's not called "develop" and is up-to-date with "develop".
  • The PR is assigned to the appropriate reviewers (reference).

For UI-specific PRs only

N/A -- This is a CI infrastructure-only change that won't impact the end user experience in the app.

@BenHenning BenHenning requested a review from a team as a code owner March 12, 2026 23:01
Comment thread .github/workflows/code_coverage.yml
Copy link
Copy Markdown
Member Author

@BenHenning BenHenning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick self-review spot check.

@BenHenning
Copy link
Copy Markdown
Member Author

PTAL @adhiamboperes.

@github-actions
Copy link
Copy Markdown

Coverage Report

Results

Coverage Analysis: SKIP ⏭️

This PR did not introduce any changes to Kotlin source or test files.

To learn more, visit the Oppia Android Code Coverage wiki page

@BenHenning BenHenning disabled auto-merge March 17, 2026 04:22
@BenHenning
Copy link
Copy Markdown
Member Author

(Turning off auto-merge because I need to fix the problem with the script preventing PRs from going into review).

@BenHenning
Copy link
Copy Markdown
Member Author

@adhiamboperes latest 2 commits should fix the other issue with PRs being moved to draft incorrectly. I'll update the PR description quickly to explain it, as well, and will re-enable auto-merge.

Copy link
Copy Markdown
Member Author

@BenHenning BenHenning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick self-review spot check.

@BenHenning BenHenning enabled auto-merge (squash) March 17, 2026 16:38
@github-actions
Copy link
Copy Markdown

Coverage Report

Results

Number of files assessed: 9
Overall Coverage: 73.66%
Coverage Analysis: PASS

Passing coverage

Files with passing code coverage
File Coverage Lines Hit Status Min Required
MathTagHandler.ktutility/src/main/java/org/oppia/android/util/parser/html/MathTagHandler.kt
84.21% 96 / 114 70%
CustomHtmlContentHandler.ktutility/src/main/java/org/oppia/android/util/parser/html/CustomHtmlContentHandler.kt
85.71% 114 / 133 70%
MathModel.ktutility/src/main/java/org/oppia/android/util/parser/math/MathModel.kt
100.00% 26 / 26 70%
UrlImageParser.ktutility/src/main/java/org/oppia/android/util/parser/image/UrlImageParser.kt
57.28% 122 / 213 57% *

* represents tests with custom overridden pass/fail coverage thresholds

Exempted coverage

Files exempted from coverage
File Exemption Reason
HtmlParser.ktutility/src/main/java/org/oppia/android/util/parser/html/HtmlParser.kt
This file is incompatible with code coverage tooling; skipping coverage check.
TestGlideImageLoader.ktutility/src/main/java/org/oppia/android/util/parser/image/TestGlideImageLoader.kt
This file is exempted from having a test file; skipping coverage check.
GlideImageLoader.ktutility/src/main/java/org/oppia/android/util/parser/image/GlideImageLoader.kt
This file is exempted from having a test file; skipping coverage check.
ImageLoader.ktutility/src/main/java/org/oppia/android/util/parser/image/ImageLoader.kt
This file is exempted from having a test file; skipping coverage check.
MathBitmapModelLoader.ktutility/src/main/java/org/oppia/android/util/parser/math/MathBitmapModelLoader.kt
This file is exempted from having a test file; skipping coverage check.

Refer test_file_exemptions.textproto for the comprehensive list of file exemptions and their required coverage percentages.

To learn more, visit the Oppia Android Code Coverage wiki page

Copy link
Copy Markdown
Contributor

@adhiamboperes adhiamboperes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM overarll. I have replied to your comment, but do feel free to merge the PR.

Comment thread .github/workflows/code_coverage.yml
@oppiabot
Copy link
Copy Markdown

oppiabot bot commented Mar 19, 2026

Unassigning @adhiamboperes since they have already approved the PR.

@oppiabot oppiabot bot added the PR: LGTM label Mar 19, 2026
@oppiabot
Copy link
Copy Markdown

oppiabot bot commented Mar 19, 2026

Hi @BenHenning, this PR is ready to be merged. Please address any remaining comments prior to merging, and feel free to merge this PR once the CI checks pass and you're happy with it. Thanks!

@BenHenning
Copy link
Copy Markdown
Member Author

Thanks @adhiamboperes! I don't think there's additional work needed here--I responded to your comment and closed that thread. Restarted the cancelled build workflows and keeping auto-merge on.

@BenHenning BenHenning merged commit 8e13fc9 into develop Mar 21, 2026
40 of 50 checks passed
@BenHenning BenHenning deleted the add-merge-queue-support-and-other-ci-improvements branch March 21, 2026 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants