Skip to content

Latest commit

 

History

History
170 lines (129 loc) · 8.38 KB

CONTRIBUTING.md

File metadata and controls

170 lines (129 loc) · 8.38 KB

Contributing to elastickv

Thanks for your interest. This file is the map; the rules themselves live in CLAUDE.md (coding standards, architecture, review passes, design-doc workflow) and AGENTS.md (build, style, and testing requirements that reviewers enforce). Where the two overlap they say the same thing; if they ever disagree, fix the disagreement rather than picking one.

Coding standards

Read CLAUDE.md:

  • Conventions: gofmt plus the linters in .golangci.yaml, cockroachdb/errors wrapping, structured slog keys, table-driven tests, and the HLC and routing invariants.
  • Self-review of code changes: the five review lenses (data loss, concurrency / distributed failures, performance, data consistency, test coverage). Run them one at a time and record each result in the PR description.

Reviewers, human or automated, check changes against those two sections.

Workflow

  1. Design doc first for anything beyond a single-file edit, and for any new feature, new adapter, new control-plane RPC, schema or wire-format change, or modification touching replication / MVCC / OCC / HLC / routing even when it fits in one file. Write docs/design/YYYY_MM_DD_proposed_<slug>.md (see docs/design/README.md for the header block and lifecycle) and get it reviewed before implementing. A PR may carry the doc and the implementation, doc commit first.
  2. Branch design/<slug>; the PR body starts with Design: docs/design/<file>.
  3. Review-found defects: add a failing test that reproduces the issue first, then the fix, in the same PR.
  4. Test evidence in the PR description: make test (all packages under -race), make lint, and the relevant Jepsen suite for replication / MVCC / OCC / Redis changes.

Commands

make test    # go test -v -race ./...
make lint    # golangci-lint --config=.golangci.yaml run --fix
make run     # single-process 3-node demo

make gen regenerates protobufs and is toolchain-pinned (see proto/Makefile).

Go module download protection

CI and Go image build stages use Takumi Guard to block known-malicious public modules. Anonymous blocking needs no account, token, or additional GitHub permissions. To use the same policy locally:

export GOPROXY=https://golang.flatt.tech
go mod download
bash scripts/check-go-module-guard.sh

Keep only this URL: appending ,direct, |direct, or another proxy can bypass the blocklist. A Guard outage fails new downloads rather than fetching from another source. Keep Go checksum verification enabled. Set GOPRIVATE only for actual private modules; those intentionally bypass the public proxy. The local third_party/go-fuse replacement is not downloaded or checked.

Existing module/build caches and Docker layers are not retrospectively scanned. The check above uses a temporary empty module cache, verifies a known-good download, and requires HTTP 403 for the provider's harmless blocked test module. It leaves the repository and existing module cache unchanged. For a fresh dependency audit, use a separate empty GOMODCACHE with go mod download; go mod verify alone checks cache integrity, not the Guard blocklist. Anonymous mode does not enable authenticated download history or infection notifications. Continue using vulnerability scans and source review alongside this filter.

npm and Python download protection

The admin frontend's web/admin/.npmrc selects the anonymous npm Guard registry. Run npm ci from web/admin; CI and the Docker SPA build use the same registry. Keep the lockfile's versions and integrity hashes. Guard supports existing npmjs lockfile URLs; newly updated entries may contain Guard URLs. To check a real download and the provider's harmless blocked package with an isolated cache and without executing package scripts:

bash scripts/check-npm-package-guard.sh

The Python controller, its CI, and portable GitOps workflow examples use the anonymous PyPI Guard index. For local pip use, activate a Python 3.14 virtual environment, then configure only the current shell:

export PIP_INDEX_URL=https://pypi.flatt.tech/simple/
export PIP_CONFIG_FILE=/dev/null
export PIP_EXTRA_INDEX_URL=''
export PIP_FIND_LINKS=''
pip install --require-hashes --only-binary=:all: -r deploy/automation/requirements.lock
bash scripts/check-pypi-package-guard.sh

Disabling config-file loading and clearing extra sources prevents a saved extra index or find-links directory from bypassing the Guard. Do not add an alternate public index. The PyPI check downloads a fresh known-good wheel; the provider does not yet document a harmless PyPI block-test package, so this is not evidence of an end-to-end Python block rejection.

Python installs verify locally committed SHA-256 hashes for every dependency and use wheels only. Hashes come from official PyPI release metadata fetched independently of Guard. Keep requirements-parser.lock and its portable example copy identical when updating them. CI and the controller share the parser lock and use Python 3.14 with compatible wheels. Unhashed source builds and their implicit build dependencies are not permitted in these install paths.

Existing caches/layers, direct URL or Git dependencies, local packages, and explicit private/scoped registries are outside these registry checks. Guard-issued redirects to public artifact hosts are expected. Anonymous mode has no authenticated download history or infection notifications. For npm publishing, explicitly select the public registry; Guard is a read-only proxy. No tokens belong in the committed .npmrc or Docker layers.

Commits

Short imperative summary with an optional scope prefix matching the touched area (store:, adapter:, kv:, docs:, …).

Developer Certificate of Origin

Sign off your commits with a Signed-off-by trailer containing the commit author's name and email, certifying the DCO 1.1. This also applies to the repository owner and maintainers. The Probot DCO App checks pull requests; its standard behavior excludes bot and merge commits. Existing commits already on the target branch are outside the check.

Read the DCO before signing off. Configure your own Git identity, then use:

git commit --signoff -m "store: handle expired values"

Git adds a trailer using your committer identity:

Signed-off-by: Your Name <your-email@example.com>

Your author and sign-off identities must match. When applying another person's commit, preserve their author and existing sign-off; your own sign-off alone does not certify their authorship. A DCO sign-off is separate from a GPG or SSH commit signature; a verified signature alone does not satisfy this check.

To repair your latest commit, only if you are its author and can certify it:

git commit --amend --no-edit --signoff

For several commits you authored and can certify, use an interactive rebase, mark each unsigned commit as edit, amend it with --signoff, and continue with git rebase --continue. Coordinate history rewrites with collaborators; after amending an already-pushed branch, use git push --force-with-lease. Do not add another contributor's sign-off on their behalf.

The App reports a DCO check on the PR. Configuration in .github/dco.yml requires sign-offs from repository members and disables both individual and third-party remediation commits. Repair the unsigned commits themselves; signing off only the latest commit does not fix earlier unsigned commits. The App reads this configuration from the default branch after it is merged.

Renovate uses :gitSignOff to sign off its dependency updates, even though the App skips bot commits. Install the DCO App for bootjp/elastickv, then make its DCO check required in branch protection or the repository ruleset, selecting the DCO App as the expected source. No custom GitHub Actions workflow is needed. See the App's required-check setup.

Issues

Bug reports and questions are welcome as GitHub Issues. They are triaged with the labels in docs/agents/triage-labels.md. Maintainer work is planned in design docs, not issues.

Vocabulary

CONTEXT.md is the glossary. Use its terms in identifiers, doc titles, and test names.