Skip to content

Add EUPL-1.2 license and enhance repository structure and tests#7

Merged
Snider merged 21 commits into
mainfrom
dev
Jun 29, 2026
Merged

Add EUPL-1.2 license and enhance repository structure and tests#7
Snider merged 21 commits into
mainfrom
dev

Conversation

@Snider

@Snider Snider commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

This pull request introduces several important changes to repository structure, licensing, and code quality for the go-ansible project. The main highlights are the addition of a formal open source license, improved test coverage for utility functions, and updates to comply with canonical repository conventions. Several documentation and configuration files were also updated or removed for clarity and maintainability.

Repository and Licensing Updates:

  • Added the full text of the European Union Public Licence v. 1.2 as LICENCE, formally licensing the project under the EUPL.
  • Introduced .core/go.yaml to mark this as a managed canonical Go repository, specifying metadata such as project name, type, Go module path, and required Go version.
  • Updated go.work to require Go version 1.26.2 (was 1.26.0) for workspace builds.

Testing and Quality Improvements:

  • Added new unit tests in go/cmd/ansible/command_result_test.go to verify the behavior of commandResultStdout and commandResultExitCode utility functions.
  • Added new unit tests in go/cmd/ansible/core_primitives_test.go for utility functions such as absPath, cleanPath, repeat, and fields, increasing coverage of core primitives.

API and Code Consistency:

  • Changed the Register function signature in go/cmd/ansible/cmd.go to return core.Result (instead of void), aligning with the canonical Register signature and improving error handling. [1] [2]

Dependency and Documentation Maintenance:

  • Updated submodule references for external/go, external/go-io, and external/go-log to their latest commit hashes. [1] [2] [3]
  • Removed CONSUMERS.md and CONVENTION_DRIFT_REPORT.md to clean up stale or redundant documentation. [1] [2]

These changes improve the project’s maintainability, licensing clarity, and test coverage, while ensuring alignment with canonical repository standards.

Snider and others added 21 commits May 1, 2026 08:33
Reference: core/api/LICENCE.

Co-Authored-By: Cladius Maximus <cladius@lethean.io>
…block)

- git submodule update on external/* to current dev tips
- go.work paths fixed for Phase 1 /go/ subtree layout where stale
- go.work go-version bumped 1.26.0 → 1.26.2 to match submodule floor

Workspace-mode build (`go build ./...`) is the verification path. Some
repos may surface transitive dep issues (api/go.sum checksum drift, etc.)
which are separate cascade tickets — not blocking this metadata refresh.

Co-Authored-By: Cladius Maximus <cladius@lethean.io>
…untime subdirs

The .core/ root holds tracked Lethean canon config (go.yaml, build.yaml,
agents.yaml, etc.). Only the runtime subdirs (workspace/, vm/, cache/,
runtime/) and per-repo runtime artifacts should be gitignored.

Brings this repo into the managed canonical set per audit-sweep
discovery filter.

Co-Authored-By: Cladius Maximus <cladius@lethean.io>
…tis #1371)

Add the canonical Service.go pattern from Mantis #1336 to go-ansible:

- NEW go/service.go — root ansible package gets Options + Service +
  NewService(opts) + Register(c) returning core.Result. Service embeds
  *core.ServiceRuntime[Options] and exposes a pre-wired *Parser via
  Service.Parser(). NewService is the factory shape; Register is the
  defaults shorthand that routes through NewService(Options{}).

- go/cmd/ansible/cmd.go — CLI Register(c) signature changes to return
  core.Result (Ok(nil) on success), matching the canonical Register
  shape. Existing test sites (cmd_test.go, cmd_example_test.go) discard
  the return value and continue working unchanged.

Smoke-tested inline (deleted before commit per discipline of the
canonical references in go-pool / go-tenant / go-rag / go-html).

GOWORK=off go vet ./... clean. go test -count=1 ./... green.

Closes tasks.lthn.sh/view.php?id=1371

Co-Authored-By: Hephaestus <hephaestus@lthn.ai>
Co-Authored-By: Virgil <virgil@lethean.io>
Adds permanent service_test.go covering the canonical Service surface
introduced in commit 731a6b9 (Mantis #1371 / #1336). The original ship
deleted inline smokes per the per-#1336 discipline; this restores them
as durable coverage now that the canon pattern has stabilised.

Tests cover:
- NewService(Options{}) default — Parser pre-wired at process working dir
- NewService(Options{BasePath}) — Parser flows through BasePath
- Register(c) shorthand — equivalent default-Options registration
- nil-receiver Parser() guard returns nil rather than panicking

service.go function-level: NewService 100%, Register 100%, Parser 100%.
Root pkg: 72.9% → 73.0%.

Co-authored-by: Hephaestus <hephaestus@lthn.ai>
Co-Authored-By: Virgil <virgil@lethean.io>
Co-authored-by: Hephaestus <hephaestus@lthn.ai>
Adds in-package table tests for the template filter coercion helpers in
template_features.go that were previously 15-30% covered:
templateBool, templateInt, templateFloat, templateLength,
templateValueGreater, templateMinMax, templateStringify and
isEmptyTemplateValue. Exercises every numeric kind, the string-parse
paths, the reflect fallbacks and the empty/unresolved-placeholder
branches.

Co-Authored-By: Virgil <virgil@lethean.io>
Adds in-package deep-copy independence tests for async_features.go,
which were almost entirely uncovered. Builds populated Task/Play/
RoleRef/Inventory/Host/TaskResult/Facts values, clones them, mutates
the clone's maps, slices and pointer fields, and asserts the source is
untouched — plus nil/empty edge cases that return nil and the
unknown-type passthrough in cloneAnyValue. Lifts package coverage
73.0% -> 76.4%.

Co-Authored-By: Virgil <virgil@lethean.io>
Adds Good/Bad/Ugly triplets for the previously-uncovered core_primitives
helpers (absPath, repeat, sprint, writeString, replaceN limit/negative
paths, stringIndex/stringLastIndex edges, cut) and for
mergeInventoryGroups in types.go (host/child/vars merge, nil-operand
no-panic, nil-dst-map allocation). Lifts package coverage 76.4% -> 77.0%.

Co-Authored-By: Virgil <virgil@lethean.io>
Adds Good/Bad/Ugly triplets for the cmd/ansible result helpers
(commandResultStdout, commandResultExitCode — missing-key, wrong-type
and non-map paths) and the previously-uncovered local core/go shims
(absPath, cleanPath, repeat, fields), plus an ExamplePrintln
comment-as-usage example. Lifts cmd/ansible coverage 47.7% -> 58.2%.

Co-Authored-By: Virgil <virgil@lethean.io>
Adds Good/Bad/Ugly triplets for the loop-spec parsing helpers in
executor.go: sequenceSpecInt (numeric kinds, unsigned, non-numeric),
parseSequenceSpec (string + map forms, count-derives-end,
descending-flips-step, and the missing-end/zero-stride/non-numeric
error paths), buildSequenceValues/formatSequenceValue, plus
parseSkipMissingValue and parseSubelementsSpec across their slice,
string and map input shapes. Lifts package coverage 77.0% -> 77.8%.

Co-Authored-By: Virgil <virgil@lethean.io>
Adds Good/Bad/Ugly triplets for the module/condition helpers in
modules.go and executor.go: getIntArg, normalizeStatusCodes
(scalar/slice/string/mixed-any), normalizeStringList vs
normalizeStringArgs (comma-split divergence, nil/blank, mixed-type any
slices), osFamilyFromReleaseID family mapping, and the
templateConditionEqual/Compare/Contains predicates across numeric,
lexical, slice and map-key paths. Lifts package coverage 77.8% -> 78.4%.

Co-Authored-By: Virgil <virgil@lethean.io>
Adds runnable Example functions (AX principle 2) for NewService,
Register and Service.Parser, mirroring the WithService/MustServiceFor
usage shown in the service.go doc-comments. Closes the AX-7
missing-example gap for service.go.

Co-Authored-By: Virgil <virgil@lethean.io>
Adds Good/Bad/Ugly triplets for isEmptyLoopValue (native + reflect
kinds), firstFoundTerms (string/slice/files+paths map/terms fallback),
commandArgv (string-slice/any-slice/scalar), gatherSubsetKeys (known
+ unknown subsets), passwordLookupCharset (named sets + dedup across
overlapping sets), parsePasswordLookupSpec (options + invalid-length
ignore + bare defaults) and generatePassword (seeded determinism,
default fallbacks, unseeded length). Lifts package coverage
78.4% -> 78.9%.

Co-Authored-By: Virgil <virgil@lethean.io>
Adds Good/Bad/Ugly triplets for parseActionSpec/parseActionSpecString
(string key=value args, map form, module-only, free-form _raw_params,
empty/no-module) and the with_nested/with_together loop-group helpers
nestedLoopGroups, nestedLoopItems and togetherLoopGroups across slice,
string and scalar input shapes. Lifts package coverage 78.9% -> 79.5%.

Co-Authored-By: Virgil <virgil@lethean.io>
Adds Good/Bad/Ugly triplets for the uri-module body helpers in
modules.go: multipartFieldValues, multipartBodyFields (sorted-map,
empty, any-slice-of-pairs), renderURIBodyFormEncoded (sorted-map,
string passthrough, slice/nil values), plus isHexDigest and
parseGetURLChecksumFile (filename match, single-field digest, no-digest
error, first-digest fallback). Lifts package coverage 79.5% -> 80.0%.

Co-Authored-By: Virgil <virgil@lethean.io>
… helpers

Adds Good/Bad/Ugly triplets for the shell/key/serial helpers:
shellQuote, wrapLocalBecomeCommand (root/no-password vs password +
quote escaping), sedExactLinePattern, isAuthorizedKeyType,
authorizedKeyBase (type+key, no-type passthrough, type-without-key),
rewriteAuthorizedKeyContent (append, already-present no-change,
empty-line removal) and resolveSerialBatchSizes/resolveSerialBatchSize
(int/nil, non-positive total, percent + mixed slice). Lifts package
coverage 80.0% -> 80.2%.

Co-Authored-By: Virgil <virgil@lethean.io>
Adds Good/Bad/Ugly triplets for parseExtraVarsScalar (typed scalars,
empty passthrough, structured-kept-as-raw-string) and the local string
shims trimCutset, containsRune, dirSep, plus an ExamplePrint
comment-as-usage example. Lifts cmd/ansible coverage 58.2% -> 60.5%.

Co-Authored-By: Virgil <virgil@lethean.io>
Advance external/go workspace submodule to v0.10.4 so dev (GOWORK on) and standalone (GOWORK=off) builds resolve the same core/go.

Co-Authored-By: Virgil <virgil@lethean.io>
Co-Authored-By: Virgil <virgil@lethean.io>
Co-Authored-By: Virgil <virgil@lethean.io>
@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Snider, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 27 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 24cba73b-e4b5-4e29-b33e-1b537cfbc038

📥 Commits

Reviewing files that changed from the base of the PR and between 10ff473 and 36d72a1.

⛔ Files ignored due to path filters (2)
  • go.work is excluded by !**/*.work
  • go/go.sum is excluded by !**/*.sum
📒 Files selected for processing (26)
  • .core/go.yaml
  • .gitignore
  • CONSUMERS.md
  • CONVENTION_DRIFT_REPORT.md
  • LICENCE
  • external/go
  • external/go-io
  • external/go-log
  • go/async_features_test.go
  • go/cmd/ansible/cmd.go
  • go/cmd/ansible/command_result_test.go
  • go/cmd/ansible/core_primitives_test.go
  • go/cmd/ansible/extravars_scalar_test.go
  • go/core_primitives_test.go
  • go/executor_lookup_test.go
  • go/executor_sequence_test.go
  • go/go.mod
  • go/modules_helpers_test.go
  • go/modules_shell_test.go
  • go/modules_uri_test.go
  • go/parser_helpers_test.go
  • go/service.go
  • go/service_example_test.go
  • go/service_test.go
  • go/template_features_test.go
  • go/types_merge_test.go

Warning

Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Snider Snider merged commit 928b4e7 into main Jun 29, 2026
5 of 7 checks passed
@sonarqubecloud

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown

❌ The last analysis has failed.

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant