Skip to content

Commit cbc78dc

Browse files
authored
chore: remove old Hugo docs generation (#856)
* chore: remove old Hugo doc publishing workflows These workflows pushed the docs.kosli.com/ directory to docs-main and staging-docs branches for Netlify Hugo builds. No longer needed now that docs are generated via Mintlify in kosli-dev/docs. Part of kosli-dev/docs#42 * chore: remove docs-gen job from release workflow, drop Hugo helm-docs output - Remove the docs-gen job that generated CLI reference markdown and pushed docs.kosli.com/ to the docs-main branch on every release - Remove the docs-gen dependency from the failure-notification job - Remove the helm-docs line that wrote to docs.kosli.com/content/helm/ The docs-repo-dispatch job is kept — it notifies kosli-dev/docs of new CLI releases so Mintlify can regenerate. Part of kosli-dev/docs#42 * chore: remove old docs Makefile targets and scripts Remove targets: cli-docs, legacy-ref-docs, generate-json-metadata, hugo, hugo-local, test_docs, check-links, and the second helm-docs output line that wrote to docs.kosli.com/. Delete scripts: - bin/test_docs_cmds.sh (tested commands embedded in Hugo markdown) - hack/generate-old-versions-docs.sh (generated legacy version docs) Part of kosli-dev/docs#42 * chore: remove docs.kosli.com/ Hugo site directory Remove the entire Hugo documentation site (239 tracked files): config, layouts, content, assets, static files, and Netlify config. Documentation is now maintained in the kosli-dev/docs Mintlify repo. Part of kosli-dev/docs#42 * chore: remove Hugo formatter, make Mintlify the default doc format - Delete internal/docgen/hugo.go and hugo_test.go - Remove --mintlify flag from `kosli docs` (Mintlify is now the only format) - Update generate_test.go and formatter_test.go to use MintlifyFormatter - Update docs_test.go to compare against Mintlify golden files - Delete Hugo golden test fixtures (testdata/output/docs/hugo/) Part of kosli-dev/docs#42 * chore: clean up remaining Hugo docs references - Remove docs.kosli.com/ patterns from .gitignore - Delete .clear-files (preserved Hugo-generated content during deploys) - Delete .htmltest.yml (pointed at Hugo build output) - Update README.md and dev-guide.md docs links - Update release-guide.md: remove old docs generation/hosting sections, document Mintlify dispatch workflow Closes kosli-dev/docs#42 * chore: mark docs cleanup slices as complete in TODO.md
1 parent 5215a94 commit cbc78dc

261 files changed

Lines changed: 26 additions & 26897 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.

.clear-files

Lines changed: 0 additions & 6 deletions
This file was deleted.

.github/workflows/helm-chart.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ jobs:
5050
run: |
5151
cd charts/k8s-reporter
5252
helm-docs --template-files README.md.gotmpl,_templates.gotmpl --output-file README.md
53-
helm-docs --template-files README.md.gotmpl,_templates.gotmpl --output-file ../../docs.kosli.com/content/helm/_index.md
5453
5554
- name: Helm Package
5655
run: helm package charts/k8s-reporter --destination package

.github/workflows/publish_branch_docs.yml

Lines changed: 0 additions & 48 deletions
This file was deleted.

.github/workflows/publish_docs.yml

Lines changed: 0 additions & 48 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -244,48 +244,6 @@ jobs:
244244
# the personal access token should have "repo" & "workflow" scopes
245245
COMMITTER_TOKEN: ${{ secrets.COMMITTER_TOKEN }}
246246

247-
docs-gen:
248-
needs: [goreleaser, pre-build]
249-
runs-on: ubuntu-latest
250-
steps:
251-
- name: Harden Runner
252-
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
253-
with:
254-
egress-policy: audit
255-
256-
- name: Checkout
257-
uses: actions/checkout@v6
258-
with:
259-
fetch-depth: 0 # needed to be able to generate legacy versions reference.
260-
261-
- name: Set up Go
262-
uses: actions/setup-go@v6
263-
with:
264-
go-version-file: '.go-version'
265-
check-latest: true
266-
267-
- name: Generate docs
268-
env:
269-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
270-
# legacy-ref should happen first as it has the side effect of deleting generated files outside the legacy_ref
271-
run: |
272-
make legacy-ref-docs
273-
make cli-docs
274-
275-
- name: Generate json
276-
run: |
277-
echo '{"currentversion": "${{ needs.pre-build.outputs.tag }}"}' > docs.kosli.com/assets/metadata.json
278-
279-
- name: Deploy
280-
uses: s0/git-publish-subdir-action@develop
281-
env:
282-
REPO: self
283-
BRANCH: docs-main
284-
FOLDER: docs.kosli.com
285-
TARGET_DIR: docs.kosli.com
286-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
287-
MESSAGE: "Release: {msg}"
288-
289247
docs-repo-dispatch:
290248
needs: [pre-build, goreleaser]
291249
runs-on: ubuntu-latest
@@ -360,7 +318,6 @@ jobs:
360318
goreleaser,
361319
binary-provenance,
362320
homebrew-pr,
363-
docs-gen,
364321
docs-repo-dispatch,
365322
evidence-reporter-upload-package-and-deploy,
366323
environment-reporter-upload-package-and-deploy,

.gitignore

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,11 @@ coverage.html
1212
licenses/
1313
**/.DS_Store
1414
.vscode/
15-
/docs/public
16-
docs.kosli.com/resources/_gen/*
17-
docs.kosli.com/content/client_reference/kosli*
18-
docs.kosli.com/public/
19-
docs.kosli.com/.netlify
2015
npm/cli*/bin/*
2116
npm/*/kosli*.tgz
2217
*.tar.gz
2318
*~
2419
/.idea
25-
# keep it uncommented on main
26-
docs.kosli.com/assets/metadata.json
2720
tmp/
2821
release_notes.md
2922
junit.xml

.htmltest.yml

Lines changed: 0 additions & 4 deletions
This file was deleted.

Makefile

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: help build clean clean-cache deps fmt lint vet docker ldflags ensure_golangci-lint check_dirty add_test_tag build_release ensure_network ensure_gotestsum test_setup test_integration test_integration_full test_integration_single test_docs cli-docs licenses upgrade-deps hugo hugo-local helm-lint helm-docs release check-links suggest-version-ai
1+
.PHONY: help build clean clean-cache deps fmt lint vet docker ldflags ensure_golangci-lint check_dirty add_test_tag build_release ensure_network ensure_gotestsum test_setup test_integration test_integration_full test_integration_single licenses upgrade-deps helm-lint helm-docs release suggest-version-ai
22
.DEFAULT: help
33
.DEFAULT_GOAL := help
44
.DELETE_ON_ERROR:
@@ -157,9 +157,6 @@ test_contract_github: ensure_gotestsum ## Run GitHub contract tests against real
157157
test_contract: test_contract_aws test_contract_github ## Run all contract tests against real external services
158158

159159

160-
test_docs: deps vet ensure_network test_setup ## Test docs
161-
./bin/test_docs_cmds.sh docs.kosli.com/content/use_cases/simulating_a_devops_system/_index.md
162-
163160
logs_integration_test_server:
164161
@docker logs cli_kosli_server ${CONTAINER} 2>&1
165162

@@ -172,13 +169,6 @@ enter_integration_test_server:
172169
docker: ## Build CLI Docker image
173170
@docker build -t kosli-cli .
174171

175-
cli-docs: build ## Generate docs
176-
@rm -f docs.kosli.com/content/client_reference/kosli*
177-
@export DOCS=true && ./$(BIN) docs --dir docs.kosli.com/content/client_reference
178-
179-
legacy-ref-docs:
180-
@./hack/generate-old-versions-docs.sh "v2.*"
181-
182172
licenses: ## Update licenses
183173
@rm -rf licenses || true
184174
@go install github.com/google/go-licenses@latest
@@ -189,23 +179,13 @@ licenses: ## Update licenses
189179
upgrade-deps: ## Update Go dependencies
190180
@go get -u ./...
191181

192-
generate-json-metadata: ## Generate docs metadata
193-
echo '{"currentversion": "vlocal"}' > docs.kosli.com/assets/metadata.json
194-
195-
hugo: cli-docs helm-docs generate-json-metadata ## Run docs locally
196-
cd docs.kosli.com && hugo server --minify --buildDrafts --port=1515
197-
198-
hugo-local: cli-docs generate-json-metadata
199-
cd docs.kosli.com && hugo server --minify --buildDrafts --port=1515
200-
201182
helm-lint: ## Lint Helm chart
202183
@cd charts/k8s-reporter && helm lint . \
203184
--set reporterConfig.kosliOrg=placeholder \
204185
--set 'reporterConfig.environments[0].name=placeholder'
205186

206187
helm-docs: helm-lint ## Update Helm docs
207188
@cd charts/k8s-reporter && docker run --rm --volume "$(PWD):/helm-docs" jnorwood/helm-docs:latest --template-files README.md.gotmpl,_templates.gotmpl --output-file README.md
208-
@cd charts/k8s-reporter && docker run --rm --volume "$(PWD):/helm-docs" jnorwood/helm-docs:latest --template-files README.md.gotmpl,_templates.gotmpl --output-file ../../docs.kosli.com/content/helm/_index.md
209189

210190
# Suggest next semver and changelog using Claude.
211191
# Writes changelog to dist/release_notes.md for use with goreleaser --release-notes.
@@ -236,10 +216,3 @@ release: ## Cut a new release and push next tag
236216
([ -f dist/release_notes.md ] && git tag -a $(tag) -F dist/release_notes.md) || git tag -a $(tag) -m"$(tag)"; \
237217
git push origin $(tag); \
238218
fi
239-
240-
# check-links:
241-
# @docker run -v ${PWD}:/tmp:ro --rm -i --entrypoint '' ghcr.io/tcort/markdown-link-check:stable /bin/sh -c 'find /tmp/docs.kosli.com/content -name \*.md -print0 | xargs -0 -n1 markdown-link-check -q -c /tmp/link-checker-config.json'
242-
243-
check-links: ## Run html test for dead links
244-
@cd docs.kosli.com && hugo --minify
245-
@docker run -v ${PWD}:/test --rm wjdp/htmltest -c .htmltest.yml -l 1

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This repo contains the Kosli CLI, for recording and querying software delivery e
77

88
Some useful links:
99

10-
* [Documentation site](https://docs.kosli.com/client_reference/) for full details on usage.
10+
* [Documentation site](https://docs.kosli.com/) for full details on usage.
1111
* [Developer guide](/dev-guide.md) for details on working with the code in this repo.
1212
* [Kosli main Trails](https://app.kosli.com/kosli-public/flows/cli/trails/)
1313
* [Kosli release Trails](https://app.kosli.com/kosli-public/flows/cli-release/trails/)

TODO.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@
33
<!-- Each feature gets its own ## section below. -->
44
<!-- Only edit YOUR feature's section. Delete it after merging to main. -->
55

6+
## Clean up old docs generation (kosli-dev/docs#42)
7+
8+
- [x] Slice 1: Remove old doc workflows (`publish_docs.yml`, `publish_branch_docs.yml`)
9+
- [x] Slice 2: Remove `docs-gen` job from `release.yml` + helm-chart.yml docs.kosli.com line
10+
- [x] Slice 3: Remove Makefile targets + scripts (`bin/test_docs_cmds.sh`, `hack/generate-old-versions-docs.sh`)
11+
- [x] Slice 4: Remove `docs.kosli.com/` directory
12+
- [x] Slice 5: Remove Hugo formatter (`internal/docgen/hugo.go`, `hugo_test.go`), update `docs.go` default
13+
- [x] Slice 6: Clean up references (`.gitignore`, `.clear-files`, `.htmltest.yml`, README, dev-guide, release-guide) — closes kosli-dev/docs#42
14+
615
## Fix: git worktree HEAD resolution
716

817
- [x] Slice 1: Enable `EnableDotGitCommonDir` in `gitview.New()` so HEAD resolves in worktrees

0 commit comments

Comments
 (0)