Skip to content

Commit 47c6b4a

Browse files
roark47zpzjzjlijunfeng722
committed
chore: initial public release
Co-authored-by: lbfsc <kongtang.lb@alibaba-inc.com> Co-authored-by: zpzjzj <lisa.zp@alibaba-inc.com> Co-authored-by: lijunfeng722 <ljf242059@alibaba-inc.com>
0 parents  commit 47c6b4a

301 files changed

Lines changed: 51498 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.editorconfig

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# https://editorconfig.org/
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
end_of_line = lf
7+
insert_final_newline = true
8+
trim_trailing_whitespace = true
9+
10+
[*.go]
11+
indent_style = tab
12+
indent_size = 8
13+
14+
[*.{yml,yaml}]
15+
indent_style = space
16+
indent_size = 2
17+
18+
[Makefile]
19+
indent_style = tab

.githooks/commit-msg

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/sh
2+
# Enforce Conventional Commits on the subject line (first line).
3+
# https://www.conventionalcommits.org/
4+
5+
set -e
6+
7+
msg_file=$1
8+
first_line=$(head -n1 "$msg_file")
9+
10+
# Merge / revert commits from Git and GitHub
11+
case "$first_line" in
12+
Merge\ *|"Revert "*)
13+
exit 0
14+
;;
15+
esac
16+
17+
# Optional body may follow; subject must match.
18+
pattern='^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\([a-zA-Z0-9._/-]+\))?: .+'
19+
20+
if ! printf '%s\n' "$first_line" | grep -qE "$pattern"; then
21+
cat <<-'EOF' >&2
22+
error: commit message does not follow Conventional Commits.
23+
24+
Subject line (first line) must look like:
25+
26+
<type>(<optional-scope>): <description>
27+
28+
Examples:
29+
feat(cli): add validate command
30+
fix(config): correct default timeout
31+
docs: update CONTRIBUTING
32+
33+
Allowed types: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert
34+
35+
See CONTRIBUTING.md for details.
36+
EOF
37+
exit 1
38+
fi

.githooks/pre-commit

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#!/bin/sh
2+
# Run mandatory pre-commit checks and block the commit on any failure.
3+
#
4+
# Policy: enforce formatting/vet/revive on the whole tree (cheap and stable),
5+
# but only run golangci-lint **incrementally** against the merge base so
6+
# unrelated pre-existing issues do not block new commits. CI runs the full
7+
# scan via `make quality-ci`.
8+
#
9+
# To run the full scan locally instead of the incremental one:
10+
# SKILL_UP_PRECOMMIT_FULL=1 git commit ...
11+
# To bypass entirely (discouraged, last resort):
12+
# git commit --no-verify ...
13+
14+
set -e
15+
16+
# Ensure Go and repo-local tools are in PATH for non-interactive shells.
17+
for go_path in /opt/homebrew/bin /usr/local/go/bin "$HOME/go/bin" "$HOME/.local/bin"; do
18+
if [ -d "$go_path" ]; then
19+
PATH="$go_path:$PATH"
20+
fi
21+
done
22+
export PATH
23+
24+
ROOT=$(git rev-parse --show-toplevel)
25+
cd "$ROOT"
26+
PATH="$ROOT/.tools/bin:$PATH"
27+
export PATH
28+
29+
if ! command -v make >/dev/null 2>&1; then
30+
echo "error: make is required for pre-commit" >&2
31+
exit 1
32+
fi
33+
34+
if [ "${SKILL_UP_PRECOMMIT_FULL:-0}" = "1" ]; then
35+
echo "[pre-commit] SKILL_UP_PRECOMMIT_FULL=1 -> running full 'make verify'"
36+
make verify
37+
exit 0
38+
fi
39+
40+
# Always-on cheap checks (whole tree).
41+
make fmt-check
42+
make vet
43+
make revive
44+
45+
# Incremental golangci-lint: only fail on issues introduced by this commit.
46+
# Pick a sensible base ref: prefer origin/master, fall back to master, then HEAD.
47+
BASE_REF="${QUALITY_BASE_REF:-}"
48+
if [ -z "$BASE_REF" ]; then
49+
if git rev-parse --verify --quiet origin/master >/dev/null; then
50+
BASE_REF="origin/master"
51+
elif git rev-parse --verify --quiet master >/dev/null; then
52+
BASE_REF="master"
53+
else
54+
BASE_REF="HEAD"
55+
fi
56+
fi
57+
58+
echo "[pre-commit] running incremental lint against ${BASE_REF}"
59+
QUALITY_BASE_REF="$BASE_REF" make lint-new

.github/CODEOWNERS

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# CODEOWNERS for skill-up
2+
#
3+
# This file routes PR review requests to the appropriate maintainers.
4+
# See: https://docs.github.com/articles/about-code-owners
5+
#
6+
# Syntax notes:
7+
# - Patterns follow .gitignore-style rules; the LAST matching pattern wins.
8+
# - Owners must be real GitHub usernames (@user) or teams (@org/team)
9+
# that have read access to the repository, otherwise the rule is ignored.
10+
# - Multiple owners can be listed, separated by spaces.
11+
#
12+
# Recommended Branch Protection (Settings -> Branches -> Add rule):
13+
# - Require a pull request before merging
14+
# - Require review from Code Owners
15+
# - Require status checks to pass (select `build` and `lint` jobs from CI)
16+
17+
# Global fallback: every file is owned by the maintainers by default.
18+
* @hittyt @libinfs
19+
20+
# Public API surface: changes here require extra care.
21+
/pkg/ @hittyt @libinfs
22+
23+
# CI / release configuration.
24+
/.github/ @hittyt @libinfs
25+
/Makefile @hittyt @libinfs
26+
/.goreleaser.yaml @hittyt @libinfs
27+
28+
# Core runner & agent logic.
29+
/internal/runner/ @hittyt @libinfs
30+
/internal/agent/ @hittyt @libinfs
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
name: Bug report
3+
about: Report a reproducible bug
4+
labels: bug
5+
---
6+
7+
## Description
8+
9+
<!-- A clear and concise description of the bug. -->
10+
11+
## Steps to reproduce
12+
13+
1.
14+
2.
15+
3.
16+
17+
## Expected behavior
18+
19+
<!-- What you expected to happen. -->
20+
21+
## Actual behavior
22+
23+
<!-- What actually happened. Include error output if applicable. -->
24+
25+
## Environment
26+
27+
- skill-up version (`skill-up --version`):
28+
- Go version (`go version`):
29+
- OS / arch:
30+
31+
## Additional context
32+
33+
<!-- Any other context, logs, or screenshots. -->
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea or enhancement
4+
labels: enhancement
5+
---
6+
7+
## Problem / motivation
8+
9+
<!-- What problem does this feature solve? Who is affected? -->
10+
11+
## Proposed solution
12+
13+
<!-- Describe the solution you'd like. -->
14+
15+
## Alternatives considered
16+
17+
<!-- Any alternative approaches you've considered. -->
18+
19+
## Additional context
20+
21+
<!-- Links to related issues, designs, or prior art. -->

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
## Summary
2+
3+
<!-- Describe what this PR does and why. -->
4+
5+
## Related issues
6+
7+
<!-- Closes #<issue-number> -->
8+
9+
## Changes
10+
11+
<!-- Bullet-point list of notable changes. -->
12+
13+
## Test plan
14+
15+
- [ ] `make test` passes
16+
- [ ] `make verify` passes (fmt + vet + lint)
17+
- [ ] Manual testing steps (if applicable):
18+
19+
## Notes for reviewers
20+
21+
<!-- Anything that needs special attention during review. -->

.github/dependabot.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
version: 2
2+
updates:
3+
# Go module dependencies.
4+
- package-ecosystem: "gomod"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
8+
day: "monday"
9+
open-pull-requests-limit: 5
10+
labels:
11+
- "dependencies"
12+
commit-message:
13+
prefix: "chore"
14+
15+
# GitHub Actions versions.
16+
- package-ecosystem: "github-actions"
17+
directory: "/"
18+
schedule:
19+
interval: "weekly"
20+
day: "monday"
21+
open-pull-requests-limit: 3
22+
labels:
23+
- "dependencies"
24+
- "ci"
25+
commit-message:
26+
prefix: "ci"

.github/workflows/ci.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
build:
14+
name: Build & Test
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
go-version: ["1.25.x"]
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- uses: actions/setup-go@v5
24+
with:
25+
go-version: ${{ matrix.go-version }}
26+
cache: true
27+
28+
- name: Verify dependencies
29+
run: go mod verify
30+
31+
- name: Build
32+
run: go build ./...
33+
34+
- name: Test (with race detector and coverage)
35+
run: go test -race -timeout 120s -covermode=atomic -coverprofile=coverage.out ./...
36+
37+
- name: Upload coverage to Codecov
38+
uses: codecov/codecov-action@v5
39+
with:
40+
files: ./coverage.out
41+
flags: unittests
42+
fail_ci_if_error: false
43+
env:
44+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
45+
46+
lint:
47+
name: Lint
48+
runs-on: ubuntu-latest
49+
steps:
50+
- uses: actions/checkout@v4
51+
52+
- uses: actions/setup-go@v5
53+
with:
54+
go-version: "1.25.x"
55+
cache: true
56+
57+
- name: Check formatting
58+
run: |
59+
if [ "$(gofmt -l . | wc -l)" -gt 0 ]; then
60+
echo "Following files are not formatted:"
61+
gofmt -l .
62+
exit 1
63+
fi
64+
65+
- name: golangci-lint
66+
uses: golangci/golangci-lint-action@v8
67+
with:
68+
version: v2.11.4

.github/workflows/docs.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Docs
2+
3+
# Build the VitePress documentation site and deploy to GitHub Pages.
4+
# Site URL: https://<org>.github.io/skill-up/
5+
on:
6+
push:
7+
branches: [main]
8+
paths:
9+
- 'docs/**'
10+
- 'package.json'
11+
- 'package-lock.json'
12+
- '.github/workflows/docs.yml'
13+
workflow_dispatch:
14+
15+
# Required for GitHub Pages deployment via actions/deploy-pages.
16+
permissions:
17+
contents: read
18+
pages: write
19+
id-token: write
20+
21+
# Allow only one concurrent deployment, but do not cancel in-progress runs.
22+
concurrency:
23+
group: pages
24+
cancel-in-progress: false
25+
26+
jobs:
27+
build:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v4
32+
with:
33+
fetch-depth: 0
34+
35+
- name: Setup Node
36+
uses: actions/setup-node@v4
37+
with:
38+
node-version: '20'
39+
cache: 'npm'
40+
41+
- name: Install dependencies
42+
run: npm ci
43+
44+
- name: Build VitePress site
45+
run: npm run docs:build
46+
47+
- name: Setup Pages
48+
uses: actions/configure-pages@v5
49+
50+
- name: Upload artifact
51+
uses: actions/upload-pages-artifact@v3
52+
with:
53+
path: docs/.vitepress/dist
54+
55+
deploy:
56+
needs: build
57+
runs-on: ubuntu-latest
58+
environment:
59+
name: github-pages
60+
url: ${{ steps.deployment.outputs.page_url }}
61+
steps:
62+
- name: Deploy to GitHub Pages
63+
id: deployment
64+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)