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
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Maintainer review for every contribution, including CI and policy changes.
* @wilkinsantana
36 changes: 36 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Bug report
description: Report a reproducible problem in TendUI.
title: "[Bug]: "
labels: [bug]
body:
- type: markdown
attributes:
value: "For vulnerabilities, email security@tendstack.com privately. Do not include credentials or user data."
- type: input
id: version
attributes:
label: Version or commit
validations:
required: true
- type: textarea
id: reproduction
attributes:
label: Minimal reproduction
description: Include steps and a small code example or public reproduction repository.
validations:
required: true
- type: textarea
id: behavior
attributes:
label: Expected and actual behavior
validations:
required: true
- type: textarea
id: environment
attributes:
label: Browser and environment
description: Browser/version, operating system, Go version, theme, viewport and reduced-motion settings when relevant.
- type: textarea
id: evidence
attributes:
label: Screenshots or sanitized diagnostics
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: true
contact_links:
- name: Documentation and examples
url: https://tendui.com/docs
about: Start with the guides and working examples.
- name: Private security report
url: mailto:security@tendstack.com
about: Do not disclose vulnerabilities in public issues.
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/proposal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Component or feature proposal
description: Discuss an addition before starting a large implementation.
title: "[Proposal]: "
labels: [enhancement]
body:
- type: textarea
id: problem
attributes:
label: User need
description: What task is difficult with the existing components?
validations:
required: true
- type: textarea
id: approach
attributes:
label: Proposed behavior and alternatives
description: Include native HTML semantics, keyboard/mobile behavior and the no-bundled-JavaScript contract.
validations:
required: true
- type: textarea
id: compatibility
attributes:
label: Compatibility and scope
description: Identify API changes, dependencies and a bounded first implementation.
17 changes: 17 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
## Problem and change

Explain the user-visible problem and the resulting behavior. Link the issue.

## Validation

List checks actually run and results. Include screenshots for visual changes.

## Compatibility and sources

Describe API changes, migration steps, dependencies, reused material and significant
AI assistance. Omit private infrastructure, credentials and personal data.

- [ ] I have read CONTRIBUTING.md and the DCO.
- [ ] My non-merge commits have my `Signed-off-by` trailer.
- [ ] Tests/docs and generated templ Go are updated where applicable.
- [ ] I checked keyboard, narrow-screen and theme behavior for UI changes.
42 changes: 42 additions & 0 deletions .github/scripts/check-dco.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/env python3
"""Check author-matching DCO trailers without executing contribution code."""
import re
import subprocess
import sys


def signed_off(name, email, message):
trailers = subprocess.run(
["git", "interpret-trailers", "--parse"], input=message,
text=True, capture_output=True, check=True,
).stdout
for line in trailers.splitlines():
match = re.fullmatch(r"Signed-off-by:\s*(.+?)\s*<([^<>\s]+@[^<>\s]+)>", line, re.I)
if match and match[1].strip() == name.strip() and match[2].casefold() == email.casefold():
return True
return False


def main():
if len(sys.argv) != 3 or not all(re.fullmatch(r"[0-9a-f]{40}", s) for s in sys.argv[1:]):
raise SystemExit("Usage: check-dco.py BASE_SHA HEAD_SHA (full commit hashes)")
commits = subprocess.check_output(
["git", "rev-list", "--no-merges", sys.argv[1] + ".." + sys.argv[2]], text=True,
).splitlines()
failed = []
for commit in commits:
author, email, message = subprocess.check_output(
["git", "show", "-s", "--format=%an%x00%ae%x00%B", commit], text=True,
).split("\0", 2)
if not signed_off(author, email, message):
failed.append(commit[:12])
if failed:
print("Missing author-matching DCO sign-off in: " + ", ".join(failed))
print("Read CONTRIBUTING.md; sign only your own contributions with git commit -s.")
return 1
print(f"DCO: {len(commits)} non-merge commits have author-matching sign-offs.")
return 0


if __name__ == "__main__":
sys.exit(main())
22 changes: 22 additions & 0 deletions .github/scripts/test_dco.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env python3
import importlib.util
from pathlib import Path
import unittest

spec = importlib.util.spec_from_file_location("dco", Path(__file__).with_name("check-dco.py"))
dco = importlib.util.module_from_spec(spec)
spec.loader.exec_module(dco)

class DCOTests(unittest.TestCase):
def test_matching_trailer(self):
self.assertTrue(dco.signed_off("Example Contributor", "123+dev@users.noreply.github.com", "Fix spacing\n\nSigned-off-by: Example Contributor <123+dev@users.noreply.github.com>\n"))
def test_missing_or_wrong_author(self):
self.assertFalse(dco.signed_off("Dev", "dev@example.com", "Fix spacing\n"))
self.assertFalse(dco.signed_off("Dev", "dev@example.com", "Fix\n\nSigned-off-by: Someone Else <else@example.com>\n"))
def test_body_text_is_not_a_trailer(self):
self.assertFalse(dco.signed_off("Dev", "dev@example.com", "Signed-off-by: Dev <dev@example.com>\n\nThis is an example, not a sign-off.\n"))
def test_another_trailer_can_follow(self):
self.assertTrue(dco.signed_off("Dev", "dev@example.com", "Fix\n\nSigned-off-by: Dev <dev@example.com>\nReviewed-by: Reviewer <reviewer@example.com>\n"))

if __name__ == "__main__":
unittest.main()
27 changes: 27 additions & 0 deletions .github/settings/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Owner-applied repository settings

This directory is a reviewable configuration, not proof that GitHub settings
are active. An owner with repository administration access should apply the
main ruleset once the contribution workflow is merged and its check names exist.

```sh
gh api --method POST repos/Tend-Stack/TendUI/rulesets --input .github/settings/main-ruleset.json
```

Read existing rulesets first. If one already has this name, update it by its ID
with PUT rather than creating duplicates. The ruleset requires DCO and all CI,
one approving code-owner review, dismissal of stale approvals, approval of the
latest push, resolved conversations and an up-to-date branch. It blocks force
pushes and deletion. Repository admins have an explicit PR-only bypass for
maintainer exceptions; record the reason in the PR and preserve contributor DCO.

Also enable GitHub private vulnerability reporting and web commit sign-off,
disable squash/rebase merges to preserve commit trailers, and allow merge commits.
Require approval for fork workflows according to the organization's trust policy.
Never run untrusted fork code on private self-hosted runners or with deployment
secrets. Workflows use hosted runners, read-only PR permissions and no
`pull_request_target` code execution. Tag release credentials run only on maintainer tags.

Use existing `bug`, `enhancement`, `documentation`, `good first issue` and
`help wanted` labels. Curate bounded starter tasks; do not label complex API or
security changes as beginner work merely to attract contributions.
83 changes: 83 additions & 0 deletions .github/settings/main-ruleset.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
"name": "Reviewed main contributions",
"target": "branch",
"enforcement": "active",
"bypass_actors": [
{
"actor_id": 5,
"actor_type": "RepositoryRole",
"bypass_mode": "pull_request"
}
],
"conditions": {
"ref_name": {
"include": [
"refs/heads/main"
],
"exclude": []
}
},
"rules": [
{
"type": "deletion"
},
{
"type": "non_fast_forward"
},
{
"type": "pull_request",
"parameters": {
"required_approving_review_count": 1,
"dismiss_stale_reviews_on_push": true,
"require_code_owner_review": true,
"require_last_push_approval": true,
"required_review_thread_resolution": true
}
},
{
"type": "required_status_checks",
"parameters": {
"strict_required_status_checks_policy": true,
"do_not_enforce_on_create": false,
"required_status_checks": [
{
"context": "ubuntu-24.04 / Go 1.26.0",
"integration_id": 15368
},
{
"context": "ubuntu-24.04 / Go 1.27.3",
"integration_id": 15368
},
{
"context": "macos-15 / Go 1.26.0",
"integration_id": 15368
},
{
"context": "macos-15 / Go 1.27.3",
"integration_id": 15368
},
{
"context": "windows-2025 / Go 1.26.0",
"integration_id": 15368
},
{
"context": "windows-2025 / Go 1.27.3",
"integration_id": 15368
},
{
"context": "Known vulnerabilities / Go 1.27.3",
"integration_id": 15368
},
{
"context": "browser",
"integration_id": 15368
},
{
"context": "DCO",
"integration_id": 15368
}
]
}
}
]
}
36 changes: 36 additions & 0 deletions .github/workflows/contributions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Contribution checks
on:
pull_request:
permissions:
contents: read
concurrency:
group: dco-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
dco:
name: DCO
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
persist-credentials: false
- name: Verify contributor sign-offs using the base branch policy
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
shell: bash
run: |
set -euo pipefail
# Read policy from the trusted base; never execute contributor scripts.
if ! git cat-file -e "$BASE_SHA:.github/scripts/check-dco.py" 2>/dev/null; then
echo "DCO policy bootstrap: enforcement begins after this policy merges."
exit 0
fi
test "$(git rev-parse HEAD)" = "$HEAD_SHA"
git show "$BASE_SHA:.github/scripts/check-dco.py" > "$RUNNER_TEMP/check-dco.py"
git show "$BASE_SHA:.github/scripts/test_dco.py" > "$RUNNER_TEMP/test_dco.py"
python3 "$RUNNER_TEMP/test_dco.py"
python3 "$RUNNER_TEMP/check-dco.py" "$BASE_SHA" "$HEAD_SHA"
18 changes: 16 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,17 @@ jobs:
shell: bash
run: |
set -euo pipefail
test "$GITHUB_REF_NAME" = v2026.1.0
python3 - <<'PYTAG'
import os, re, pathlib
tag = os.environ['GITHUB_REF_NAME']
if not re.fullmatch(r'v2026\.[1-9][0-9]*\.[0-9]+(?:-[0-9A-Za-z.-]+)?', tag):
raise SystemExit('Invalid release tag')
version = re.search(r'Version = "([^"]+)"', pathlib.Path('tendui.go').read_text())[1]
if tag != 'v' + version:
raise SystemExit('Tag must match the library version')
if not pathlib.Path('docs/releases/' + tag[1:] + '.md').is_file():
raise SystemExit('Missing version-specific release notes')
PYTAG
mkdir -p tests/results/release
gh api "repos/$GITHUB_REPOSITORY/actions/runs?head_sha=$GITHUB_SHA&per_page=100" > tests/results/release/checks.json
python3 - <<'PY'
Expand Down Expand Up @@ -59,6 +69,8 @@ jobs:
export GIT_CONFIG_KEY_0=http.https://github.com/.extraheader
export GIT_CONFIG_VALUE_0="AUTHORIZATION: basic $auth"
cp tests/release/consumer_test.go.txt "$release_consumer/consumer_test.go"
mkdir "$release_consumer/quickstart"
cp examples/quickstart/*.go "$release_consumer/quickstart/"
cd "$release_consumer"
go mod init example.com/tendui-release-consumer
go get "github.com/Tend-Stack/TendUI/v2026@$GITHUB_REF_NAME"
Expand All @@ -78,7 +90,9 @@ jobs:
run: |
set -euo pipefail
if ! gh release view "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" > /dev/null 2>&1; then
gh release create "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" --verify-tag --title "TendUI $GITHUB_REF_NAME" --notes-file docs/releases/2026.1.0.md
flags=()
if [[ "$GITHUB_REF_NAME" == *-* ]]; then flags+=(--prerelease --latest=false); fi
gh release create "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" --verify-tag --title "TendUI $GITHUB_REF_NAME" --notes-file "docs/releases/${GITHUB_REF_NAME#v}.md" "${flags[@]}"
fi
- name: Retain release installation evidence
if: always()
Expand Down
19 changes: 19 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Community code of conduct

Treat participants with respect regardless of experience, identity or background.
Discuss ideas and code constructively, accept good-faith feedback, and give credit
for other people's work. Respect maintainers' and contributors' time and boundaries.

Harassment, threats, discriminatory abuse, sexualized conduct, doxxing, and
publication of another person's private information are not acceptable. This
policy applies to repository issues, pull requests and other project-run spaces.

Report concerns privately to **conduct@tendstack.com**. Include links and relevant
context, avoiding unnecessary personal information. Reports will be handled as
privately as practicable; information may be shared where needed to investigate
or protect participants. No response-time guarantee is promised.

Maintainers may request changes, remove content, close a discussion, restrict
participation or ban an account depending on the severity and pattern of conduct.
A person involved in a report should not decide its outcome. The reporter or
subject may request reconsideration through the same private contact address.
Loading
Loading