Skip to content

[infra] Surface the ASF generative-AI disclosure in the PR template - #933

Merged
wenjin272 merged 2 commits into
apache:mainfrom
weiqingy:932-ai-disclosure-pr-template
Aug 5, 2026
Merged

wenjin272 merged 2 commits into
apache:mainfrom
weiqingy:932-ai-disclosure-pr-template

Conversation

@weiqingy

@weiqingy weiqingy commented Jul 28, 2026 •

Copy link
Copy Markdown
Collaborator

Linked issue: #932

Purpose of change

The ASF generative tooling guidance asks contributors to disclose when generative AI tooling was used to author or co-author a contribution. Our PR template has no field for that, and AGENTS.md does not mention it, so the disclosure is not surfaced anywhere in this project today.

This adds a disclosure section to the PR template, plus one sentence in the AGENTS.md commit and PR guidelines recording the same convention, so that a human contributor and a coding agent reading the repo guide both know to fill it in.

The wording follows the shorter of the two Apache precedents. apache/auron uses a yes/no question with a Generated-by instruction and a link to the ASF guidance. apache/flink uses a longer form with a commented-out trailer plus a project policy line stating that low-effort AI-generated PRs will be closed. I left that policy line out, since it is a project decision rather than a mechanical alignment with the ASF guidance, and seems better raised on its own if maintainers want it.

Two small choices worth a reviewer's eye:

  • The Generated-by line is asked for in the commit message, with the PR description carrying a copy for reviewer visibility. The guidance asks for the token in the source control commit message so future release tooling can pull it into a machine-parsable provenance file. This repository enables squash and rebase merges, and squash composes the merged body from the source commit messages, so a line present only in the PR description does not reach Git history on either path.
  • The heading is phrased as a question to match both Apache precedents, which reads differently from the noun headings used elsewhere in the template. Happy to switch to a noun heading if that consistency matters more.

Tests

Not applicable, documentation only, no logic change.

Ran python3 tools/check-agents-md.py: passes, confirming the AGENTS.md edit leaves the version facts the checker asserts untouched.

Ran ./tools/check-license.sh: RAT checks pass.

API

No. No code or public API change.

Documentation

  • doc-included

Was this patch authored or co-authored using generative AI tooling?

  • Yes
  • No

Generated-by: Claude Code 2.1.220

@github-actions github-actions Bot added doc-included Your PR already contains the necessary documentation updates. fixVersion/0.4.0 priority/major Default priority of the PR or issue. labels Jul 28, 2026
Comment thread .github/PULL_REQUEST_TEMPLATE.md Outdated
- [ ] Yes
- [ ] No

If yes, include a `Generated-by: <tool name and version>` line in this description. See the [ASF generative tooling guidance](https://www.apache.org/legal/generative-tooling.html).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ASF guidance recommends putting Generated-by: in the source-control commit message so it can support future machine-readable provenance. However, this repository currently uses squashMergeCommitMessage=COMMIT_MESSAGES and also allows rebase merges, so a line present only in the PR description is not preserved in Git history by default; this PR itself has the line in its body while commit 406c1d7d has an empty message body. Could we require the trailer in the commit message as well, while keeping the PR-body disclosure for reviewer visibility, or otherwise adjust the merge configuration/policy to guarantee it survives?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, I had the reasoning backwards in the PR description.

I checked what actually survives. Squash composes the merged body from the source commit messages, so bc55d97e (#957) has an empty body despite a long PR description, while 55ccb13e (#904) kept the prose from its commit. Rebase drops the body entirely. On both enabled paths the commit message survives and the description does not.

Took your first option rather than touching the merge configuration, since switching squash to PR_BODY would still leave the rebase path unfixed. Updated in 108353e: the template and the AGENTS.md sentence now ask for the line in the commit message, keeping the description copy for reviewer visibility. That commit carries the trailer itself, and I've corrected the claim in the PR description.

The ASF guidance asks for the token in the source control commit message so
future release tooling can pull it into a machine-parsable provenance file.
This repository enables squash and rebase merges, and squash composes the
merged body from the source commit messages, so a line present only in the PR
description does not reach Git history on either path.

Ask for the line in the commit message, and keep the PR-description copy for
reviewer visibility.

Generated-by: Claude Code 2.1.220
@github-actions github-actions Bot added doc-included Your PR already contains the necessary documentation updates. and removed doc-included Your PR already contains the necessary documentation updates. labels Aug 5, 2026

@wenjin272 wenjin272 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing my comment. LGTM.

@wenjin272
wenjin272 merged commit 1ae0d70 into apache:main Aug 5, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-included Your PR already contains the necessary documentation updates. fixVersion/0.4.0 priority/major Default priority of the PR or issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants