|
| 1 | +# Merging Community Changes |
| 2 | + |
| 3 | +Community maintainers can merge a pull request (PR) that changes **only their own |
| 4 | +community's directory** into `develop` themselves, by leaving an explicit |
| 5 | +comment. No platform admin is needed for routine community changes. |
| 6 | + |
| 7 | +This only removes the human-approval step; the normal CI checks (ruff + tests) |
| 8 | +still gate the merge. Releases to production (`develop` to `main`) are still done |
| 9 | +by an OSA admin, so `main` never diverges from the integrated `develop` branch. |
| 10 | + |
| 11 | +## Who can do this |
| 12 | + |
| 13 | +Anyone listed in the `maintainers:` field of your community's |
| 14 | +`src/assistants/<your-id>/config.yaml`. The list is read from the **base branch** |
| 15 | +(the already-merged code), so it cannot be changed by the PR itself. |
| 16 | + |
| 17 | +```yaml |
| 18 | +# src/assistants/hed/config.yaml |
| 19 | +maintainers: |
| 20 | + - VisLab |
| 21 | + - yarikoptic |
| 22 | +``` |
| 23 | +
|
| 24 | +## How to merge |
| 25 | +
|
| 26 | +1. Open a PR against **`develop`** that changes only files inside your community |
| 27 | + directory, `src/assistants/<your-id>/` (`config.yaml`, `tools.py`, prompts, |
| 28 | + `logo.svg`, etc.). The PR does not have to be authored by you; it can be from |
| 29 | + any contributor. |
| 30 | +2. Review it. When you (a listed maintainer) are ready to merge, post a PR |
| 31 | + **comment** containing both keywords **`LGTM`** and **`merge`**, for example: |
| 32 | + |
| 33 | + > LGTM, please merge |
| 34 | + |
| 35 | + Casing does not matter, and any phrasing works as long as both words appear. |
| 36 | + To explicitly hold off, include "do not merge" / "don't merge" and it will not |
| 37 | + fire. |
| 38 | +3. The bot approves the PR and queues a **squash auto-merge**. The PR merges |
| 39 | + automatically once ruff and the tests pass, and a confirmation comment is |
| 40 | + posted. |
| 41 | + |
| 42 | +That is the whole flow. Nothing merges when the PR is opened; the comment is the |
| 43 | +deliberate signal, so a PR can sit in review for as long as you like. |
| 44 | + |
| 45 | +## What is eligible |
| 46 | + |
| 47 | +A comment merges the PR only when **all** of these hold: |
| 48 | + |
| 49 | +- The comment is from a listed maintainer of the target community. |
| 50 | +- Every changed file is under a single `src/assistants/<id>/` directory (one |
| 51 | + community, nothing outside it, including a rename's original path). |
| 52 | +- The PR does **not** change the `maintainers:` field. Adding or removing a |
| 53 | + maintainer always needs human review by a platform admin. |
| 54 | +- The PR targets `develop` (not `main`). |
| 55 | +- All required status checks pass (the bot waits for them; it never bypasses CI). |
| 56 | + |
| 57 | +If any condition is not met, the comment simply does nothing and the PR follows |
| 58 | +the normal review process. |
| 59 | + |
| 60 | +## Safety notes |
| 61 | + |
| 62 | +- **Pinned to the reviewed commit.** The merge is tied to the exact commit the |
| 63 | + `LGTM ... merge` comment was made on. If new commits are pushed afterward, the |
| 64 | + queued merge is cancelled and a fresh `LGTM ... merge` comment is required. This |
| 65 | + prevents getting an approval on a clean diff and then slipping in changes. |
| 66 | +- **Maintainers list is the source of truth.** It is hand-maintained in each |
| 67 | + community's `config.yaml` and is not synced to GitHub Teams. Whoever is listed |
| 68 | + there is trusted to merge changes to that community's directory. |
| 69 | +- **Develop only.** Community changes never reach `main` automatically; an OSA |
| 70 | + admin merges `develop` to `main` as part of a release. |
| 71 | + |
| 72 | +## For platform admins |
| 73 | + |
| 74 | +The mechanism is a GitHub Actions workflow |
| 75 | +(`.github/workflows/community-admin-pr-merge.yml`) plus a dedicated GitHub App |
| 76 | +that performs the approve and merge with a short-lived token. The one-time App |
| 77 | +setup and the full trust model are documented in the OSA repository at |
| 78 | +`.context/community-admin-merge.md`. |
0 commit comments