This is an automated email from the ASF dual-hosted git repository.

xiangfu0 pushed a commit to branch xiangfu0/codex/pr-flow-openrouter
in repository https://gitbox.apache.org/repos/asf/pinot.git


The following commit(s) were added to 
refs/heads/xiangfu0/codex/pr-flow-openrouter by this push:
     new 72130da5d9f Read creation history metadata from the GitHub pull request
72130da5d9f is described below

commit 72130da5d9fa5d1db393c62a3730c7b2430e4be4
Author: Xiang Fu <[email protected]>
AuthorDate: Mon Sep 7 19:30:56 2026 -0700

    Read creation history metadata from the GitHub pull request
---
 .github/scripts/pr_flow/main.py      | 6 +++---
 .github/scripts/pr_flow/test_main.py | 4 +++-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/.github/scripts/pr_flow/main.py b/.github/scripts/pr_flow/main.py
index 2294bfa7598..7a494dcddb5 100644
--- a/.github/scripts/pr_flow/main.py
+++ b/.github/scripts/pr_flow/main.py
@@ -126,8 +126,8 @@ class GitHub:
           repository(owner:"apache", name:"pinot") {
             pullRequest(number:$number) {
               createdAt
+              includesCreatedEdit
               userContentEdits(first:20) {
-                includesCreatedEdit
                 nodes { id editedAt diff editor { login } }
               }
             }
@@ -149,10 +149,10 @@ class GitHub:
                                               for item in nodes):
             raise FlowError("PR edit history cannot be audited; preserving the 
description")
         if (not isinstance(pull.get("createdAt"), str) or not pull["createdAt"]
-                or type(history.get("includesCreatedEdit")) is not bool):
+                or type(pull.get("includesCreatedEdit")) is not bool):
             raise FlowError("PR edit history metadata is unavailable; 
preserving the description")
         self.history_metadata[number(pr_number)] = {
-            "created_at": pull["createdAt"], "includes_created_edit": 
history["includesCreatedEdit"]}
+            "created_at": pull["createdAt"], "includes_created_edit": 
pull["includesCreatedEdit"]}
         return nodes
 
     def pages(self, suffix, maximum):
diff --git a/.github/scripts/pr_flow/test_main.py 
b/.github/scripts/pr_flow/test_main.py
index 824ecb91fe3..f10874d633b 100644
--- a/.github/scripts/pr_flow/test_main.py
+++ b/.github/scripts/pr_flow/test_main.py
@@ -303,13 +303,15 @@ class HistoryTest(unittest.TestCase):
         api.request = Mock(return_value={"data": {
             "viewer": {"login": "github-actions[bot]"}, "repository": 
{"pullRequest": {
                 "createdAt": "2026-09-08T00:00:00Z",
-                "userContentEdits": {"includesCreatedEdit": True, "nodes": 
nodes}}}}})
+                "includesCreatedEdit": True, "userContentEdits": {"nodes": 
nodes}}}}})
         self.assertEqual(api.history(42), nodes)
         self.assertEqual(api.history_metadata[42], {
             "created_at": "2026-09-08T00:00:00Z", "includes_created_edit": 
True})
         query = api.request.call_args.args[1]["query"]
         self.assertIn("createdAt", query)
         self.assertIn("includesCreatedEdit", query)
+        # GitHub exposes this field on PullRequest, not 
UserContentEditConnection.
+        self.assertRegex(query, 
r"createdAt\s+includesCreatedEdit\s+userContentEdits")
 
 
 class PublicationTest(unittest.TestCase):


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to