mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 17:50:15 +01:00
Fix computing the maximum merged PR (#7127)
Assisted-by: Antigravity with Gemini
This commit is contained in:
@@ -118,7 +118,11 @@ _QUERY_LABEL = """
|
||||
_QUERY_MAX_MERGED_PR = """
|
||||
{
|
||||
repository(owner: "carbon-language", name: "carbon-lang") {
|
||||
pullRequests(states: MERGED, first: 1) {
|
||||
pullRequests(
|
||||
states: MERGED
|
||||
orderBy: {field: CREATED_AT, direction: DESC}
|
||||
first: 1
|
||||
) {
|
||||
nodes {
|
||||
number
|
||||
}
|
||||
|
||||
@@ -499,6 +499,16 @@ class TestCheckDependentPR(unittest.TestCase):
|
||||
_OID2, "pending", "This PR has open dependencies: #1"
|
||||
)
|
||||
|
||||
def test_query_max_merged_pr_explicit_orderBy_and_first_one(self) -> None:
|
||||
self.assertIn(
|
||||
"orderBy: {field: CREATED_AT, direction: DESC}",
|
||||
check_dependent_pr._QUERY_MAX_MERGED_PR,
|
||||
)
|
||||
self.assertIn(
|
||||
"first: 1",
|
||||
check_dependent_pr._QUERY_MAX_MERGED_PR,
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user