From f71e1dae29d1be80e95843e3b0af50af457bc5b2 Mon Sep 17 00:00:00 2001 From: Andres Javier Lopez Date: Fri, 3 Oct 2025 16:32:49 -0600 Subject: [PATCH 1/6] Add validations for new PRs --- .github/PULL_REQUEST_TEMPLATE.md | 31 +++++++++++++++++ .github/copilot-instructions.md | 18 ++++++++++ .github/workflows/validate-pr.yml | 57 +++++++++++++++++++++++++++++++ 3 files changed, 106 insertions(+) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/copilot-instructions.md create mode 100644 .github/workflows/validate-pr.yml diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..0520678 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,31 @@ + + +## Description + +A short description of the change. Link to any relevant issue(s) or RFC. + +## Type of change +- [ ] Bugfix +- [ ] New feature +- [ ] Documentation update +- [ ] Refactor +- [ ] Chore + +## Checklist +Please run through the checklist and mark the items off before requesting review. These mirror the project's `CONTRIBUTING.md` guidelines. + +- [ ] Tests added/updated for changes in behavior +- [ ] Linter/formatter run (make format / make lint) +- [ ] Documentation updated (if applicable) +- [ ] CHANGELOG.md updated with a short entry describing the change (Required) + +If your change requires special setup or steps to verify, include them below. + +## How to test +Describe steps to reproduce or to run the test suite for the change. + +## Additional context +Any additional information for reviewers, e.g. performance notes or tradeoffs. diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 0000000..46373fd --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,18 @@ +# GitHub Copilot custom instructions for assistant_core contributors +# This file provides guidance to GitHub Copilot (and human reviewers) about +# repository conventions and PR requirements. + +project: assistant_core + +instructions: + - When suggesting code changes or PR descriptions, ensure the contributor adds + a concise CHANGELOG.md entry under the NEXT section that explains what + changed and why. + + - Remind contributors to follow `CONTRIBUTING.md`: + - Run tests and add tests for behavior changes. + - Run formatters and linters (make format / make lint). + - Update documentation where applicable. + + - If the suggestion touches public APIs or behavior, encourage adding + typed signatures and small unit tests. diff --git a/.github/workflows/validate-pr.yml b/.github/workflows/validate-pr.yml new file mode 100644 index 0000000..0263232 --- /dev/null +++ b/.github/workflows/validate-pr.yml @@ -0,0 +1,57 @@ +name: Validate PR + +on: + pull_request: + types: [opened, edited, synchronize, reopened] + +jobs: + validate: + runs-on: ubuntu-latest + steps: + - name: Checkout PR + uses: actions/checkout@v4 + + - name: Validate CHANGELOG and PR body + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + set -euo pipefail + + # Check that CHANGELOG.md is modified in this PR + echo "Checking for CHANGELOG.md updates..." + files_changed=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} || true) + echo "Files changed:\n$files_changed" + + if ! echo "$files_changed" | grep -qE "(^|/)CHANGELOG.md$"; then + echo "ERROR: Please add an entry to CHANGELOG.md describing your change." + exit 1 + fi + + # Ensure PR body includes the required checklist items from CONTRIBUTING.md + echo "Checking PR body for required checklist..." + pr_body="${{ github.event.pull_request.body || '' }}" + + required_items=( + "Tests added/updated" + "Linter/formatter run" + "Documentation updated" + "CHANGELOG.md updated" + ) + + missing=() + for item in "${required_items[@]}"; do + if ! echo "$pr_body" | grep -qiF "$item"; then + missing+=("$item") + fi + done + + if [ ${#missing[@]} -ne 0 ]; then + echo "ERROR: PR body is missing the following checklist items:" >&2 + for m in "${missing[@]}"; do + echo " - $m" >&2 + done + echo "Please update the PR description to include the checklist (see CONTRIBUTING.md)." >&2 + exit 1 + fi + + echo "Validation passed." From 229fa042d104e8b686a10059485888ef90aa5953 Mon Sep 17 00:00:00 2001 From: Andres Javier Lopez Date: Fri, 3 Oct 2025 16:35:02 -0600 Subject: [PATCH 2/6] Rename template --- .github/{PULL_REQUEST_TEMPLATE.md => pull_request_template.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{PULL_REQUEST_TEMPLATE.md => pull_request_template.md} (100%) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/pull_request_template.md similarity index 100% rename from .github/PULL_REQUEST_TEMPLATE.md rename to .github/pull_request_template.md From 948cec4f7db5dc03a82fe0b8bdfe7fbcf4aab612 Mon Sep 17 00:00:00 2001 From: Andres Javier Lopez Date: Fri, 3 Oct 2025 16:35:26 -0600 Subject: [PATCH 3/6] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a72bd04..af404bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # CHANGELOG ## NEXT +* Add validation for new PRs * Add a builder that adds a prompt with the date and time * Add option to control entry point on builder * OpenAI responses API is enabled by default From d08735209d7052b8d0ab483fcd4199562a2e6963 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Javier=20L=C3=B3pez?= Date: Fri, 3 Oct 2025 16:40:04 -0600 Subject: [PATCH 4/6] Update .github/workflows/validate-pr.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/validate-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validate-pr.yml b/.github/workflows/validate-pr.yml index 0263232..a285d6b 100644 --- a/.github/workflows/validate-pr.yml +++ b/.github/workflows/validate-pr.yml @@ -19,7 +19,7 @@ jobs: # Check that CHANGELOG.md is modified in this PR echo "Checking for CHANGELOG.md updates..." - files_changed=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} || true) + files_changed=$(git diff --name-only origin/${{ github.base_ref }}..HEAD || true) echo "Files changed:\n$files_changed" if ! echo "$files_changed" | grep -qE "(^|/)CHANGELOG.md$"; then From b3f4ba8328725620a1627564985452b9de0aa403 Mon Sep 17 00:00:00 2001 From: Andres Javier Lopez Date: Fri, 3 Oct 2025 16:41:34 -0600 Subject: [PATCH 5/6] Fix github action --- .github/workflows/validate-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validate-pr.yml b/.github/workflows/validate-pr.yml index a285d6b..d1cbc0b 100644 --- a/.github/workflows/validate-pr.yml +++ b/.github/workflows/validate-pr.yml @@ -19,7 +19,7 @@ jobs: # Check that CHANGELOG.md is modified in this PR echo "Checking for CHANGELOG.md updates..." - files_changed=$(git diff --name-only origin/${{ github.base_ref }}..HEAD || true) + files_changed=$(git diff --name-only origin/${{ github.base_ref }}.HEAD || true) echo "Files changed:\n$files_changed" if ! echo "$files_changed" | grep -qE "(^|/)CHANGELOG.md$"; then From 5ba0f0135e522e8f48e08b2bbd43df27a9692d32 Mon Sep 17 00:00:00 2001 From: Andres Javier Lopez Date: Fri, 3 Oct 2025 16:42:26 -0600 Subject: [PATCH 6/6] Remove github action from validation --- .github/workflows/validate-pr.yml | 57 ------------------------------- 1 file changed, 57 deletions(-) delete mode 100644 .github/workflows/validate-pr.yml diff --git a/.github/workflows/validate-pr.yml b/.github/workflows/validate-pr.yml deleted file mode 100644 index d1cbc0b..0000000 --- a/.github/workflows/validate-pr.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: Validate PR - -on: - pull_request: - types: [opened, edited, synchronize, reopened] - -jobs: - validate: - runs-on: ubuntu-latest - steps: - - name: Checkout PR - uses: actions/checkout@v4 - - - name: Validate CHANGELOG and PR body - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - set -euo pipefail - - # Check that CHANGELOG.md is modified in this PR - echo "Checking for CHANGELOG.md updates..." - files_changed=$(git diff --name-only origin/${{ github.base_ref }}.HEAD || true) - echo "Files changed:\n$files_changed" - - if ! echo "$files_changed" | grep -qE "(^|/)CHANGELOG.md$"; then - echo "ERROR: Please add an entry to CHANGELOG.md describing your change." - exit 1 - fi - - # Ensure PR body includes the required checklist items from CONTRIBUTING.md - echo "Checking PR body for required checklist..." - pr_body="${{ github.event.pull_request.body || '' }}" - - required_items=( - "Tests added/updated" - "Linter/formatter run" - "Documentation updated" - "CHANGELOG.md updated" - ) - - missing=() - for item in "${required_items[@]}"; do - if ! echo "$pr_body" | grep -qiF "$item"; then - missing+=("$item") - fi - done - - if [ ${#missing[@]} -ne 0 ]; then - echo "ERROR: PR body is missing the following checklist items:" >&2 - for m in "${missing[@]}"; do - echo " - $m" >&2 - done - echo "Please update the PR description to include the checklist (see CONTRIBUTING.md)." >&2 - exit 1 - fi - - echo "Validation passed."