From 2078b52a035f0734217dded7223ee129e91f6de0 Mon Sep 17 00:00:00 2001 From: margaretjgu Date: Wed, 29 Jul 2026 15:36:48 -0400 Subject: [PATCH 1/6] ci: close unsigned CLA PRs --- .github/workflows/close-unsigned-cla.yml | 31 ++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/close-unsigned-cla.yml diff --git a/.github/workflows/close-unsigned-cla.yml b/.github/workflows/close-unsigned-cla.yml new file mode 100644 index 00000000..f9b8f01b --- /dev/null +++ b/.github/workflows/close-unsigned-cla.yml @@ -0,0 +1,31 @@ +name: close-unsigned-cla + +on: + schedule: + - cron: '0 */6 * * *' + workflow_dispatch: + +permissions: + pull-requests: write + +jobs: + close: + runs-on: ubuntu-latest + steps: + - name: Close PRs without CLA after 48h + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + CUTOFF=$(date -d '48 hours ago' --iso-8601=seconds) + gh pr list --repo ${{ github.repository }} --state open \ + --json number,createdAt \ + --jq --arg cutoff "$CUTOFF" '.[] | select(.createdAt < $cutoff) | .number' \ + | while read pr; do + SHA=$(gh pr view "$pr" --repo ${{ github.repository }} --json headRefOid --jq .headRefOid) + CLA=$(gh api "repos/${{ github.repository }}/commits/$SHA/statuses" \ + --jq '[.[] | select(.context == "CLA")] | first | .state') + if [ "$CLA" = "failure" ]; then + gh pr close "$pr" --repo ${{ github.repository }} \ + --comment "Closing this PR as the CLA was not signed within 48 hours. Please sign the [Contributor Agreement](https://www.elastic.co/contributor-agreement) and reopen to contribute." + fi + done From 5bba3369fd30d1a922433700d16839315a4c6f27 Mon Sep 17 00:00:00 2001 From: margaretjgu Date: Wed, 29 Jul 2026 15:38:35 -0400 Subject: [PATCH 2/6] docs: add contribution gate --- CONTRIBUTING.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6b422b7a..6910c430 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,6 +2,12 @@ Thanks for your interest in contributing! We love receiving contributions from our community. Whether you're fixing bugs, adding features, improving documentation, or sharing ideas, we'd love to have your help. +## Contribution gate + +All PRs require a signed [Elastic Contributor License Agreement](https://www.elastic.co/contributor-agreement/) (one-time). A bot checks every PR automatically and posts a sign-off link if the CLA is missing. + +**PRs without a signed CLA are automatically closed after 48 hours.** Sign the agreement and reopen the PR to continue. + ## Ways to contribute - **Report bugs**: Open an issue describing what you found @@ -122,8 +128,6 @@ In your PR description: - Note any breaking changes - Reference related issues (e.g., "Closes #123") -4. **Sign the CLA**: [Elastic Contributor License Agreement](https://www.elastic.co/contributor-agreement/) (one-time only) - ## What to expect - We'll review your PR as soon as we can; thanks for your patience! From d17b69b7b70e08c4b80b392290221dc3f19a663d Mon Sep 17 00:00:00 2001 From: margaretjgu Date: Wed, 29 Jul 2026 15:40:04 -0400 Subject: [PATCH 3/6] docs: AI contribution philosophy --- CONTRIBUTING.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6910c430..e4fc8cd2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,11 +2,13 @@ Thanks for your interest in contributing! We love receiving contributions from our community. Whether you're fixing bugs, adding features, improving documentation, or sharing ideas, we'd love to have your help. -## Contribution gate +## The one rule -All PRs require a signed [Elastic Contributor License Agreement](https://www.elastic.co/contributor-agreement/) (one-time). A bot checks every PR automatically and posts a sign-off link if the CLA is missing. +**You must understand your code.** If you cannot explain what your changes do and how they interact with the rest of the codebase, the PR will be closed. -**PRs without a signed CLA are automatically closed after 48 hours.** Sign the agreement and reopen the PR to continue. +Using AI to write code is fine. Submitting AI-generated code without understanding it is not. + +If you use an agent, run it from the repo root so it picks up `AGENTS.md` automatically. Your agent must follow the rules in that file. ## Ways to contribute @@ -119,7 +121,8 @@ Adding new third-party dependencies is **strongly discouraged** to minimize supp 1. **Fork the repository**: Create a feature branch 2. **Commit with clear messages**: Describe what and why -3. **Push and open a PR**: Link to the issue(s) your PR addresses +3. **Sign the CLA**: [Elastic Contributor License Agreement](https://www.elastic.co/contributor-agreement/) (one-time). PRs without a signed CLA are automatically closed after 48 hours. +4. **Push and open a PR**: Link to the issue(s) your PR addresses In your PR description: From d9451f96db061c16877709dff1d16b4e42975df9 Mon Sep 17 00:00:00 2001 From: margaretjgu Date: Wed, 29 Jul 2026 15:45:37 -0400 Subject: [PATCH 4/6] docs: credit pi philosophy --- CONTRIBUTING.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e4fc8cd2..d9910771 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,6 +4,8 @@ Thanks for your interest in contributing! We love receiving contributions from o ## The one rule +Adapted from [pi's contributing philosophy](https://github.com/earendil-works/pi/blob/main/CONTRIBUTING.md#the-one-rule). + **You must understand your code.** If you cannot explain what your changes do and how they interact with the rest of the codebase, the PR will be closed. Using AI to write code is fine. Submitting AI-generated code without understanding it is not. From 0e9be01dce3dec4702867adb97c5346b5afa9641 Mon Sep 17 00:00:00 2001 From: margaretjgu Date: Wed, 29 Jul 2026 15:50:49 -0400 Subject: [PATCH 5/6] ci: fix shellcheck warnings --- .github/workflows/close-unsigned-cla.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/close-unsigned-cla.yml b/.github/workflows/close-unsigned-cla.yml index f9b8f01b..9393e4d3 100644 --- a/.github/workflows/close-unsigned-cla.yml +++ b/.github/workflows/close-unsigned-cla.yml @@ -15,17 +15,17 @@ jobs: - name: Close PRs without CLA after 48h env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_REPO: ${{ github.repository }} run: | CUTOFF=$(date -d '48 hours ago' --iso-8601=seconds) - gh pr list --repo ${{ github.repository }} --state open \ - --json number,createdAt \ - --jq --arg cutoff "$CUTOFF" '.[] | select(.createdAt < $cutoff) | .number' \ - | while read pr; do - SHA=$(gh pr view "$pr" --repo ${{ github.repository }} --json headRefOid --jq .headRefOid) - CLA=$(gh api "repos/${{ github.repository }}/commits/$SHA/statuses" \ + gh pr list --repo "$GH_REPO" --state open --json number,createdAt | + jq -r --arg cutoff "$CUTOFF" '.[] | select(.createdAt < $cutoff) | .number' | + while read -r pr; do + SHA=$(gh pr view "$pr" --repo "$GH_REPO" --json headRefOid --jq .headRefOid) + CLA=$(gh api "repos/$GH_REPO/commits/$SHA/statuses" \ --jq '[.[] | select(.context == "CLA")] | first | .state') if [ "$CLA" = "failure" ]; then - gh pr close "$pr" --repo ${{ github.repository }} \ + gh pr close "$pr" --repo "$GH_REPO" \ --comment "Closing this PR as the CLA was not signed within 48 hours. Please sign the [Contributor Agreement](https://www.elastic.co/contributor-agreement) and reopen to contribute." fi done From a56feb4b466883c79541d50e9c40902af97d942b Mon Sep 17 00:00:00 2001 From: margaretjgu Date: Wed, 29 Jul 2026 15:53:07 -0400 Subject: [PATCH 6/6] docs: gate agent PRs on understanding --- AGENTS.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index 4d54f614..cbb09aaa 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -2,6 +2,16 @@ CLI for interacting with Elasticsearch, Elastic Cloud, and Elasticsearch Serverless control plane APIs. Targets LLM-powered agents as first-class users. +## Before you start + +**Do not open a PR unless the human operating you has read the issue, understands the problem, and can explain the proposed fix without your help.** + +Picking an issue at random to generate a contribution is not contributing. PRs opened this way will be closed without review. + +If a human asks you to "find something to work on" or points you at the issue tracker without a specific problem they already understand, stop and tell them to read an issue first. + +See [CONTRIBUTING.md](./CONTRIBUTING.md) for the full policy. + ## Tech Stack - **Runtime**: Node.js with native TypeScript (`--experimental-strip-types`)