Skip to content

Adopt build conventions - #16

Merged
ausimian merged 5 commits into
mainfrom
feature/build-conventions
Aug 21, 2026
Merged

Adopt build conventions#16
ausimian merged 5 commits into
mainfrom
feature/build-conventions

Conversation

@ausimian

@ausimian ausimian commented Aug 21, 2026

Copy link
Copy Markdown
Owner

Brings Castle onto the organisation's Elixir build conventions, mirroring the
structure Forecastle adopted in ausimian/forecastle#5.

mix.exs

  • @version and @source_url as the single sources of truth, with
    VERSION_OVERRIDE so CI can inject a pre-release version.
  • precommit alias plus preferred_envs, so validation runs through a single
    gate rather than piecemeal checks.
  • credo and publisho added, a default .credo.exs, and ex_doc bumped to 0.39.
  • Minimum Elixir raised to 1.18, one minor below the 1.19.5 used for tooling.
  • Explicit packaged file list, description moved up to project/0, and
    source_ref pinned to @version so generated docs link at the released tag.

CI

The organisation's build components are GitLab CI components and do not apply
here, so the pipeline mirrors Forecastle's: a precommit job on the preferred
toolchain, and a test matrix over the supported Elixir and OTP range
(1.18/27, 1.19/27-28, 1.20/27-29).

The matrix is Linux-only for now — Castle is pure Elixir talking to
:release_handler, with no shell scripts of its own since 0.3.0 and no suite
that boots a release, so there is nothing platform-sensitive to run. Until
there are tests, the matrix earns its keep on the deprecation surface, which
matters for code reaching into OTP release internals.

Publishing triggers on bare semver tags, as produced by mix publisho, and
refuses to publish if the tag and @version disagree.

Note

The publish workflow needs a HEX_API_KEY repository secret. This has now
been set on the repository.

Source changes

credo --strict findings only, no behaviour change: parentheses dropped from
the zero-arity definitions, a redundant blank line removed, and the config
provider called directly rather than through apply/3 — the function name and
arity are known, only the module varies.

Tests

mix test failed before this branch: the generated test asserted on
Castle.hello/0, which has never existed, so there was no working gate to
adopt. It is now a doctest stub.

This does not give Castle test coverage, and #8 stays open. Every function
here drives :release_handler against an installed release, and generate/1
resolves paths from :code.root_dir(), so exercising any of it needs a release
fixture booted in a workspace, as Forecastle's :e2e suite does. Forecastle's
upgrade_test.exs covers this code end to end in the meantime.

Docs

AGENTS.md describes what Castle does, how it pairs with Forecastle, and the
conventions for working on it, with CLAUDE.md importing it. It records the
known limitations and the issues tracking them (#8, #9, #10, #11) so they are
not rediscovered. RELEASE.md carries the raised Elixir requirement, the only
consumer-visible change here. CHANGELOG.md gains the publisho placeholder;
existing entries are left as published.

Refs: #8

ausimian and others added 5 commits August 21, 2026 12:49
Introduce `@version` and `@source_url` as the single sources of truth,
allow CI to inject a pre-release version via `VERSION_OVERRIDE`, and add
the `precommit` alias plus `preferred_envs` so validation runs through a
single gate. Add credo, publisho and a default `.credo.exs`, and bump
ex_doc to 0.39.

Raise the minimum Elixir to 1.18, one minor below the 1.19.5 used for
tooling. Pin the packaged file list explicitly, move the description up
to `project/0`, and add `maintainers` and a `source_ref` pinned to
`@version` so generated docs link at the released tag.

Co-Authored-By: Claude <noreply@anthropic.com>
Drop the parentheses from the zero-arity definitions, remove a redundant
blank line, and call the config provider directly rather than through
`apply/3` — the function name and arity are known, only the module
varies. No behaviour change; this is what the new `credo --strict` gate
in `mix precommit` asks for.

Co-Authored-By: Claude <noreply@anthropic.com>
The generated test called a function that has never existed, so
`mix test` failed outright and could not serve as a gate. Reduce the file
to a `doctest` stub.

This does not give Castle test coverage. Every function here drives
`:release_handler` against an installed release and `generate/1` resolves
paths from `:code.root_dir()`, so exercising any of it needs a release
fixture booted in a workspace, as Forecastle's `:e2e` suite does.
Issue #8 stays open for that.

Refs: #8

Co-Authored-By: Claude <noreply@anthropic.com>
The organisation's build components are GitLab CI components and do not
apply to this repository, so mirror the pipeline Forecastle uses: a
precommit job on the preferred toolchain, and a test matrix across the
supported Elixir and OTP range.

The matrix is Linux-only for now. Castle is pure Elixir talking to
`:release_handler`, with no shell scripts of its own since 0.3.0 and no
suite that boots a release, so there is nothing platform-sensitive to
run; macOS is worth adding alongside the fixture from #8. Until then the
matrix earns its keep on the deprecation surface, which matters for code
that reaches into OTP release internals.

Publishing triggers on bare semver tags, as produced by `mix publisho`,
and refuses to publish if the tag and `@version` disagree. It needs a
`HEX_API_KEY` repository secret.

Also ignore `.DS_Store`, which was untracked and unignored.

Co-Authored-By: Claude <noreply@anthropic.com>
Add `AGENTS.md` describing what Castle does, how it pairs with
Forecastle, and the conventions for working on it, with `CLAUDE.md` as a
wrapper that imports it. Record the known limitations and the open
issues tracking them, so they are not rediscovered.

Add `RELEASE.md` for next-release notes, carrying the raised Elixir
requirement — the only consumer-visible change on this branch. Give
`CHANGELOG.md` a Keep a Changelog preamble and the
`<!-- %% CHANGELOG_ENTRIES %% -->` placeholder that `mix publisho` folds
entries into. Existing entries are left as published.

Co-Authored-By: Claude <noreply@anthropic.com>
@ausimian

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: b70b0e85d7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ausimian
ausimian merged commit 38805c8 into main Aug 21, 2026
7 checks passed
@ausimian
ausimian deleted the feature/build-conventions branch August 21, 2026 02:59
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