|
| 1 | +# Contributing to Montage |
| 2 | + |
| 3 | +Montage is a small project maintained by volunteers. Contributions are welcome — please read this before opening a PR. |
| 4 | + |
| 5 | +We follow the [Wikimedia technical spaces Code of Conduct](https://www.mediawiki.org/wiki/Code_of_Conduct). |
| 6 | + |
| 7 | +## Getting started |
| 8 | + |
| 9 | +Check the [open issues](https://github.com/hatnote/montage/issues) for something to pick up. Issues tagged [`good-first-issue`](https://github.com/hatnote/montage/issues?q=is%3Aissue+is%3Aopen+label%3Agood-first-issue) are a good starting point. |
| 10 | + |
| 11 | +Before writing any code, leave a comment on the issue to let maintainers know you're working on it and to confirm the approach. If no issue exists for what you want to do, open one first. **Do not open a PR without a corresponding issue that has received a response from a maintainer** — especially if you are a new contributor. This avoids wasted effort on both sides. |
| 12 | + |
| 13 | +See [dev.md](dev.md) for local setup instructions. |
| 14 | + |
| 15 | +## Before opening a PR |
| 16 | + |
| 17 | +Follow the setup instructions in [dev.md](dev.md), including installing pre-commit hooks and running tests locally. Make sure tests pass before opening a PR. |
| 18 | + |
| 19 | +## Pull request expectations |
| 20 | + |
| 21 | +- CI must pass |
| 22 | +- One focused change per PR — link the issue it addresses (`Fixes #NNN`) |
| 23 | +- If your PR adds or changes database columns, include the SQL migration and flag it in the PR description |
| 24 | +- Do not commit screenshots, generated files, or large binaries |
| 25 | + |
| 26 | +## Code quality |
| 27 | + |
| 28 | +- Follow existing patterns in the file you're editing |
| 29 | +- Backend: read `montage/rdb.py` before writing queries — column names are authoritative there. Note that `.filter()` and `.order_by()` return new objects — always reassign |
| 30 | +- Backend: write code that works with both MySQL (production) and SQLite (tests) — no MySQL-only syntax |
| 31 | +- Frontend: use Composition API with `<script setup>` — no Options API |
| 32 | +- All user-facing strings must go in `frontend/src/i18n/en.json` and use `t('key')` — TranslateWiki handles other locales, do not edit them manually |
| 33 | + |
| 34 | +## When to open a PR for review |
| 35 | + |
| 36 | +Only open a PR for review when you consider it ready to merge. If your work is still in progress, open it as a **draft PR** — maintainers will not review draft PRs. |
| 37 | + |
| 38 | +A PR is ready for review when: |
| 39 | +- It does one thing and does it completely |
| 40 | +- CI passes |
| 41 | +- You have tested it yourself and are confident it works |
| 42 | +- You would be comfortable if it were merged as-is |
| 43 | + |
| 44 | +Do not open a PR to ask for direction or feedback on an approach — use the issue for that conversation first. |
| 45 | + |
| 46 | +## Deployment |
| 47 | + |
| 48 | +Only maintainers have access to the three Toolforge environments: |
| 49 | + |
| 50 | +| Environment | Purpose | |
| 51 | +|-------------|---------| |
| 52 | +| montage-dev | Flexible test environment — maintainers can deploy any branch here | |
| 53 | +| montage-beta | Tracks `master` — used by volunteers to catch bugs before production | |
| 54 | +| montage-prod | Stable production — promoted manually when beta is stable | |
| 55 | + |
| 56 | +Contributors do not need Toolforge access. Push your branch to GitHub and open a PR against `master`. A maintainer can then deploy your branch to montage-dev to test it — either in isolation or combined with other PRs to check interaction effects. |
| 57 | + |
| 58 | +## Questions |
| 59 | + |
| 60 | +Leave a comment on the relevant GitHub issue, or reach out on [Commons talk:Montage](https://commons.wikimedia.org/wiki/Commons_talk:Montage). |
0 commit comments