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
5 changes: 1 addition & 4 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
# Code ownership for chisel
# See: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners

* @zoobzio
* @zoobzio @wintermute-zbz
11 changes: 10 additions & 1 deletion .github/settings.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
repository:
name: chisel
description: AST-aware code chunking for semantic search and embeddings
homepage: https://github.com/zoobzio/chisel
homepage: https://chisel.zoobz.io
has_wiki: true
has_downloads: true
default_branch: main
allow_squash_merge: true
allow_merge_commit: false
allow_rebase_merge: false
delete_branch_on_merge: true
topics:
- go
- golang
- zoobzio
- ast
- code-chunking
- semantic-search
- embeddings
- tree-sitter

branches:
- name: main
Expand Down
36 changes: 11 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: CI

on:
push:
branches: [ main ]
branches: [ main, master ]
pull_request:
branches: [ main ]
branches: [ main, master ]

jobs:
test:
Expand All @@ -13,7 +13,6 @@ jobs:
strategy:
matrix:
go-version: ['1.24', '1.25']

steps:
- uses: actions/checkout@v4

Expand All @@ -22,9 +21,8 @@ jobs:
with:
go-version: ${{ matrix.go-version }}

- name: Test all modules
run: |
go test -v -race ./... ./golang/... ./markdown/... ./typescript/... ./python/... ./rust/... ./testing/...
- name: Test
run: make test

lint:
name: Lint
Expand All @@ -41,17 +39,7 @@ jobs:
uses: golangci/golangci-lint-action@v7
with:
version: v2.7.2
args: --config=.golangci.yml --timeout=5m ./... ./golang/... ./markdown/... ./typescript/... ./python/... ./rust/... ./testing/...
skip-cache: false
skip-save-cache: false

- name: Security Report
if: always()
run: |
golangci-lint run --config=.golangci.yml --out-format=json ./... ./golang/... ./markdown/... ./typescript/... ./python/... ./rust/... ./testing/... > lint-report.json || true
echo "### Security Scan Summary" >> $GITHUB_STEP_SUMMARY
echo "Linters with findings:" >> $GITHUB_STEP_SUMMARY
jq -r '.Issues[] | .FromLinter' lint-report.json 2>/dev/null | sort | uniq -c | sort -nr >> $GITHUB_STEP_SUMMARY || echo "No issues found ✅" >> $GITHUB_STEP_SUMMARY
args: --config=.golangci.yml --timeout=5m

security:
name: Security
Expand All @@ -67,18 +55,17 @@ jobs:
with:
go-version: '1.25'

- name: Run Gosec Security Scanner
uses: securego/gosec@v2.22.11
- name: Run Gosec
uses: securego/gosec@master
with:
args: '-fmt sarif -out gosec-results.sarif --no-fail ./...'

- name: Upload SARIF file
- name: Upload SARIF
uses: github/codeql-action/upload-sarif@v3
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
continue-on-error: true
with:
sarif_file: gosec-results.sarif
wait-for-processing: true

benchmark:
name: Benchmark
Expand All @@ -92,15 +79,14 @@ jobs:
go-version: '1.25'

- name: Run benchmarks
run: |
echo "### Provider Benchmarks" | tee benchmark_results.txt
go test -bench=. -benchmem -benchtime=1s ./testing/benchmarks/... | tee -a benchmark_results.txt
run: make test-bench

- name: Upload benchmark results
- name: Upload results
uses: actions/upload-artifact@v4
with:
name: benchmark-results
path: benchmark_results.txt
if: always()

ci-complete:
name: CI Complete
Expand Down
25 changes: 6 additions & 19 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,21 @@ name: CodeQL

on:
push:
branches: [ main ]
branches: [ main, master ]
pull_request:
branches: [ main ]
schedule:
- cron: '0 6 * * 1'
branches: [ main, master ]

permissions:
actions: read
contents: read
security-events: write

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
Expand All @@ -32,18 +29,8 @@ jobs:
languages: go
queries: security-and-quality

- name: Build
run: |
go build ./... ./golang/... ./markdown/... ./typescript/... ./python/... ./rust/... ./testing/...
- name: Autobuild
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:go"

- name: Security summary
if: always()
run: |
echo "### 🔒 CodeQL Security Analysis" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Security analysis completed. Check the Security tab for detailed findings." >> $GITHUB_STEP_SUMMARY
131 changes: 13 additions & 118 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,144 +2,39 @@ name: Coverage

on:
push:
branches: [ main ]
branches: [ main, master ]
pull_request:
branches: [ main ]

permissions:
contents: read
checks: write
pull-requests: write
branches: [ main, master ]

jobs:
coverage:
name: Test Coverage Analysis
name: Coverage
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25'
cache: true

- name: Run tests with coverage
run: |
# Test all modules and collect coverage
echo "=== Testing all modules ==="
go test -v -race -coverprofile=coverage.out -covermode=atomic \
./... ./golang/... ./markdown/... ./typescript/... ./python/... ./rust/... ./testing/...

# Generate coverage report
go tool cover -func=coverage.out > coverage-summary.txt
echo "Coverage Summary:"
tail -1 coverage-summary.txt

# Generate HTML report
go tool cover -html=coverage.out -o coverage.html
run: go test -tags testing -coverprofile=coverage.out -covermode=atomic ./... ./golang/... ./markdown/... ./typescript/... ./python/... ./rust/... ./testing/...

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
- name: Upload to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.out
flags: unit
name: chisel-coverage
flags: unittests
name: codecov-chisel
fail_ci_if_error: false
verbose: true

- name: Generate coverage badge
run: |
COVERAGE=$(go tool cover -func=coverage.out | tail -1 | grep -oE '[0-9]+\.[0-9]+' | tail -1)
echo "Coverage: $COVERAGE%"
echo "COVERAGE=$COVERAGE" >> $GITHUB_ENV

if awk "BEGIN {exit !($COVERAGE >= 80)}"; then
COLOR="green"
elif awk "BEGIN {exit !($COVERAGE >= 60)}"; then
COLOR="yellow"
else
COLOR="red"
fi
echo "COVERAGE_COLOR=$COLOR" >> $GITHUB_ENV

- name: Create coverage comment (PR only)
if: github.event_name == 'pull_request'
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');

const summary = fs.readFileSync('coverage-summary.txt', 'utf8');
const lines = summary.split('\n').filter(line => line.trim());

const totalLine = lines[lines.length - 1];
const coverage = totalLine.match(/(\d+\.\d+)%/)?.[1] || 'N/A';

const body = `## 📊 Coverage Report

**Total Coverage:** ${coverage}%

### Coverage by Package
\`\`\`
${lines.slice(0, -1).join('\n')}
\`\`\`

---
*Coverage report generated by [Codecov](https://codecov.io)*`;

const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
});

const botComment = comments.find(comment =>
comment.user.type === 'Bot' && comment.body.includes('📊 Coverage Report')
);

if (botComment) {
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: botComment.id,
body: body
});
} else {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: body
});
}
continue-on-error: true

- name: Upload coverage artifacts
uses: actions/upload-artifact@v4
with:
name: coverage-reports
path: |
coverage.out
coverage.html
coverage-summary.txt
retention-days: 30

- name: Coverage summary
- name: Coverage Summary
run: |
echo "### 📊 Test Coverage Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Total Coverage:** ${{ env.COVERAGE }}%" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "#### Coverage by Package" >> $GITHUB_STEP_SUMMARY
go tool cover -func=coverage.out | tail -1
echo "## Coverage Report" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
head -n -1 coverage-summary.txt >> $GITHUB_STEP_SUMMARY
go tool cover -func=coverage.out >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "#### Coverage Standards" >> $GITHUB_STEP_SUMMARY
echo "- 🎯 Target: 70% overall, 80% for new code" >> $GITHUB_STEP_SUMMARY
Loading
Loading