diff --git a/.chglog/CHANGELOG.tpl.md b/.chglog/CHANGELOG.tpl.md new file mode 100644 index 0000000..7db56e1 --- /dev/null +++ b/.chglog/CHANGELOG.tpl.md @@ -0,0 +1,60 @@ +{{ if .Versions -}} + +## [Unreleased] + +{{ if .Unreleased.CommitGroups -}} +{{ range .Unreleased.CommitGroups -}} +### {{ .Title }} + +{{ range .Commits -}} +- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }} +{{ end }} +{{ end -}} +{{ end -}} +{{ end -}} + +{{ range .Versions }} + +## {{ if .Tag.Previous }}[{{ .Tag.Name }}]{{ else }}{{ .Tag.Name }}{{ end }} - {{ datetime "2006-01-02" .Tag.Date }} +{{ range .CommitGroups -}} +### {{ .Title }} + +{{ range .Commits -}} +- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }} +{{ end }} +{{ end -}} + +{{- if .RevertCommits -}} +### Reverts + +{{ range .RevertCommits -}} +- {{ .Revert.Header }} +{{ end }} +{{ end -}} + +{{- if .MergeCommits -}} +### Pull Requests +{{ range .MergeCommits -}} +- {{ .Header }} +{{ end }} +{{ end -}} + +{{- if .NoteGroups -}} +{{ range .NoteGroups -}} +### {{ .Title }} + +{{ range .Notes }} +{{ .Body }} +{{ end }} +{{ end -}} +{{ end -}} +{{ end -}} + +{{- if .Versions }} +[Unreleased]: {{ .Info.RepositoryURL }}/compare/{{ $latest := index .Versions 0 }}{{ $latest.Tag.Name }}...HEAD +{{ range .Versions -}} +{{ if .Tag.Previous -}} +[{{ .Tag.Name }}]: {{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }} +{{ end -}} +{{ end -}} +{{ end -}} diff --git a/.chglog/config.yml b/.chglog/config.yml new file mode 100644 index 0000000..aa5fce8 --- /dev/null +++ b/.chglog/config.yml @@ -0,0 +1,64 @@ +style: none +template: CHANGELOG.tpl.md +info: + title: CHANGELOG + repository_url: https://github.com/KubeRocketCI/claude-code-telemetry + +options: + tag_filter_pattern: '^v' + sort: "semVer" + + commits: + filters: + Type: + - feat + - fix + - perf + - refactor + - style + - test + - docs + - ci + - build + - deps + - chore + + commit_groups: + group_by: Type + sort_by: Custom + title_order: + - feat + - fix + - perf + - refactor + - style + - test + - docs + - ci + - build + - deps + - chore + title_maps: + feat: Features + fix: Bug Fixes + perf: Performance Improvements + refactor: Code Refactoring + style: Formatting + test: Testing + docs: Documentation + ci: CI + build: Build + deps: Dependencies + chore: Routine + + header: + # Matches optional Jira prefix (e.g. "EPMDEDP-123: "), a conventional-commit + # type, an optional scope like "(deps)", and an optional "!" breaking marker. + pattern: "^(?:[A-Z]+-\\d+:\\s)?(\\w+)(?:\\(.+?\\))?!?:\\s(.*)$" + pattern_maps: + - Type + - Subject + + notes: + keywords: + - "BREAKING CHANGE:" diff --git a/.chglog/release.tpl.md b/.chglog/release.tpl.md new file mode 100644 index 0000000..893aa16 --- /dev/null +++ b/.chglog/release.tpl.md @@ -0,0 +1,29 @@ +{{ range .Versions }} + +## {{ if .Tag.Previous }}[{{ .Tag.Name }}]{{ else }}{{ .Tag.Name }}{{ end }} - {{ datetime "2006-01-02" .Tag.Date }} +{{ range .CommitGroups -}} +### {{ .Title }} + +{{ range .Commits -}} +- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }} +{{ end }} +{{ end -}} + +{{- if .NoteGroups -}} +{{ range .NoteGroups -}} +### {{ .Title }} + +{{ range .Notes }} +{{ .Body }} +{{ end }} +{{ end -}} +{{ end -}} +{{ end -}} + +{{- if .Versions }} +{{ range .Versions -}} +{{ if .Tag.Previous -}} +[{{ .Tag.Name }}]: {{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }} +{{ end -}} +{{ end -}} +{{ end -}} diff --git a/.github/workflows/pr-validation.yml b/.github/workflows/pr-validation.yml new file mode 100644 index 0000000..80187bb --- /dev/null +++ b/.github/workflows/pr-validation.yml @@ -0,0 +1,48 @@ +name: Commit Message Validation + +on: + pull_request: + branches: + - main + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +permissions: + contents: read + pull-requests: read + +jobs: + check-commit-message: + name: Validate commit messages + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v7 + with: + fetch-depth: 0 + + - name: Check commit format + uses: gsactions/commit-message-checker@v2 + with: + # Human commits MUST carry a Jira ID: "EPMDEDP-: : ". + # The only exception is Dependabot bumps, which cannot reference a + # ticket (e.g. "deps(deps): bump ..." or "ci: bump ..."). + pattern: '^(EPMDEDP-\d+: (build|chore|ci|docs|feat|fix|perf|refactor|style|test)(!)?: .+|(build|chore|ci|deps)(\(deps\))?: [Bb]ump .+)$' + error: 'Commit title must be "EPMDEDP-: : " (Jira ID is mandatory). Example: "EPMDEDP-16058: feat: add feature".' + excludeDescription: 'true' + excludeTitle: 'true' + checkAllCommitMessages: 'true' + accessToken: ${{ secrets.GITHUB_TOKEN }} + + - name: Check commit title length + uses: gsactions/commit-message-checker@v2 + with: + pattern: '^.{10,120}$' + error: 'Commit title must be between 10 and 120 characters long.' + excludeDescription: 'true' + excludeTitle: 'true' + checkAllCommitMessages: 'true' + accessToken: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..119b63d --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,51 @@ +name: Create KRCI release + +on: + push: + tags: + - 'v*' + +env: + GO_VERSION: '1.25.8' + GITCHGLOG_VERSION: 'v0.15.4' + +permissions: + contents: write + +jobs: + prepare-release: + name: Perform automatic release on trigger ${{ github.ref }} + runs-on: ubuntu-latest + env: + # The name of the tag as supplied by the GitHub event, e.g. refs/tags/v0.1.0 + SOURCE_TAG: ${{ github.ref }} + steps: + - name: Checkout code + uses: actions/checkout@v7 + with: + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@v6 + with: + go-version: ${{ env.GO_VERSION }} + + - name: Generate release notes + run: | + set -xue + + # refs/tags/v0.1.0 -> v0.1.0 + RELEASE_TAG="${SOURCE_TAG##*/}" + + go install github.com/git-chglog/git-chglog/cmd/git-chglog@${GITCHGLOG_VERSION} + + git-chglog --template .chglog/release.tpl.md -o release.md "${RELEASE_TAG}" + + echo "RELEASE_TAG=${RELEASE_TAG}" >> "$GITHUB_ENV" + + - name: Create GitHub release + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ env.RELEASE_TAG }} + name: ${{ env.RELEASE_TAG }} + body_path: release.md diff --git a/.gitignore b/.gitignore index c81816a..8d7918a 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,6 @@ deploy-templates/Chart.lock # Claude local .claude/settings.local.json + +# Tools +bin/ diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..bd38add --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,32 @@ + +## [Unreleased] + + + +## v0.1.0 - 2026-07-11 +### Features + +- add role-audit Wave 1 widgets for delivery, safety, and session diagnostics +- add adoption, efficiency, and plugin governance panels +- add Session Explorer dashboard and security audit panels +- add Efficiency & ROI and Governance & Security dashboards +- add spec/ vocabulary of full Claude Code OTEL surface +- add Operations & Adoption dashboard for DAU/WAU/MAU and API health + +### Bug Fixes + +- pin prometheus server service name so the Grafana datasource resolves +- enable health_check extension so collector liveness probes pass on Kubernetes +- render audit bar charts as one bar per category instead of timestamp series +- align dashboards with OTel counter metric names and add collector health dashboard + +### Documentation + +- Update documentation + +### Routine + +- bootstrap claude-code-telemetry (local testbed + self-contained Helm bundle) + + +[Unreleased]: https://github.com/KubeRocketCI/claude-code-telemetry/compare/v0.1.0...HEAD diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..1e8001b --- /dev/null +++ b/Makefile @@ -0,0 +1,45 @@ +CURRENT_DIR = $(shell pwd) +LOCALBIN ?= $(CURRENT_DIR)/bin + +# Tool Versions +GITCHGLOG_VERSION ?= v0.15.4 +HELMDOCS_VERSION ?= v1.14.2 + +GITCHGLOG ?= $(LOCALBIN)/git-chglog +HELMDOCS ?= $(LOCALBIN)/helm-docs + +SHELL = /bin/bash -o pipefail -o errexit + +.PHONY: all +all: help + +$(LOCALBIN): + mkdir -p $(LOCALBIN) + +# use https://github.com/git-chglog/git-chglog/ +.PHONY: changelog +changelog: git-chglog ## Generate CHANGELOG.md from conventional commits +ifneq (${NEXT_RELEASE_TAG},) + $(GITCHGLOG) --next-tag v${NEXT_RELEASE_TAG} -o CHANGELOG.md +else + $(GITCHGLOG) -o CHANGELOG.md +endif + +.PHONY: git-chglog +git-chglog: $(GITCHGLOG) ## Download git-chglog locally if necessary +$(GITCHGLOG): $(LOCALBIN) + @test -x $(GITCHGLOG) || GOBIN=$(LOCALBIN) go install github.com/git-chglog/git-chglog/cmd/git-chglog@$(GITCHGLOG_VERSION) + +# use https://github.com/norwoodj/helm-docs/ +.PHONY: helm-docs +helm-docs: helmdocs ## Generate Helm chart docs (deploy-templates/README.md) + $(HELMDOCS) --chart-search-root deploy-templates + +.PHONY: helmdocs +helmdocs: $(HELMDOCS) ## Download helm-docs locally if necessary +$(HELMDOCS): $(LOCALBIN) + @test -x $(HELMDOCS) || GOBIN=$(LOCALBIN) go install github.com/norwoodj/helm-docs/cmd/helm-docs@$(HELMDOCS_VERSION) + +.PHONY: help +help: ## Display this help screen + @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[a-zA-Z0-9_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 }' $(MAKEFILE_LIST) diff --git a/ct.yaml b/ct.yaml new file mode 100644 index 0000000..1f0580a --- /dev/null +++ b/ct.yaml @@ -0,0 +1,9 @@ +validate-maintainers: false +# Register the remote repositories for the chart's external subchart +# dependencies so `ct lint` can build them on a clean CI node (where no +# `helm repo add` has run yet). See deploy-templates/Chart.yaml dependencies. +chart-repos: + - opentelemetry=https://open-telemetry.github.io/opentelemetry-helm-charts + - grafana=https://grafana.github.io/helm-charts + - prometheus-community=https://prometheus-community.github.io/helm-charts +helm-dependency-extra-args: "--skip-refresh"