Repository navigation
Shared contributing guide for repos and boilerplate fixes - #18
Merged
Merged
Conversation
…emplate The guide describes the tooling the template ships (Makefile, Docker, uv), so it lives here, next to it, instead of in pipe-docs or in a copy per project. - CONTRIBUTING.md and docs/contributing/: take pipe-docs' newer version and make it apply to services as well as pipelines. The guide starts from the cloned repository; the README has the clone step. Requirements are compiled with uv pip compile, not pip-tools, and the venv activation script is sourced (running ./.venv/bin/activate only affects a subshell). - init_project.py: remove CONTRIBUTING.md and docs/contributing/ from new projects, and keep links to the template's guide when renaming, so new READMEs point to it. - README: clone step with the repository's URL (renamed by init_project.py), then a link to the guide; mention uv instead of pip-tools.
The codespell package's module is codespell_lib; python -m codespell fails with 'No module named codespell'. pipe-anchorages already uses codespell_lib.
uv reimplements pip-compile's interface without using pip-tools, so the dev dependency was unused. The reqs targets' help now says uv.
- The "Python 3.13" job ran on 3.12: make uv pins .python-version to 3.12 and uv venv follows it. Pass the matrix version to uv venv. - Codecov never uploaded: the condition required Python 3.12, which isn't in the matrix. Upload on main, as pipe-anchorages does; drop develop. - actions/checkout@v6 in the Docker job too.
The dev stage runs COPY . ., so a local .venv (157 MB here) and .git ended up in the dev image. pipe-anchorages and pipe-gaps already exclude them.
Without it, uv creates local venvs with the newest Python it finds, while the Docker image runs 3.12. It's the same version make uv pins, so running make uv leaves it unchanged. pipe-anchorages tracks it for the same reason.
The triggers come from gfw-terraform-modules' cloudbuild-trigger module, which defines the build itself (buildx, --target prod), so cloudbuild.yaml was unused. cloudbuild/ has the same setup as pipe-encounters and pipe-anchorages (module v0.6.7), and init_project.py renames the project in it. The README says how to create the triggers, and .dockerignore leaves cloudbuild/ (and its local .terraform cache) out of the build context.
- Drop pyyaml, rich and rich-argparse (and types-PyYAML): nothing imports them, and every project created from the template inherited them. - requires-python >= 3.12 with 3.12 and 3.13 classifiers, matching the Docker image, .python-version, the ruff/black targets and the README badge. - Changelog URL points to the GitHub releases; CHANGELOG.md doesn't exist. - Drop coverage's parallel mode, as pipe-anchorages did.
…hooks - README: the CLI lives in cli/main.py; examples/ and pytest.ini no longer exist; Continuous Deployment is CD; stray period in a heading. - .gitignore: drop test/ (it silently ignored any test/ folder a project creates), scripts/config.sh (from another project) and .ipynb (.ipynb_checkpoints is already ignored). - pre-commit-hooks v6.0.0. - Makefile: hooks no longer installs a commit-msg hook; none is configured (commitizen is commented out).
…own hooks The end-of-file-fixer and trailing-whitespace hooks failed on the template itself. trailing-whitespace now keeps Markdown line breaks (two trailing spaces) with --markdown-linebreak-ext=md.
requirements-test.txt held hand-written ranges that nothing compiled or upgraded, so test runs weren't reproducible and Dependabot only saw a problem when a range blocked the fix (pytest <9.0.3, tmpdir advisory). - pyproject.toml: a PEP 735 "test" dependency group (not published with the package), with pytest ~=9.0 and pytest-cov ~=7.0. - requirements-test.txt is now compiled from it with uv, against the pins in requirements.txt, so the test image still installs just the test dependencies on top of the production image. make reqs and make reqs-upgrade compile both files. - The reqs containers run as the host user, so the compiled files written into the repo aren't owned by root. - CONTRIBUTING.md and README describe the workflow.
tomaslink
force-pushed
the
PIPELINE-4672-shared-contributing-guide
branch
from
October 16, 2026 19:13
bb87df5 to
9a5102b
Compare
tomaslink
added this pull request to stack #20
October 16, 2026 19:26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PIPELINE-4672
Summary
Makes this template's
CONTRIBUTING.mdthe single contributing guide for every repo created from it (pipelines and services), and ports the boilerplate fixes found while standardizing pipe-encounters (PIPELINE-3367) and pipe-anchorages.Shared contributing guide
CONTRIBUTING.mdanddocs/contributing/take pipe-docs' newer text, made generic for services as well as pipelines. The guide describes the tooling this template ships (Makefile, Docker, uv), so it lives here, next to it.init_project.py), then a link to the guide.init_project.pyremovesCONTRIBUTING.mdanddocs/contributing/from new projects and keeps links to the template's guide when renaming.uv pip compile(uv doesn't use pip-tools), and the venv is activated with. .venv/bin/activate(executing./.venv/bin/activatefails, or only affects a subshell).Boilerplate fixes
make uvpins.python-versionto 3.12 anduv venvfollows it; seeUsing CPython 3.12.3in the logs). The venv now gets--pythonfrom the matrix. Codecov never uploaded: the condition required Python 3.12, which isn't in the matrix.checkout@v6in the Docker job.python -m codespellfails (No module named codespell); the module iscodespell_lib.make hooksno longer installs a commit-msg hook (none is configured).pyyaml,rich,rich-argparseandtypes-PyYAML(nothing imports them; every new project inherited them) and the unusedpip-tools;requires-python >= 3.12to match the Docker image; Changelog URL → GitHub releases; drop coverage's parallel mode..dockerignore: exclude.gitand.venv; the dev stage'sCOPY . .copied a local.venv(157 MB here) into the image..python-version(3.12) is now tracked, so local venvs use the same Python as the Docker image.cloudbuild.yamlwith the Terraform triggers incloudbuild/(cloudbuild-trigger module v0.6.7, as in pipe-anchorages/pipe-encounters). The module defines the build itself (--target prod);init_project.pyrenames the project in the.tffiles..gitignoreleftovers (test/silently ignored anytest/folder), pre-commit-hooks v6.0.0, and trailing whitespace / final newlines flagged by the template's own hooks (trailing-whitespacenow keeps Markdown line breaks).rich).Test dependencies: a dependency group, compiled
requirements-test.txtheld hand-written ranges that nothing compiled or upgraded, so test runs weren't reproducible and Dependabot only flagged the pytest tmpdir advisory because~=8.3blocked the fix (9.0.3).testdependency group inpyproject.toml(not published with the package), with pytest ~=9.0 and pytest-cov ~=7.0.requirements-test.txtis compiled from it withuv pip compile --group test -c requirements.txt, so it's pinned against the production pins. The test image still installs just the test dependencies on top of the production image, as before.make reqs/make reqs-upgradecompile both files; their containers now run as the host user, so the compiled files aren't owned by root.pyproject.tomlchange;reqs-upgrademoves within the ranges.Verification
pytest: 10 passed;flake8: clean.make reqsandmake reqs-upgradein the dev container produce the pinnedrequirements-test.txt, owned by the host user.make install-test,pip install .,make test): passes.make docker-build && make docker-test: passes; the dev image no longer contains.git/.venv; the prod image's CLI runs.python init_project.py my-serviceon a copy: the README clone step becomesmy-service, guide links still point here,CONTRIBUTING.mdanddocs/contributing/are removed, andcloudbuild/*.tfgetrepo_name = "my-service".terraform fmt -checkandterraform validate(with-backend=false) pass forcloudbuild/.Follow-ups
🤖 Generated with Claude Code