You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datafusion.apache.org by gi...@apache.org on 2026/10/02 20:32:23 UTC

(datafusion-comet) branch gh-readonly-queue/main/pr-6409-0fdfaad708d5c82195269134e0621dd959e2c0c9 created (now aa02995e9e)

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

github-merge-queue[bot] pushed a change to branch gh-readonly-queue/main/pr-6409-0fdfaad708d5c82195269134e0621dd959e2c0c9
in repository https://gitbox.apache.org/repos/asf/datafusion-comet.git


      at aa02995e9e ci: grant label runs the contents: write the docs job requests (#6409)

This branch includes the following new commits:

     new aa02995e9e ci: grant label runs the contents: write the docs job requests (#6409)

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datafusion.apache.org
For additional commands, e-mail: commits-help@datafusion.apache.org


(datafusion-comet) 01/01: ci: grant label runs the contents: write the docs job requests (#6409)

Posted by gi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

github-merge-queue[bot] pushed a commit to branch gh-readonly-queue/main/pr-6409-0fdfaad708d5c82195269134e0621dd959e2c0c9
in repository https://gitbox.apache.org/repos/asf/datafusion-comet.git

commit aa02995e9e106c755acaaadaa14f96658fbd370e
Author: Andy Grove <ag...@apache.org>
AuthorDate: Fri Oct 2 20:32:01 2026 +0000

    ci: grant label runs the contents: write the docs job requests (#6409)
    
    Every "Comet CI (label run)" has failed with startup_failure since #4950
    gave ci.yml's `docs` job `contents: write`. ci_label.yml calls ci.yml
    with an explicit `permissions:` ceiling of `contents: read`, and GitHub
    refuses to start a run when any job in the called workflow asks for more
    than the caller grants, including a job the event would skip. So no
    `run-*` label has run anything since.
    
    Raise the grant to `contents: write`. The docs job only runs on main, a
    pull request from a fork gets a read-only token regardless, and every
    other job in ci.yml still narrows itself to what it needs.
    
    check-ci-config.py now compares every `permissions:` block in ci.yml
    against the grant in ci_label.yml, so the next job that asks for more
    fails preflight instead of silently disabling the labels.
---
 .github/workflows/ci_label.yml |  8 +++++---
 dev/ci/check-ci-config.py      | 46 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 51 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/ci_label.yml b/.github/workflows/ci_label.yml
index 6af3e91928..9530666b39 100644
--- a/.github/workflows/ci_label.yml
+++ b/.github/workflows/ci_label.yml
@@ -47,10 +47,12 @@ jobs:
     # A called workflow's jobs can hold no more than the caller grants, and
     # GitHub checks that for every job when the run starts, including the
     # ones this event skips. This is the union of what ci.yml's jobs request:
-    # `changes` and `nightly_report` read the Actions API, and
-    # `nightly_report` files issues (it only runs on the schedule).
+    # `changes` and `nightly_report` read the Actions API, `nightly_report`
+    # files issues (it only runs on the schedule), and `docs` pushes the built
+    # site to asf-site (it only runs on main). Leaving any of them out fails
+    # every label run at startup, before a single job runs.
     permissions:
       actions: read
-      contents: read
+      contents: write
       issues: write
     uses: ./.github/workflows/ci.yml
diff --git a/dev/ci/check-ci-config.py b/dev/ci/check-ci-config.py
index 3cf407f152..3832fda92d 100644
--- a/dev/ci/check-ci-config.py
+++ b/dev/ci/check-ci-config.py
@@ -1202,11 +1202,57 @@ def check_label_runs_separate():
                 f"and nothing else; any other type would run ci.yml twice per push"
             )
 
+    # ci_label.yml calls ci.yml with an explicit `permissions:` ceiling, and
+    # GitHub refuses to start the run at all if any job in ci.yml asks for more,
+    # even a job the `labeled` event would skip. That is how the `docs` job's
+    # `contents: write` stopped every label run on 2026-09-29.
+    if label_workflow.exists():
+        granted = permission_blocks(label_workflow.read_text(encoding="utf-8").splitlines())
+        ceiling = {}
+        for block in granted:
+            for scope, level in block.items():
+                ceiling[scope] = max(ceiling.get(scope, 0), PERMISSION_RANK[level])
+        ci = (WORKFLOWS / "ci.yml").read_text(encoding="utf-8").splitlines()
+        for block in permission_blocks(ci):
+            for scope, level in block.items():
+                if PERMISSION_RANK[level] > ceiling.get(scope, 0):
+                    failures.append(
+                        f"ci.yml requests `{scope}: {level}`, but ci_label.yml grants "
+                        f"the call at most `{scope}: "
+                        f"{PERMISSION_NAME[ceiling.get(scope, 0)]}`, so every label "
+                        f"run fails at startup. Raise the grant in ci_label.yml"
+                    )
+
     for failure in failures:
         print(f"label runs: {failure}")
     return not failures
 
 
+PERMISSION_RANK = {"none": 0, "read": 1, "write": 2}
+PERMISSION_NAME = {rank: name for name, rank in PERMISSION_RANK.items()}
+PERMISSIONS_KEY = re.compile(r"^(\s*)permissions:\s*(\{\s*\})?\s*$")
+PERMISSION_ENTRY = re.compile(r"^(\s*)([a-z-]+):\s*(read|write|none)\s*$")
+
+
+def permission_blocks(lines):
+    """Every `permissions:` mapping in a workflow, as a list of {scope: level}."""
+    blocks = []
+    for index, line in enumerate(lines):
+        match = PERMISSIONS_KEY.match(line)
+        if not match:
+            continue
+        indent, block = len(match.group(1)), {}
+        for entry in lines[index + 1:]:
+            if not entry.strip() or entry.lstrip().startswith("#"):
+                continue
+            found = PERMISSION_ENTRY.match(entry)
+            if not found or len(found.group(1)) <= indent:
+                break
+            block[found.group(2)] = found.group(3)
+        blocks.append(block)
+    return blocks
+
+
 def caller_passes_cache_refresh(ci_lines, workflow_name):
     """Does the ci.yml job that `uses:` this workflow set `cache-refresh-only:`?"""
     job_start = None


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datafusion.apache.org
For additional commands, e-mail: commits-help@datafusion.apache.org