rangareddy opened a new issue, #858:
URL: https://github.com/apache/incubator-xtable/issues/858

   ## Problem
   
   Commits should not credit AI assistants (e.g. Claude) as co-authors. Today 
this relies on reviewers spotting a `Co-authored-by: Claude ...` trailer by 
eye. We should add an automated CI guard so PR commits carrying such a trailer 
fail a check instead.
   
   Apache Hudi just added exactly this — see **apache/hudi#19134** (`chore(ci): 
add commit co-author validation as a required PR check`). This issue proposes 
adapting it for XTable.
   
   ## Proposal
   
   1. Add a GitHub Actions workflow 
`.github/workflows/commit_coauthor_validation.yml` with a 
`validate-commit-coauthor` job that runs on `pull_request` events targeting 
`main`. It lists the PR's commits via the GitHub API and fails if any commit 
message contains a `Co-authored-by:` trailer that either uses the 
`[email protected]` email or names a Claude model. A human co-author with a 
personal email (even one named "Claude") is **not** flagged.
   
   2. Register `validate-commit-coauthor` as a required status check on `main` 
in `.asf.yaml` (XTable's `.asf.yaml` currently has 
`protected_branches.main.required_pull_request_reviews` but no 
`required_status_checks` block, so that block needs adding).
   
   ### Draft workflow (adapted from Hudi #19134 for XTable's `main` branch)
   
   ```yaml
   name: Commit Co-author Validation
   
   on:
     pull_request:
       types: [opened, reopened, synchronize]
       branches:
         - main
   
   concurrency:
     group: commit-coauthor-validation-${{ github.ref }}
     cancel-in-progress: ${{ !contains(github.ref, 'main') }}
   
   jobs:
     validate-commit-coauthor:
       runs-on: ubuntu-latest
       steps:
         - name: Check commits for Claude co-author trailers
           env:
             GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
             REPO: ${{ github.repository }}
             PR_NUMBER: ${{ github.event.pull_request.number }}
           run: |
             echo "Checking commits of PR #${PR_NUMBER} for Claude co-author 
trailers..."
             flagged=$(gh api "repos/${REPO}/pulls/${PR_NUMBER}/commits" 
--paginate \
               --jq '.[] | select(.commit.message | 
test("(^|\\n)co-authored-by:\\s*(claude\\s+(opus|sonnet|haiku|fable|mythos|instant|code|[0-9])|[^\\n]*<noreply@anthropic\\.com>)";
 "i")) | .sha')
   
             if [[ -n "$flagged" ]]; then
               echo "❌ The following commits contain a Claude co-author 
trailer:"
               echo "$flagged"
               echo ""
               echo "Commits must not credit Claude as a co-author."
               echo "Remove the 'Co-authored-by: Claude ...' trailer from the 
commit message(s),"
               echo "e.g., by amending the commit or rebasing, and force-push 
the branch."
               exit 1
             fi
   
             echo "✅ No Claude co-author trailers found."
   ```
   
   ### `.asf.yaml` change (make it required on `main`)
   
   ```yaml
     protected_branches:
       main:
         required_pull_request_reviews:
           required_approving_review_count: 1
         required_status_checks:
           contexts:
             - validate-commit-coauthor
   ```
   
   ## Other workflows from Hudi worth adopting
   
   While reviewing [Hudi's 
`.github/workflows`](https://github.com/apache/hudi/tree/master/.github/workflows),
 these are present in Hudi but missing from XTable (XTable currently has only 
`mvn-ci-build`, `mvn-license-check`, `package-deploy`, `site-build`, 
`site-deploy`). Candidate follow-ups:
   
   - **`pr_title_validation.yml`** — enforce a PR-title convention. XTable 
already uses a `[<issue#>] <summary>` convention informally; a check could 
enforce it.
   - **`pr_compliance.yml`** / **`update_pr_compliance.yml`** — validate the PR 
description/checklist is filled in.
   - **`maven_artifact_validation.yml`** — validate published Maven artifacts 
(poms, signatures, sources/javadoc) — useful given XTable's shaded-jar release 
process.
   - **`release_candidate_validation.yml`** — validate release-candidate 
artifacts before a vote.
   - **`bot.yml` + `labeler.js`** — auto-label PRs by changed paths.
   - **`scheduled_workflow.yml`** — a cron workflow (e.g. stale-issue handling, 
nightly checks).
   
   Suggest scoping this issue to the co-author validation (concrete, low-risk, 
CI-only) and tracking the others separately if there's interest.
   
   ## Impact / Risk
   
   CI/process only, no code or user-facing changes. The check is read-only 
(GitHub API listing of PR commits). Low risk.
   
   _Reference: apache/hudi#19134_
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to