diff options
| author | Nikolay Govorov <me@govorov.online> | 2026-04-08 12:23:56 +0100 |
|---|---|---|
| committer | Nikolay Govorov <me@govorov.online> | 2026-04-08 16:14:12 +0100 |
| commit | d996e025a8ea157a26dbd2b62861aeba4420bff9 (patch) | |
| tree | b1552e4bc72339afb1b0e5e1c40c6b6a40b92cde | |
| parent | a33074d5d7424950ae7c9ebfc244b5be5c72f343 (diff) | |
| download | tar tar.gz tar.bz2 tar.lz tar.xz tar.zst zip | |
Add contibuting policy
Diffstat
| -rw-r--r-- | .github/workflows/build.yml | 11 | +8 −3 |
| -rw-r--r-- | .github/workflows/cla.yml | 30 | +0 −30 |
| -rw-r--r-- | .mailmap | 4 | +4 −0 |
| -rw-r--r-- | CLA.md | 4 | +2 −2 |
| -rw-r--r-- | README.md | 31 | +31 −0 |
| -rw-r--r-- | REUSE.toml | 11 | +6 −5 |
| -rw-r--r-- | Taskfile.yml | 106 | +72 −34 |
7 files changed, 123 insertions, 74 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 948dc34..dcf9532 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,9 +19,8 @@ jobs: version: ${{ steps.version.outputs.version }} steps: - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - - - name: Check licenses - uses: fsfe/reuse-action@676e2d560c9a403aa252096d99fcab3e1132b0f5 # v6.0.0 + with: + fetch-depth: 0 - uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0 with: @@ -36,6 +35,12 @@ jobs: go install google.golang.org/protobuf/cmd/protoc-gen-go@latest go install connectrpc.com/connect/cmd/protoc-gen-connect-go@latest + - name: Check licenses + uses: fsfe/reuse-action@676e2d560c9a403aa252096d99fcab3e1132b0f5 # v6.0.0 + + - name: Check git history + run: task signof + - name: Import GPG key uses: crazy-max/ghaction-import-gpg@e89d40939c28e39f97cf32126055eeae86ba74ec # v6.3.0 with: diff --git a/.github/workflows/cla.yml b/.github/workflows/cla.yml deleted file mode 100644 --- a/.github/workflows/cla.yml +++ /dev/null @@ -1,30 +0,0 @@ -# SPDX-FileCopyrightText: 2026 Nikolay Govorov <me@govorov.online> -# SPDX-License-Identifier: AGPL-3.0-or-later - -name: "CLA Assistant" - -on: - issue_comment: - types: [created] - pull_request_target: - types: [opened, closed, synchronize] - -jobs: - CLAAssistant: - runs-on: ubuntu-latest - permissions: - actions: write - contents: write - statuses: write - pull-requests: write - steps: - - name: "CLA Assistant" - if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target' - uses: contributor-assistant/github-action@ca4a40a7d1004f18d9960b404b97e5f30a505a08 # v2.6.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - branch: "main" - allowlist: mrdimidium - path-to-signatures: "LICENSES/cla.json" - path-to-document: "https://github.com/dimidiumlabs/mirum/blob/main/CLA.md" diff --git a/.mailmap b/.mailmap new file mode 100644 --- /dev/null +++ b/.mailmap @@ -0,0 +1,4 @@ +# Add new entries in alphabetical order + +Nikolay Govorov <me@govorov.online> +Nikolay Govorov <mr@dimidiumlabs.io> diff --git a/CLA.md b/CLA.md index e1d891a..736d407 100644 --- a/CLA.md +++ b/CLA.md @@ -1,9 +1,9 @@ -# Recluse Grant and Contributor License Agreement +# Mirum Grant and Contributor License Agreement > This agreement is based on the Harmony Combined Contributor Agreement > Version 1.0 licensed under a [Creative Commons Attribution 3.0 Unported License](http://creativecommons.org/licenses/by/3.0/). -Thank you for your interest in contributing to Recluse ("We" or "Us"). In order +Thank you for your interest in contributing to Mirum ("We" or "Us"). In order to clarify the intellectual property license granted with Contributions from any person or entity, We must have a Contributor License Agreement ("CLA") on file that has been signed, accepted or otherwise agreed to by each contributor, diff --git a/README.md b/README.md index 622bc02..4e30f73 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,37 @@ sudo systemctl enable --now mirumd sudo systemctl enable --now mirumw@default ``` +## Contributing + +We welcome your contributions, including code, bug reports, ideas, and success stories. + +If you are making a contribution for the first time or from a new email, +please add yourself to the `.mailmap`. + +### Contributor License Agreement + +To include your code, we ask that you read and agree to the [CLA](./CLA.md). +To sign, add a `Signed-off-by` trailer to every commit (`git commit -s`). +Each commit in a pull request must carry a valid `Signed-off-by` +line matching the commit author. Please use your real name or your +public nickname. We cannot include code from anonymous contributors. + +AI agents MUST NOT add Signed-off-by tags. +Only humans can legally certify the Contributor License Agreement. + +### AI policy + +You may use AI agents when writing code and documentation. AI is not allowed for +media including images, videos, fonts at all. You must fully read, understand, +and cleanup any code generated by the agent. We ask that you disclose the agent's +use and indicate the tool, model, and extent of contribution. + +Contributions should include an Assisted-by tag in the following format: +`Assisted-by: AGENT_NAME:MODEL_VERSION [TOOL1] [TOOL2]`, for example: +`Assisted-by: Claude:claude-4.6-opus coccinelle sparse` + +Remember, AI agents should make software better, not worse. + ## License Copyright (C) 2026 Nikolay Govorov diff --git a/REUSE.toml b/REUSE.toml index 4b393aa..455fc7e 100644 --- a/REUSE.toml +++ b/REUSE.toml @@ -5,16 +5,17 @@ version = 1 [[annotations]] path = [ - "go.mod", - "go.sum", - "VERSION", + ".mailmap", "CLA.md", "CONCEPT.md", "README.md", - "pkg/logo.svg", + "VERSION", + "cmd/mirumd/web/*.json", + "go.mod", + "go.sum", "pkg/dl/*", + "pkg/logo.svg", "proto/buf.*", - "cmd/mirumd/web/*.json", ] SPDX-FileCopyrightText = "2026 Nikolay Govorov <me@govorov.online>" SPDX-License-Identifier = "AGPL-3.0-or-later" diff --git a/Taskfile.yml b/Taskfile.yml index 0f11a70..b2dbaaa 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -11,9 +11,6 @@ vars: ARCHES: amd64 arm64 riscv64 ppc64le DEV_DB: mirum-local-dev -env: - GOEXPERIMENT: runtimesecret - tasks: lint: desc: Run static checks @@ -21,6 +18,47 @@ tasks: cmds: - go vet ./... - gofmt -l . | grep . && exit 1 || true + + signof: + desc: Verifies that the author is known and has signed the CLA + cmds: + - | + ALLOWLIST="Nikolay Govorov|github-actions\\[bot\\]" + + bad=0 + for sha in $(git log --no-merges --format=%H); do + author=$(git log -1 --format='%an' "$sha") + if echo "$author" | grep -qP "^($ALLOWLIST)$"; then + continue + fi + + email=$(git log -1 --format='%ae' "$sha") + expected="${author} <${email}>" + if ! git log -1 --format='%(trailers:key=Signed-off-by,valueonly)' "$sha" | grep -qF "$expected"; then + echo "Commit ${sha:0:8} by ${expected} is missing a valid Signed-off-by" + bad=1 + fi + done + + if [ "$bad" -eq 1 ]; then + echo "All commits must be signed off (git commit -s). See CLA.md" + exit 1 + fi + + # Check that all authors and committers are in .mailmap + missing=0 + for email in $(git log --no-merges --format='%ae%n%ce' | sort -u); do + if ! grep -v '^#' .mailmap | grep -qF "<${email}>"; then + echo "Email <${email}> is not in .mailmap" + missing=1 + fi + done + + if [ "$missing" -eq 1 ]; then + echo "All contributors must be listed in .mailmap. See README.md" + exit 1 + fi + proto: desc: Generate ConnectRPC code from proto files sources: @@ -75,29 +113,6 @@ tasks: cmds: - npm run build - build: - desc: "Build binaries (override GOOS/GOARCH for cross-compilation)" - deps: [proto, web:build] - vars: - GOOS: { sh: "echo ${GOOS:-$(go env GOOS)}" } - GOARCH: { sh: "echo ${GOARCH:-$(go env GOARCH)}" } - env: - CGO_ENABLED: "0" - GOOS: "{{.GOOS}}" - GOARCH: "{{.GOARCH}}" - cmds: - - mkdir -p {{.BUILD_DIR}} - - go build -o {{.BUILD_DIR}}/mirumd-{{.GOOS}}-{{.GOARCH}} ./cmd/mirumd - - go build -o {{.BUILD_DIR}}/mirumw-{{.GOOS}}-{{.GOARCH}} ./cmd/mirumw - - cp {{.BUILD_DIR}}/mirumd-{{.GOOS}}-{{.GOARCH}} {{.BUILD_DIR}}/mirumd - - cp {{.BUILD_DIR}}/mirumw-{{.GOOS}}-{{.GOARCH}} {{.BUILD_DIR}}/mirumw - - test: - desc: Run all tests - deps: [build, web:size] - cmds: - - go test -race -count=1 ./... - web:size: desc: Check frontend bundle size budgets dir: cmd/mirumd/web @@ -175,27 +190,50 @@ tasks: desc: Provision a full local dev environment (keys, config, database) deps: [devenv:keys, devenv:config, devenv:db] - run: - desc: Build and run mirumd against the dev environment - deps: [build, devenv] + dev:server: + desc: Build mirumd with -tags dev and run it against the dev environment + deps: [proto, devenv] + prefix: mirumd + env: + CGO_ENABLED: "0" cmds: + - mkdir -p {{.BUILD_DIR}} + - go build -tags dev -o {{.BUILD_DIR}}/mirumd ./cmd/mirumd - "{{.BUILD_DIR}}/mirumd daemon --config dev/mirumd.yaml" dev: desc: Run Vite dev server and mirumd together (HMR-enabled) deps: [web:dev, dev:server] - dev:server: - desc: Build mirumd with -tags dev and run it against the dev environment - deps: [proto, devenv] - prefix: mirumd + build: + desc: "Build binaries (override GOOS/GOARCH for cross-compilation)" + deps: [proto, web:build] + vars: + GOOS: { sh: "echo ${GOOS:-$(go env GOOS)}" } + GOARCH: { sh: "echo ${GOARCH:-$(go env GOARCH)}" } env: CGO_ENABLED: "0" + GOOS: "{{.GOOS}}" + GOARCH: "{{.GOARCH}}" cmds: - mkdir -p {{.BUILD_DIR}} - - go build -tags dev -o {{.BUILD_DIR}}/mirumd ./cmd/mirumd + - go build -o {{.BUILD_DIR}}/mirumd-{{.GOOS}}-{{.GOARCH}} ./cmd/mirumd + - go build -o {{.BUILD_DIR}}/mirumw-{{.GOOS}}-{{.GOARCH}} ./cmd/mirumw + - cp {{.BUILD_DIR}}/mirumd-{{.GOOS}}-{{.GOARCH}} {{.BUILD_DIR}}/mirumd + - cp {{.BUILD_DIR}}/mirumw-{{.GOOS}}-{{.GOARCH}} {{.BUILD_DIR}}/mirumw + + run: + desc: Build and run mirumd against the dev environment + deps: [build, devenv] + cmds: - "{{.BUILD_DIR}}/mirumd daemon --config dev/mirumd.yaml" + test: + desc: Run all tests + deps: [build, web:size] + cmds: + - go test -race -count=1 ./... + package: desc: Build deb/rpm packages for all architectures requires: |
