Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ contact_links:
- name: Watch the hive live on Twitch
url: https://hivecommons.dev/twitch
about: Live stream of the hosted hive's Activity Monitor — see issues and PRs move through the pipeline in real time.
- name: Join the community meeting
url: https://docs.hivecommons.dev/docs/community/meetings
about: Public Hive Commons meeting every other Thursday — schedule, join link, agenda and calendar.
- name: Propose a project to join Hive Commons
url: https://github.com/hivecommons/.github/issues/new?template=join-hive-commons.yml
about: Project proposals for the Hive Commons family are handled in the hivecommons/.github repository.
50 changes: 50 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Contributing to hivecommons.dev

This repository is the source for [hivecommons.dev](https://hivecommons.dev), a static
GitHub Pages site with no build step. Open pull requests against **`main`**, the default
branch. The `v4`/`v5` branch rules in the org-wide
[Hive Commons contributing guide](https://github.com/hivecommons/.github/blob/main/CONTRIBUTING.md)
were written for `hivecommons/hive` and do not apply here.

## Before you open a pull request

Run the checks from the repository root. The README's
[Local preview and running the checks](README.md#local-preview-and-running-the-checks)
section lists them, and they need only Python 3 and Node.js (no `npm install`):

```sh
node --test scripts/*.test.mjs
scripts/check-links.test.sh
scripts/check-redirects.test.sh
scripts/check-redirects.sh
```

The [pull request template](.github/pull_request_template.md) checklist covers this
repository's own rules:

- Shortcut redirects (`/discord`, `/meet`, …) are generated. Change the `MAP` in
`make-redirects.sh`, then run `./make-redirects.sh`. Do not hand-edit the redirect pages.
- After you edit an inline `<script>`, run `node scripts/update-csp-hashes.mjs`.
- A new top-level page goes in `sitemap.xml`.
- A change to the integration, sponsor, community-link or adopter lists in `index.html`
must be mirrored in `llms.txt`.

Sign off every commit (`git commit -s`) for the Developer Certificate of Origin check.

## Finding something to work on

- [`good first issue`](https://github.com/hivecommons/hivecommons.github.io/labels/good%20first%20issue)
and [`help wanted`](https://github.com/hivecommons/hivecommons.github.io/labels/help%20wanted)
issues are ready to pick up. Comment on the issue before you start.
- Found a broken link, a dead redirect or wrong content? Use the
[Website problem form](https://github.com/hivecommons/hivecommons.github.io/issues/new?template=site_problem.yml).
Problems with Hive itself go to the
[hive issue tracker](https://github.com/hivecommons/hive/issues/new/choose).

## Questions

Ask on [Discord](https://hivecommons.dev/discord) or bring it to the biweekly
[Hive Commons community meeting](https://docs.hivecommons.dev/docs/community/meetings).

For review, governance and the AI-agent contribution policy, see the org-wide
[contributing guide](https://github.com/hivecommons/.github/blob/main/CONTRIBUTING.md).
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -420,10 +420,16 @@ red PR job against.
- `node --test scripts/issue-forms.test.mjs` — static gate over `.github/ISSUE_TEMPLATE/`:
`config.yml` and every form parse and `blank_issues_enabled` is boolean; every
`contact_links[].url` is `https` and a `hivecommons.dev` URL resolves to a committed
page, and the chooser links the `/discord` and `/twitch` shortcuts; `body[].id` is unique within a form and every `type` is one of GitHub's five
page, and the chooser links the `/discord` and `/twitch` shortcuts and the community
meeting page; `body[].id` is unique within a form and every `type` is one of GitHub's five
form element types; every `labels[]` entry is in `KNOWN_LABELS`. GitHub silently falls
back to a blank issue when a form fails to parse, so CI would otherwise stay green on a
broken form. Each rule has a fixture self-test. Zero dependencies.
- `node --test scripts/contributing.test.mjs` — static gate over `CONTRIBUTING.md`, which
GitHub links from the new-issue and new-PR pages (without it GitHub shows the org-wide
guide, whose `v4`/`v5` branch rules are hive's): it must name `main` as the PR target and
link the `good first issue` and `help wanted` labels, the Website problem form, Discord and
the community meeting. Each rule has a fixture self-test. Zero dependencies.
- `node --test scripts/artifact-registry.test.mjs` — advisory (report-only) registry
check: every tracked file should be covered by a page/asset/script class gate or named
literally in a `scripts/*.test.mjs` or `scripts/check-*.sh`; unregistered files are
Expand Down Expand Up @@ -483,7 +489,9 @@ requirements first (see [issue #73](https://github.com/hivecommons/hivecommons.g

## Contributing

Contributions follow the org-wide [CONTRIBUTING.md](https://github.com/hivecommons/.github/blob/main/CONTRIBUTING.md);
Start with [CONTRIBUTING.md](CONTRIBUTING.md): the PR target, the checks, starter issues and
where to ask. Review and governance follow the org-wide
[CONTRIBUTING.md](https://github.com/hivecommons/.github/blob/main/CONTRIBUTING.md);
every commit needs a DCO sign-off (`git commit -s`). Opening a pull request pre-fills
`.github/pull_request_template.md`, whose checklist covers this repository's own rules: the
checks under [Local preview and running the checks](#local-preview-and-running-the-checks),
Expand Down
45 changes: 45 additions & 0 deletions scripts/contributing.test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/usr/bin/env node
// Static gate over CONTRIBUTING.md. GitHub links it from the new-issue and
// new-PR pages, so it is often the first file a newcomer reads; without it
// GitHub shows the org-wide guide, whose v4/v5 branch rules are hive's. Rules:
// 1. It names `main` as the pull request target.
// 2. It links the repository's starter labels (`good first issue`, `help wanted`)
// and the Website problem form.
// 3. It links Discord and the community meeting, as the issue chooser does.
// Each rule has a fixture self-test. Zero dependencies.
// Usage: node --test scripts/contributing.test.mjs
import { test } from "node:test";
import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";

const HERE = dirname(fileURLToPath(import.meta.url));
const ROOT = join(HERE, "..");
const REPO = "https://github.com/hivecommons/hivecommons.github.io";

export const REQUIRED = [
["the main branch as the PR target", "**`main`**"],
["the good first issue label", `${REPO}/labels/good%20first%20issue`],
["the help wanted label", `${REPO}/labels/help%20wanted`],
["the Website problem form", `${REPO}/issues/new?template=site_problem.yml`],
["Discord", "https://hivecommons.dev/discord"],
["the community meeting", "https://docs.hivecommons.dev/docs/community/meetings"],
];

export function contributingProblems(text) {
return REQUIRED.filter(([, needle]) => !text.includes(needle)).map(([what, needle]) => `does not name ${what} (${needle})`);
}

test("CONTRIBUTING.md names main and links starter issues, the issue form and community channels", () => {
assert.deepEqual(contributingProblems(readFileSync(join(ROOT, "CONTRIBUTING.md"), "utf8")), []);
});

test("fixtures: a guide missing any required link is rejected, one with all of them passes", () => {
const all = REQUIRED.map(([, needle]) => needle).join("\n");
assert.deepEqual(contributingProblems(all), []);
assert.equal(contributingProblems("").length, REQUIRED.length);
for (const [what, needle] of REQUIRED) {
assert.deepEqual(contributingProblems(all.replace(needle, "")), [`does not name ${what} (${needle})`]);
}
});
3 changes: 3 additions & 0 deletions scripts/issue-forms.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export const FORM_TYPES = new Set(["markdown", "textarea", "input", "dropdown",
// Labels that exist on the repository; add new labels here in the same PR that uses them.
export const KNOWN_LABELS = new Set(["bug"]);
const SITE_ORIGIN = "https://hivecommons.dev";
// The meetings page (schedule, join link, agenda) every other managed repo's chooser links.
const MEETINGS_URL = "https://docs.hivecommons.dev/docs/community/meetings";

function scalar(s) {
s = s.trim();
Expand Down Expand Up @@ -137,6 +139,7 @@ test("config.yml links the community channels the homepage lists", () => {
const cfg = parseYaml(readFileSync(join(DIR, "config.yml"), "utf8"));
const urls = cfg.contact_links.map((l) => l.url);
for (const path of ["/discord", "/twitch"]) assert.ok(urls.includes(`https://hivecommons.dev${path}`), `no contact link to ${path}`);
assert.ok(urls.includes(MEETINGS_URL), `no contact link to ${MEETINGS_URL}`);
});

test("every issue form parses and is sound", () => {
Expand Down
Loading