Boundary module that gathers run context data from the real world: git, CI environment variables, the system clock and the runtime.
gather/1 returns a plain map suitable for Temper.RunContext.new/1.
All side effects live here so the core stays pure; every lookup
degrades gracefully (no git, no repository, no CI) to nil values
rather than raising.
Summary
Functions
Gathers environment data into a plain map for Temper.RunContext.new/1.
Types
Functions
Gathers environment data into a plain map for Temper.RunContext.new/1.
The map always contains :run_id (fresh 16-byte random hex), :at
(UTC ISO 8601, second precision), :elixir, :otp, :partition
(from MIX_TEST_PARTITION), :ci, :sha, :dirty and :branch.
Git data is resolved with the first source that answers:
- Manual override — a non-empty
TEMPER_SHAswitches git context to manual mode::shafromTEMPER_SHA,:dirtyfromTEMPER_DIRTY("true"/"1"/"yes", defaultfalse),:branchfromTEMPER_BRANCH(defaultnil). For environments where git is out of reach — a test container without the.gitdirectory, a sandboxed build — pass the values in from outside. WithoutTEMPER_SHA, the other twoTEMPER_*variables are ignored. - CI provider variables (e.g.
GITHUB_SHA) — CI checkouts are clean by construction, so no shelling out. - Local git —
git rev-parse/git statusinopts[:cd](default: the current directory);nilvalues outside a repository or without git installed.
The ExUnit :seed is intentionally absent — only the formatter knows
it, and merges it into this map itself.