Repository: conbench/conbench (language: python)

Issue:
devprod: CI fails on forks
Example: https://github.com/conbench/conbench/pull/1523/checks

If someone opens a PR from a fork, various errors occur. This should be a supported workflow as we can't give write permissions to everyone who wants to open a PR.


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml
index 871e4537..88b45feb 100755
--- a/.github/workflows/actions.yml
+++ b/.github/workflows/actions.yml
@@ -13,7 +13,12 @@ env:
   # configured, allowing for automatic rotation after quota consumption.
   # Also see https://github.com/conbench/conbench/issues/917.
   # Future: potentially rename that variable: _POOL suffix
-  GITHUB_API_TOKEN: ${{ secrets.PERSONAL_GITHUB_API_TOKEN_POOL }}
+  GITHUB_API_TOKEN: ${{ secrets.PERSONAL_GITHUB_API_TOKEN_POOL }} || ${{ secrets.GITHUB_TOKEN }}
+
+permissions:
+  metadata: read
+  contents: read
+  pull-requests: read
 
 jobs:
   lint:
diff --git a/.github/workflows/auto-assign-issues-prs.yml b/.github/workflows/auto-assign-issues-prs.yml
index a05b642d..62be69ba 100644
--- a/.github/workflows/auto-assign-issues-prs.yml
+++ b/.github/workflows/auto-assign-issues-prs.yml
@@ -1,6 +1,6 @@
 name: Auto assign pull requests and issues
 on:
-  pull_request:
+  pull_request_target:
     types: [opened, reopened, edited]
 
 env:
@@ -42,13 +42,13 @@ jobs:
           repo: ${{ github.event.repository.name }}
           pr_number: ${{ github.event.pull_request.number }}
       - name: Show the linked issue output
-        env: 
+        env:
           RETRIEVED_ISSUE: ${{ steps.get_linked_issue.outputs.data }}
         run: |
           echo "Issue output: $RETRIEVED_ISSUE"
         continue-on-error: true
       - name: Assign the PR author to the issue
-        env: 
+        env:
           RETRIEVED_ISSUE: ${{ steps.get_linked_issue.outputs.data }}
         run: |
           echo "$RETRIEVED_ISSUE" | \


Test patch:
diff --git a/conbench/tests/entities/test_commit.py b/conbench/tests/entities/test_commit.py
index 6eced0a6..b61e9b39 100644
--- a/conbench/tests/entities/test_commit.py
+++ b/conbench/tests/entities/test_commit.py
@@ -156,7 +156,7 @@ def test_repository_to_url():
         None,
         # as if github info were provided the advanced, github_info() way: that function
         # returns a branch string like this
-        "apache:main",
+        "conbench:main",
     ],
 )
 def test_get_github_commit_metadata_and_fork_point_sha(branch):
@@ -164,17 +164,17 @@ def test_get_github_commit_metadata_and_fork_point_sha(branch):
     if not os.getenv("GITHUB_API_TOKEN"):
         pytest.skip("No GITHUB_API_TOKEN given so we won't hit the GitHub API")
 
-    repo = "https://github.com/apache/arrow"
-    sha = "3decc46119d583df56c7c66c77cf2803441c4458"
+    repo = "https://github.com/conbench/conbench"
+    sha = "44e81d10f475e9468eaf488dbfe73a0b43d26adc"
 
     expected = {
-        "parent": "fcaa422c84796bcf7dbe328ee3612f434cd4d356",
-        "date": datetime.datetime(2021, 3, 17, 16, 27, 37, tzinfo=timezone.utc),
-        "message": "ARROW-11997: [Python] concat_tables crashes python interpreter",
-        "author_name": "Diana Clarke",
-        "author_login": "dianaclarke",
-        "author_avatar": "https://avatars.githubusercontent.com/u/878798?v=4",
-        "branch": "apache:main",
+        "parent": "2c082f1f57ae867d83e50bfddc3749db2341559d",
+        "date": datetime.datetime(2023, 11, 6, 15, 0, 11, tzinfo=timezone.utc),
+        "message": "benchclients: fix bug on 3.8 (#1530)",
+        "author_name": "Austin Dickey",
+        "author_login": "austin3dickey",
+        "author_avatar": "https://avatars.githubusercontent.com/u/16600275?v=4",
+        "branch": "conbench:main",
         # this is the default branch, so the fork point sha == the commit sha
         "fork_point_sha": sha,
     }
@@ -197,10 +197,10 @@ def test_get_github_commit_metadata_and_fork_point_sha(branch):
     [
         # as if github info were provided the recommended, manual way: only providing
         # commit, repository, and pr_number, not branch
-        (None, 10665),
+        (None, 1532),
         # as if github info were provided the advanced, github_info() way: that function
         # returns a branch string like this, and no pr_number
-        ("dianaclarke:ARROW-13266", None),
+        ("austin3dickey:main", None),
     ],
 )
 def test_get_github_commit_metadata_and_fork_point_sha_pull_request(branch, pr_number):
@@ -208,18 +208,18 @@ def test_get_github_commit_metadata_and_fork_point_sha_pull_request(branch, pr_n
     if not os.getenv("GITHUB_API_TOKEN"):
         pytest.skip("No GITHUB_API_TOKEN given so we won't hit the GitHub API")
 
-    repo = "https://github.com/apache/arrow"
-    sha = "982023150ccbb06a6f581f6797c017492485b58c"
+    repo = "https://github.com/conbench/conbench"
+    sha = "f72178f50ce297cc7b99b30541c9e3415b7a29a2"
 
     expected = {
-        "parent": "c8668f85a465ea05b2724ec47ff72c4db4d7dfe6",
-        "date": datetime.datetime(2021, 7, 6, 21, 51, 48, tzinfo=timezone.utc),
-        "message": "ARROW-13266: [JS] Improve benchmark names",
-        "author_name": "Diana Clarke",
-        "author_login": "dianaclarke",
-        "author_avatar": "https://avatars.githubusercontent.com/u/878798?v=4",
-        "branch": "dianaclarke:ARROW-13266",
-        "fork_point_sha": "780e95c512d63bbea1e040af0eb44a0bf63c4d72",
+        "parent": "6002fd15fb7b660ed85499888ecdc6ff0b32b0ff",
+        "date": datetime.datetime(2023, 11, 9, 19, 33, 46, tzinfo=timezone.utc),
+        "message": "try this",
+        "author_name": "Austin Dickey",
+        "author_login": "austin3dickey",
+        "author_avatar": "https://avatars.githubusercontent.com/u/16600275?v=4",
+        "branch": "austin3dickey:main",
+        "fork_point_sha": "44e81d10f475e9468eaf488dbfe73a0b43d26adc",
     }
     try:
         result = get_github_commit_metadata(