Commit graph

57 commits

Author SHA1 Message Date
Snider
63e4b35a9a chore: add .core/ build and release configs
Add go-devops build system configuration for standardised
build, test, and release workflows across the Go ecosystem.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-06 18:52:36 +00:00
Snider
fd95028f2c feat(docs): add gohelp sync target
core docs sync --target gohelp collects repo docs/ folders
into flat content/{package}/ structure for go-help static gen.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-06 16:39:50 +00:00
Snider
f5064a72be chore: sync go.mod dependencies
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-06 15:22:48 +00:00
Snider
5a0aee4b2b refactor: swap pkg/framework imports to pkg/core
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-06 14:11:01 +00:00
Snider
3fcefd5edc refactor: swap pkg/repos import to go-scm/repos
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-06 13:48:08 +00:00
Snider
278e89e292 refactor: swap pkg/{io,log} imports to go-io/go-log
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-06 12:35:24 +00:00
Snider
8e8d356616 refactor: use core/go-i18n module instead of core/go/pkg/i18n
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-06 09:09:07 +00:00
Snider
28e1b85718 feat: add go-php dependency for PHP/Laravel command awareness
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-04 17:40:10 +00:00
Snider
4c7e5c7b42 chore: bump forge.lthn.ai dep versions to latest tags
Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-26 05:34:23 +00:00
Claude
8c9fdca5a6
docs: archive completed plans
All 8 plan files (4 design + 4 impl) verified as completed against
codebase and git history. Each archived with completion summary
documenting date, key files built, and test coverage.

Archived plans:
- core-devops (design + impl): devops/ package fully implemented
- code-signing (design + impl): build/signing/ package fully implemented
- sdk-generation (design + impl): sdk/ package fully implemented
- sdk-release (design + impl): release/sdk.go fully implemented

Remaining in docs/plans/:
- docs-sync-next-steps.md: reference document for future setup steps

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 18:08:28 +00:00
db185dec37 Merge pull request 'chore: Go 1.26 modernization' (#2) from chore/go-1.26-modernization into main 2026-02-24 18:01:41 +00:00
Claude
31985fa801
chore: use slices.Sorted(maps.Keys()) for ordered iteration 2026-02-24 15:45:03 +00:00
Claude
f4848deda6
chore: sort.Strings → slices.Sort 2026-02-24 15:44:09 +00:00
Claude
02a27dde71
chore: use slices.Contains for linear search 2026-02-24 15:43:09 +00:00
Claude
e3c2315c6a
chore: use %w for error wrapping 2026-02-24 15:41:11 +00:00
Claude
801bbe15e5
chore: fmt.Errorf(static) → errors.New 2026-02-24 15:38:34 +00:00
Claude
efa2f59e6e
chore: replace interface{} with any (Go 1.18+ alias) 2026-02-24 15:37:42 +00:00
Claude
cdcbd5a7bd
fix: update go.sum checksums for forge.lthn.ai modules 2026-02-24 15:37:23 +00:00
Snider
4ef438dc40 chore: refresh go.sum after upstream tag updates
Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-23 06:35:19 +00:00
Snider
f9eb54b856 refactor: modernise to Go 1.26 — iterators, slices, maps, strings
- Add ParsePlaybookIter, ParseTasksIter, GetHostsIter, AllHostsIter (ansible)
- Add ListTemplatesIter (container), TargetsIter (build), LanguagesIter (sdk)
- Replace sort.Slice with slices.SortFunc across cmd/dev, cmd/qa, cmd/monitor, cmd/setup
- Replace manual map-key-sort with slices.Sorted(maps.Keys(...))
- Replace strings.Split with strings.SplitSeq where result is iterated (devkit)
- Replace range-over-int in complexity_test, ansible/modules, devops
- Remove redundant manual min() in favour of built-in
- 22 files, all tests pass

Co-Authored-By: Gemini <noreply@google.com>
Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-23 06:24:37 +00:00
Claude
171becfdd6
chore: refresh go.sum after upstream tag updates
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 23:36:25 +00:00
Snider
ac6cff9b18 refactor: migrate CLI imports from core/go to core/cli
Update 58 files from forge.lthn.ai/core/go/pkg/cli to
forge.lthn.ai/core/cli/pkg/cli. Also fix pre-existing broken
imports: cmd/workspace → go-agentic, cmd/dev → self-reference.

Resolves circular dependency that caused qa docblock stub in core/go.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-22 23:28:58 +00:00
Claude
42613e2625
chore: migrate Snider deps from github.com to forge.lthn.ai
Update Borg dependency path from github.com/Snider/Borg to
forge.lthn.ai/Snider/Borg across go.mod and imports.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 21:40:28 +00:00
Snider
1c27bc4ca9 feat: absorb dev tooling commands from CLI
cmd/dev — multi-repo workflow (work, push, pull, commit, health)
cmd/setup — project bootstrap, CI, GitHub config
cmd/qa — code quality, review, docblock checking
cmd/docs — docs scan/sync/list
cmd/gitcmd — git helpers
cmd/monitor — monitoring

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-21 21:45:58 +00:00
Snider
b95d465499 refactor: move updater to dedicated core/go-update repo
Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-21 21:38:27 +00:00
Snider
338a0a4c5e feat: absorb vanity-import, community, and updater from CLI
Moved from core/cli as part of repo cleanup:
- cmd/vanity-import/ — Go vanity import server
- cmd/community/ — community landing page
- cmd/updater/ — self-update service with Angular UI

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-21 21:33:23 +00:00
Snider
3e630139ad feat: add Woodpecker CI pipelines from CLI
Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-21 21:18:35 +00:00
Snider
5c0dd15f64 fix: remove duplicate nested plans directory
Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-21 21:17:02 +00:00
Snider
7b69124264 feat: add Ansible playbooks and design plans from CLI
- playbooks/: galera-backup, galera-deploy, redis-deploy, inventory
- docs/plans/: code-signing, core-devops, sdk-generation, sdk-release designs

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-21 21:16:52 +00:00
Snider
cd7e728280 feat: absorb core/ci commands + add reusable workflows
Merge core/ci repo into go-devops:
- cmd/ci: release publish, init, changelog, version commands
- cmd/sdk: API diff and OpenAPI validation commands

Add reusable Forgejo Actions workflows:
- security-scan.yml: govulncheck + gitleaks + trivy
- go-test.yml: test with optional race/coverage
- docker-publish.yml: build + push to registry

Other repos can call these via:
  uses: core/go-devops/.forgejo/workflows/security-scan.yml@main

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-21 21:01:46 +00:00
Snider
400d8a7690 feat: migrate deploy, prod, vm commands from CLI
Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-21 19:38:18 +00:00
Snider
4b5739fbd7 chore: resolve forge deps from registry, remove local replaces
Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-21 19:21:00 +00:00
Claude
802a054ffe
fix(go.mod): correct replace path ../core to ../go
The framework lives at ../go in the canonical workspace layout.
The ../core path was a symlink-specific workaround that broke
the CLI go.work build.

Co-Authored-By: Charon <charon@lethean.io>
2026-02-20 15:29:53 +00:00
Snider
9d433f6b43 docs: add README with quick start and docs links
Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-20 15:11:26 +00:00
Snider
12ad23610f docs: graduate TODO/FINDINGS into production documentation
Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-20 15:03:18 +00:00
Snider
9996754cc4 docs(todo): add commit hash to Phase 4 entries
Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-20 06:28:59 +00:00
Snider
e20083d51b feat(devkit): Phase 4 — vulnerability scanning, complexity analysis, coverage trending
- govulncheck JSON output parsing with structured VulnFinding types (13 tests)
- Cyclomatic complexity analysis via go/ast with configurable threshold (21 tests)
- Coverage snapshot persistence and regression detection with CoverageStore (19 tests)

53 new tests, 68 total devkit tests. All pass with -race.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-20 06:28:37 +00:00
Snider
7aaa2154b6 test(release): Phase 3 — publisher integration, SDK generation, breaking change detection
Publisher integration tests (48 tests): dry-run verification for all 8 publishers
(GitHub, Docker, Homebrew, Scoop, AUR, Chocolatey, npm, LinuxKit), command building,
config parsing, repository detection, artifact handling, cross-publisher name
uniqueness, nil relCfg handling, checksum mapping, interface compliance.

SDK generation tests (38 tests): orchestration, generator registry, interface
compliance for all 4 languages (TypeScript, Python, Go, PHP), config defaults,
SetVersion, spec detection priority across all 8 common paths.

Breaking change detection tests (30 tests): oasdiff integration covering
add/remove endpoints, required/optional params, response type changes,
HTTP method removal, identical specs, multiple breaking changes, JSON format
support, error handling, DiffExitCode, DiffResult structure.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-20 05:28:20 +00:00
Snider
50ad540241 feat(infra): Phase 2 — API client abstraction, retry logic, rate limiting
Extract shared APIClient from HCloudClient/HRobotClient/CloudNSClient with
configurable retry (exponential backoff + jitter), 429 rate-limit handling
(Retry-After header), and functional options (WithHTTPClient, WithRetry,
WithAuth, WithPrefix). 30 new client_test.go tests covering retry exhaustion,
rate-limit queuing, context cancellation, and integration with all 3 providers.
DigitalOcean: no code existed, removed stale doc references. 66 infra tests
pass, race-clean.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-20 04:11:08 +00:00
Snider
c8615ce61e docs(todo): mark Phase 1 complete — 438 ansible tests
All 5 steps done: SSH mock, command, file, service/package,
user/group/advanced, and error/become/facts/idempotency modules.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-20 02:58:50 +00:00
Snider
8ab8643e88 test(ansible): Phase 1 Step 1.5 — error propagation, become, facts & idempotency
104 new tests covering cross-cutting concerns:
- Error propagation (68): getHosts, matchesTags, evaluateWhen,
  templateString, applyFilter, resolveLoop, handleNotify, normalizeConditions
- Become/sudo (8): enable/disable, passwordless, default user
- Fact gathering (9): Ubuntu/CentOS/Alpine/Debian os-release parsing
- Idempotency (8): group exists, key present, docker compose up-to-date
Total ansible tests: 438. Phase 1 complete.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-20 02:58:27 +00:00
Snider
ecd01b1efd docs(todo): mark Phase 1 Step 1.4 complete (427929f)
Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-20 02:53:00 +00:00
Snider
427929f0e9 test(ansible): Phase 1 Step 1.4 — user/group & advanced module tests
69 new tests for user (7), group (7), cron (5), authorized_key (7),
git (8), unarchive (8), uri (6), ufw (8), docker_compose (7), and
dispatch (6) modules. 9 module shims added to mock infrastructure.
Total ansible tests: 334, all passing.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-20 02:52:42 +00:00
Snider
54974bd283 docs(todo): mark Phase 1 Step 1.3 complete (9638e77)
Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-20 02:45:09 +00:00
Snider
9638e77f30 test(ansible): Phase 1 Step 1.3 — service & package module tests
56 new tests for service (12), systemd (4), apt (9), apt_key (6),
apt_repository (8), package (3), pip (8), and dispatch (7) modules.
Extended mock with 7 module shims for sshRunner interface.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-20 02:44:50 +00:00
Snider
7e4e917272 docs(todo): mark Phase 1 Step 1.2 complete (c7da9ad)
Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-20 02:39:56 +00:00
Snider
acd87c263a test(build): add builder detection and config tests
83 LOC docker, 224 LOC linuxkit, 234 LOC taskfile builder tests.
Tests cover Name(), Detect(), Build() and config parsing.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-20 02:39:32 +00:00
Snider
c7da9ad16c test(ansible): Phase 1 Step 1.2 — file operation module tests
54 new tests for copy/file/lineinfile/blockinfile/stat/template modules.
Extended mock_ssh_test.go with sshFileRunner interface and 6 module shims.
Fixed unsupported module test (copy→hostname now that copy is supported).
Total ansible tests: 208.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-20 02:39:27 +00:00
Snider
fd46e82297 docs(todo): mark Phase 1 Steps 1.0-1.1 complete (3330e55)
Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-20 02:32:15 +00:00
Snider
3330e55b2b test(ansible): Phase 1 Steps 1.0-1.1 — SSH mock + command module tests
Step 1.0: MockSSHClient with command registry, file system simulation,
become state tracking, execution log, upload log, and assertion helpers.
Module shims via sshRunner interface for testability.

Step 1.1: 48 tests for command/shell/raw/script modules verifying:
- command uses Run(), shell uses RunScript()
- chdir wrapping, non-zero RC, SSH error propagation
- raw passes through without shell wrapping
- script reads local file content, sends via RunScript()
- Cross-module dispatch differentiation
- Template variable resolution in args

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-20 02:31:48 +00:00