Commit Graph
72 Commits
Author SHA1 Message Date
Hector Ventura 66cf79ac14 fix(http): tell a missing snapshot API from its status, not from the error text
The error message carries the request path, so a snapshot named nightly404 turned a real server error into 'not available'. FlociException now carries the HTTP status and the snapshot commands ask that.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-10 21:29:34 -05:00
Hector Ventura c3e74e4815 fix(http): keep snapshot names in one path segment and report odd server responses clearly
Snapshot names are URL-encoded and names that would change the path are refused; every trailing slash is stripped from the endpoint; a non-JSON body or a redirect gets a message that says so instead of a parser error; requests use HTTP/1.1. snapshot delete reports a missing snapshot API like save and load, save warns that --message is not sent yet, and export/import no longer cite a server version that does not exist.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-10 21:11:38 -05:00
Hector Ventura 771b353733 fix(doctor): fail -o json on a failed check and name each product in its hints (#52)
* fix(doctor): fail -o json on a failed check and name each product in its hints

doctor -o json now exits 1 when a check fails, as text output does; hints and HTTP errors name the product's own command (floci gcp start, ...) and the port check falls back to the product's default port; a warnings-only run no longer reads as '0 issue(s) found'; an https AWS_ENDPOINT_URL without a port means 443.

* fix(http): name the product's status command when a request times out

Both ways a request can time out now give the same message with the product's own command. The hint tests use their own local endpoints instead of port 9.
2026-10-10 18:45:05 -05:00
Hector Ventura 4cd39a957a feat(start): check the host port before starting and explain a missing Docker socket (#51)
* feat(start): check the host port before starting and explain a missing Docker socket

floci start now stops with 'Port N is already in use' and how to pick another port, instead of failing inside docker run, and when Docker cannot be reached because its local socket is missing it says how to bring Docker up. The port probe is skipped for a remote daemon (DOCKER_HOST=tcp://...).

* feat(start): ask docker which daemon it uses before probing the port

The port probe and the socket hint follow the daemon docker resolved (DOCKER_HOST, else the active context), a number that is no port is not probed, and a missing socket gets a start-the-daemon hint instead of a permissions one. Adds tests for the free port, remote daemon, socket guidance and context paths.

* feat(start): treat a daemon reached over ssh as remote

An ssh:// DOCKER_HOST or context endpoint was read as a local socket path, so a busy local port could block a start on another machine.

* feat(start): resolve the daemon once for the persist directory and the bind source

Start asks docker which daemon it uses once and applies that answer to the persist directory and the bind source too, so a daemon that is remote only through its context is treated like DOCKER_HOST=tcp://.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

* feat(start): let docker decide on a low port the user cannot bind

A failed bind below 1024 can mean the user lacks the right to bind it, while the Docker daemon can publish it. Such a port now counts as taken only when something answers on it.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

* feat(start): keep an address-in-use error as proof a low port is taken

The listener fallback now applies only when the bind failed for another reason, so a low port held on a non-loopback address is still reported as taken.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

---------

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-10 18:28:47 -05:00
Hector Ventura 3ca4108498 fix(start): mount a relative --persist path as a directory and validate --port and --pull (#50)
* fix(start): mount a relative --persist path as a directory and validate --port and --pull

--persist ./data is resolved to an absolute path and created before docker run, so state lands in that directory instead of a Docker named volume; --port outside 1-65535 and an unknown --pull policy are rejected with exit 2 (restart checks them before stopping anything).

start creates the persist directory itself (preparePersistDir). restart now does that before it stops anything, so an unwritable directory fails the restart with the instance still running, instead of after the container was already removed.

* fix(start): leave a remote daemon's persist directory alone and accept pull policies in any locale

The persist directory is created only for a local daemon, an invalid path is reported instead of thrown while building the message, and pull policies are lowercased with Locale.ROOT. The permission test is skipped when permissions do not bind the user.

* fix(start): check the persist path for a remote daemon before restart stops anything

A remote daemon skips only the local directory creation. The path itself is resolved for every daemon, so an unusable one is reported before the stop instead of thrown while building the run arguments afterwards.

* test(restart): let the recorded start answer restart's pre-stop checks

The recording start used by the call-path tests was never parsed, so the new --pull validation rejected it. It now delegates the checks to the start restart really built.

* fix(start): pass a remote daemon's persist path on unchanged

A remote daemon's bind source is no longer resolved by the CLI machine's path rules, which turned /srv/data into a drive path on a Windows CLI. Only a local daemon has relative paths resolved.

* fix(start): refuse a relative --persist path for a remote daemon

A remote daemon cannot resolve a path relative to the CLI's working directory, and docker reads a bare name as a named volume, so the state would land somewhere a later restart does not carry over.

* refactor(start): keep bindSource's javadoc on the method
2026-10-10 17:55:29 -05:00
Hector Ventura f6cec794d7 fix(restart): keep the instance's port, image, data directory and services (#49)
* fix(restart): keep the instance's port, image, data directory and services

Without a profile, restart reads the running container's settings (host port, image, the directory mounted at /app/data, its services and resource namespace) before stopping it and starts it with them, instead of falling back to the defaults and moving the instance to the default port without its state. A profile still decides when one is given, and restart now starts the container when none exists instead of failing.

A container started without --persist has Docker's anonymous volume at /app/data; restart took that volume's internal path for a persist directory and failed to start again. Only a bind mount is a persist directory now.

* fix(restart): stop before the stop when the running container's settings cannot be read

A failed or timed-out inspect is no longer treated as a missing container, which removed the instance and started it on the defaults. Adds tests through call() for the missing-container, existing-container and unreadable-settings paths.
2026-10-10 17:38:28 -05:00
Hector Ventura 52ebdee98d fix(cli): keep wait's spinner out of -o json, reject bad durations and make --verbose work (#48)
* fix(cli): keep wait's spinner out of -o json, reject bad durations and make --verbose work

wait draws its spinner only for text output on a terminal and clears it before the result; --timeout values that are not a positive number with ms, s, m or h exit 2 with a hint instead of a stack trace; --verbose now echoes each docker command to stderr and prints stack traces for errors.

* fix(cli): reject durations that overflow and pin the spinner rule on a terminal

A duration is checked for sign before it is converted and the conversion is overflow-checked, so -9223372036854775807s no longer wraps to a positive timeout. wait takes its terminal check through a seam, with tests for json, yaml and text output on a terminal.
2026-10-10 17:33:15 -05:00
Hector Ventura 7ecc895baa fix(docker): time-limit docker calls and pass names after -- (#47)
* fix(docker): time-limit docker calls and pass names after --

Non-streaming docker calls are killed after 30 s (docker run after 10 minutes, stop after its own timeout plus 30 s) with a message naming the stalled command; any abnormal exit kills the process, streaming calls included; container and image names are passed after -- so a name starting with '-' is never read as a flag.

* fix(docker): time-limit the daemon probe and let stop --timeout -1 wait indefinitely

The doctor's daemon probe and the install probe now share the time limit and cleanup of every other docker call. A negative stop timeout is docker's wait-indefinitely (checked against Docker 29.8.2), so that call is no longer cut off after 29 seconds. Adds tests for the probe, both stop cases and interrupted streaming calls.
2026-10-10 16:28:45 -05:00
Hector Ventura 522e54ef3c fix(config): write profiles and config atomically and report files that cannot be read (#45)
* fix(config): write profiles and config atomically and report files that cannot be read

Profile files and ~/.floci/config.yaml are replaced through a temporary file, so an interrupted write leaves the old file intact; an unknown key in config.yaml no longer resets the default product to aws, and an unreadable config.yaml or profile file is reported on stderr instead of being ignored.

* fix(config): warn when the config file cannot be opened and keep long profile names saving

A config.yaml in a directory the user cannot search is no longer taken for a missing file, the profile list warning quotes the real cause instead of calling every failure bad YAML, and the temporary file name no longer grows with the profile name. Adds tests for failed saves.
2026-10-10 15:54:34 -05:00
Hector Ventura fbdc3ef713 fix(env): show how to load the variables in the chosen shell and reject unknown shells (#46)
The closing hint of floci env (all four products) now uses source for fish and Invoke-Expression for PowerShell instead of always suggesting eval, and an unknown --shell exits 2 with the accepted values instead of silently printing bash syntax. zsh, sh and pwsh are accepted by name.
2026-10-09 22:17:21 -05:00
Hector Ventura 030d468fd3 test: add an opt-in integration suite against the real emulator images (#44)
mvn test -Pintegration drives start, wait, status, env and stop for all four products through the CLI's own command tree, plus two AWS instances side by side, each container uniquely named on a free port and removed afterwards. Tests tagged integration are excluded from the default build. A new Integration workflow runs the suite on main, weekly and on demand.
2026-10-09 22:11:00 -05:00
Hector Ventura a813a23785 ci: run every release binary before publishing and build linux/amd64 natively in CI (#43)
* ci: run every release binary before publishing and build linux/amd64 natively in CI

A shared smoke script runs each binary: version (checked against the tag in release.yml), --help for all four product trees, a profile list and the bad-profile exit code. Every release job runs it before uploading, so a binary that cannot start fails the release instead of shipping. CI gains a linux/amd64 native job next to linux/arm64.

* ci: round-trip a profile in the smoke test and run CI when the script changes
2026-10-09 22:10:27 -05:00
semantic-release-bot 0746e1a61c chore(release): 0.3.0
# [0.3.0](https://github.com/floci-io/floci-cli/compare/0.2.3...0.3.0) (2026-10-09)

### Bug Fixes

* **cli:** honour --no-color on parse errors and show profile defaults in --help ([#35](https://github.com/floci-io/floci-cli/issues/35)) ([fc67e72](https://github.com/floci-io/floci-cli/commit/fc67e72a625df8156cc69fc2068e6923ae36f2f6))
* **profile:** make profile names, files and exit codes consistent ([#33](https://github.com/floci-io/floci-cli/issues/33)) ([5c0cc33](https://github.com/floci-io/floci-cli/commit/5c0cc339bf0be5937ae3fb561b4cb2103d5325fb))
* **update:** save the update-check cache in the native binary ([#41](https://github.com/floci-io/floci-cli/issues/41)) ([a40c7be](https://github.com/floci-io/floci-cli/commit/a40c7be73242f22edd3f6a93544a63c6c147621e))

### Features

* **az:** configure the az CLI against floci-az with floci az setup ([#29](https://github.com/floci-io/floci-cli/issues/29)) ([7b58a38](https://github.com/floci-io/floci-cli/commit/7b58a38c5a5bf4e2e84991c5400ec3abbab90264))
* **config:** create profiles for instances that run side by side ([#30](https://github.com/floci-io/floci-cli/issues/30)) ([788eb47](https://github.com/floci-io/floci-cli/commit/788eb470fb2d51b0d2b6743a060e709d9970c34d))
* **profile:** warn when a profile sets a key floci does not read ([#37](https://github.com/floci-io/floci-cli/issues/37)) ([22668a1](https://github.com/floci-io/floci-cli/commit/22668a1200c4835ac369cb9ebea355b0d4f9feb4))
* **start:** give each instance its own Docker resource namespace and base URL ([#31](https://github.com/floci-io/floci-cli/issues/31)) ([bf9ee40](https://github.com/floci-io/floci-cli/commit/bf9ee4037bb22628ad7f470bca7c551a8f6e65e2))

### Performance Improvements

* **doctor:** run checks concurrently and share docker lookups ([#32](https://github.com/floci-io/floci-cli/issues/32)) ([dd38f6d](https://github.com/floci-io/floci-cli/commit/dd38f6dc27307d7297d5fcc5c1a02897f8bb9f03))
* **native:** build smaller binaries with -Os and enforce a size budget ([#28](https://github.com/floci-io/floci-cli/issues/28)) ([3c4118f](https://github.com/floci-io/floci-cli/commit/3c4118ff1a5521ade1b7e788f45dbaca9069f648))
* restart without a fixed pause and wait no longer than --timeout ([#36](https://github.com/floci-io/floci-cli/issues/36)) ([01d6133](https://github.com/floci-io/floci-cli/commit/01d61335489121757612a5b7062d13f9a593b20b))
0.3.0
2026-10-09 04:42:47 +00:00
Hector Ventura 8feff771ac docs(readme): remove the Scoop install instructions (#42) 2026-10-08 23:39:13 -05:00
Hector Ventura a40c7be732 fix(update): save the update-check cache in the native binary (#41) 2026-10-08 23:39:09 -05:00
Hector Ventura 2dd2e7fa25 docs: adopt the Floci family README layout and a no-dash writing rule (#40) 2026-10-08 23:15:52 -05:00
Hector Ventura 9b340934ae docs(readme): fix the command tables and the profile field table (#39) 2026-10-08 23:12:44 -05:00
Hector Ventura af3d7814b9 test(profile): pin profile precedence, config show output and bad-profile exits (#38) 2026-10-08 23:12:40 -05:00
Hector Ventura 22668a1200 feat(profile): warn when a profile sets a key floci does not read (#37) 2026-10-08 22:47:51 -05:00
Hector Ventura 01d6133548 perf: restart without a fixed pause and wait no longer than --timeout (#36) 2026-10-08 22:41:35 -05:00
Hector Ventura fc67e72a62 fix(cli): honour --no-color on parse errors and show profile defaults in --help (#35) 2026-10-08 22:30:28 -05:00
Hector Ventura bc59dff8c3 refactor(profile): read the parse's profile snapshot in restart and config show (#34) 2026-10-08 22:25:23 -05:00
Hector Ventura 5c0cc339bf fix(profile): make profile names, files and exit codes consistent (#33) 2026-10-08 22:21:02 -05:00
Hector Ventura bf9ee4037b feat(start): give each instance its own Docker resource namespace and base URL (#31) 2026-10-08 21:44:17 -05:00
Hector Ventura 788eb470fb feat(config): create profiles for instances that run side by side (#30) 2026-10-08 21:34:15 -05:00
Hector Ventura 7b58a38c5a feat(az): configure the az CLI against floci-az with floci az setup (#29) 2026-10-08 21:29:02 -05:00
Hector Ventura dd38f6dc27 perf(doctor): run checks concurrently and share docker lookups (#32) 2026-10-08 21:28:58 -05:00
Hector Ventura 3c4118ff1a perf(native): build smaller binaries with -Os and enforce a size budget (#28) 2026-10-08 21:28:53 -05:00
Hector Ventura ac57626481 ci: cap open PRs at 4 with drafts and 2 ready for review (#27)
Describe the new open-PR limits (floci-loft decision 0021) in CONTRIBUTING.md
and the PR template, and grant the caller contents: write, which the shared
workflow needs to convert a PR back to a draft.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-07 17:46:30 -05:00
Hector Ventura 248d7a67f6 ci: limit contributors to 2 open pull requests (#26)
Call the shared floci-io/.github pr-limit workflow on opened, reopened and
ready_for_review, and on closed and converted_to_draft to clear stale
labels. Runs for the same pull request queue rather than cancel, and manual runs use their own concurrency group. Contributors
keep at most 2 open, non-draft pull requests: the 3rd and 4th get the
over-pr-limit label and a reminder, and from 2026-10-08 the 5th and later
are closed automatically. Bots and maintainers are exempt.

CONTRIBUTING.md and the pull request template describe the policy.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-01 17:44:24 -05:00
semantic-release-bot f11ce0597a chore(release): 0.2.3
## [0.2.3](https://github.com/floci-io/floci-cli/compare/0.2.2...0.2.3) (2026-09-15)

### Bug Fixes

* **profile:** keep legacy profile names usable and expand values consistently ([#25](https://github.com/floci-io/floci-cli/issues/25)) ([7343a53](https://github.com/floci-io/floci-cli/commit/7343a539c20a57856a793a498053ebb469f49c1c)), closes [#23](https://github.com/floci-io/floci-cli/issues/23) [#23](https://github.com/floci-io/floci-cli/issues/23)
0.2.3
2026-09-15 04:32:15 +00:00
Hector Ventura 7343a539c2 fix(profile): keep legacy profile names usable and expand values consistently (#25)
* fix(profile): keep legacy profile names usable and expand values consistently

Two edges of the 0.2.2 profile work, both found by an oversight pass over what
landed since 0.2.1.

Profile names that earlier versions accepted became unreachable. The path
traversal guard added in #23 was an allow-list over the whole character set
([A-Za-z0-9._-]+), which also rejects names 0.2.1 created happily: a space, a
plus, an at sign. Such a profile stayed visible in 'config profile list' while
show, --profile and delete all refused it, so it could not even be removed
through the CLI.

The guard is now a deny-list on what actually traverses ('.', '..', and path
separators), and the guarantee is carried by resolving the file and asserting
its parent is the profiles directory. A name that is illegal on the running
platform but legal elsewhere, such as a colon on Windows, now reports a clean
message instead of InvalidPathException.

Profile values were expanded on one path and not the others. Interpolation of
${env:HOME} and friends is picocli's, applied when it fills an option default,
so 'start --profile p' expanded it while 'restart --profile p' and
'config show --profile p' read the Profile bean directly and got the literal
text. Restart therefore asked docker for a directory named '${env:HOME}/...',
which is the silent state loss #23 set out to fix.

Both now resolve through StartCommand.resolvedFor, the same provider and the
same precedence a real start invocation uses, so one profile cannot mean two
different directories. That also removes the duplicated field mapping in
RestartCommand: ProfileDefaults is the only place a profile field maps to a
flag again.

Restart now resolves the profile before stopping the container, so a profile
that fails to resolve no longer leaves the container stopped.

* fix(profile): stop denying backslash, and read the profile once in config show

Two P2s from the review on this PR, both correct.

Backslash is a separator on Windows and an ordinary file-name character on
Unix. Denying it outright orphaned a 'team\alpha' profile that 0.2.1 could
create and that list() still returns, which is the same bug class this PR
exists to fix, left half fixed. The character check is now forward slash only;
resolveInProfilesDir already rejects a real Windows traversal on the parent
assertion, so the guarantee is unchanged.

config show read the profile twice: key presence from one read, values from a
second through resolvedFor. A concurrent edit could print half of one version
next to half of another. ProfileDefaultValueProvider already memoizes the
profile it resolved, so exposing that memo gives both from one snapshot, and
resolvedFor gained a provider overload to pass it through. If the profile has
gone since the outer parse, the command now fails loudly instead of printing a
mixed row.

RestartCommand has the same shape between the outer parse and resolvedFor.
Closing it means making the outer provider reachable from commands, which is
wider than this fix; documented in place rather than left silent.
2026-09-14 21:50:32 -05:00
Hector Ventura 3159a653b4 docs: stop telling contributors to hand-edit CHANGELOG.md (#24)
* docs: stop telling contributors to hand-edit CHANGELOG.md

AGENTS.md and the PR template both asked for an entry under [Unreleased],
which changelog-guard.yml hard-fails and CONTRIBUTING.md forbids. Both lines
predate the semantic-release cutover in #20.

AGENTS.md now states the generated-file rule and points at the changelog-edit
escape hatch; the template drops the checkbox and says on the Conventional
Commits line why no hand edit is needed.

* docs: say which commit types actually produce a changelog entry

The previous wording claimed every Conventional Commit message is the changelog
entry. The commit gate accepts eleven types, but .releaserc.json runs
commit-analyzer with no releaseRules and no preset, so only feat, fix, perf and
breaking changes release. Two commits landed between 0.2.1 and 0.2.2, a fix and
a docs, and only the fix appears in the 0.2.2 section.

Corrected in all four places the claim lived: AGENTS.md, the PR template,
CONTRIBUTING.md, and the changelogTitle in .releaserc.json.

CHANGELOG.md changes with .releaserc.json on purpose and must stay byte
identical to it. @semantic-release/changelog strips the configured title from
the existing file only when the file starts with it, so changing one without
the other would leave the old header in the body and prepend the new one,
shipping a duplicated header on the next release. That is what the
changelog-edit label exists for.

Reported by Greptile on #24 and verified before acting.

* docs(ci): correct the same changelog claim in the guard's own error message

My first pass grepped only *.md and *.json, so it missed the two copies inside
changelog-guard.yml: the header comment and the ::error:: text a contributor
actually sees when the guard fires. A repo-wide grep now returns nothing.
2026-09-13 19:54:49 -05:00
semantic-release-bot eb92df71c6 chore(release): 0.2.2
## [0.2.2](https://github.com/floci-io/floci-cli/compare/0.2.1...0.2.2) (2026-09-13)

### Bug Fixes

* **profile:** apply --profile to every command, not just config show ([#23](https://github.com/floci-io/floci-cli/issues/23)) ([52c08ec](https://github.com/floci-io/floci-cli/commit/52c08ecec56e163a034d21e5cf6cefcdef6c39cd)), closes [#22](https://github.com/floci-io/floci-cli/issues/22)
0.2.2
2026-09-13 23:39:51 +00:00
Hector Ventura 52c08ecec5 fix(profile): apply --profile to every command, not just config show (#23)
`--profile <name>` was declared on the shared GlobalOptions mixin but only
ConfigShowCommand ever read it. Every other command, `start` included, fell
through to the built-in defaults, so a profile's container, image, port,
persistDir and services were silently dropped.

The worst consequence was silent data loss: the `-v <dir>:/app/data` mount and
`FLOCI_STORAGE_MODE=persistent` were gated on the `--persist` flag alone, so a
profile with `persistDir` set produced neither. The image declares
`VOLUME /app/data`, so every start attached a fresh anonymous volume and the
server stayed in-memory.

A profile is now applied by a single picocli IDefaultValueProvider registered in
FlociCli.buildCommandLine(). Picocli consults it only for options the user did
not pass, and only after that command's arguments are processed, which gives the
documented precedence without per-command plumbing:

    command-line flag > --profile <name> > FLOCI_* env var > product default

Behaviour changes:

- An unknown, unreadable or invalid profile is now an error (exit 2) rather than
  a silent fall back to the defaults. `--help` still works with a bad profile.
- `restart --profile <name>` re-applies the profile's persistDir, image, port
  and services. It builds its StartCommand programmatically, so it carries the
  profile across by hand.
- `config show` merges instead of replacing, so an explicit --endpoint /
  --container / -o is no longer discarded when --profile resolves. It now also
  reports the profile's start-only fields.
- `config profile create` seeds the file from the tree it was run under;
  previously every tree wrote AWS values.
- Profile names are validated, closing a path traversal
  (`config profile delete ../../foo` resolved the raw name).
- Reads accept the `.yml` spelling that `config profile list` has always
  listed, and `list` backfills a missing `name:` from the file name.
- The readiness poll after `start` keeps the endpoint's host when swapping in
  the bound port, instead of always rewriting it to localhost.

Adds 64 tests, including the first coverage of ProfileStore.

Closes #22
2026-09-13 18:23:56 -05:00
Hector Ventura 588edc235a docs: say when releases are cut, and that there is no fixed cadence (#21)
CONTRIBUTING described how a release is cut but never when. The emulators ship
on a 1st and 3rd Tuesday train; floci-cli does not, and its history says so.
Stating that is more useful than leaving the question open, and it avoids
implying a schedule nothing enforces.

Em-dashes replaced with ordinary punctuation, matching the convention the
emulators adopted.
2026-08-31 22:36:23 -05:00
semantic-release-bot c437bf0bb3 chore(release): 0.2.1
## [0.2.1](https://github.com/floci-io/floci-cli/compare/0.2.0...0.2.1) (2026-08-27)

### Bug Fixes

* **env:** single-quote exported values in every product tree ([#19](https://github.com/floci-io/floci-cli/issues/19)) ([6496795](https://github.com/floci-io/floci-cli/commit/6496795708fe7a12141e3640a0e74435892a8c57)), closes [#18](https://github.com/floci-io/floci-cli/issues/18)
0.2.1
2026-08-27 03:42:57 +00:00
Hector Ventura 7cef52bc50 ci(release): add one-button release cut from main (#20)
Releases were tag-driven: a maintainer hand-bumped pom.xml, hand-moved the
CHANGELOG [Unreleased] entries under a new heading, committed, then pushed a
SemVer tag. Three manual steps, each able to disagree with the others.

Add a manually-dispatched Release Cut workflow that runs semantic-release
against main: it analyzes the Conventional Commits since the last tag, bumps
pom.xml via `mvn versions:set`, regenerates CHANGELOG.md, commits both, tags
(tagFormat ${version}), and creates the GitHub Release. The tag push then
fires release.yml exactly as a manual tag push did, so the binary build and
homebrew-bump chain is untouched. A dry-run input previews the next version
and notes without releasing.

The cut needs a fine-grained PAT (GH_TOKEN, contents:write) rather than the
default GITHUB_TOKEN, whose tag pushes do not trigger other workflows — with
it, release.yml would never run. The semantic-release toolchain is pinned by
its own package-lock.json and installed with `npm ci --ignore-scripts`, so
the job holding that PAT never resolves mutable versions.

CHANGELOG.md becomes generated output. The hand-maintained [Unreleased]
section and its compare link are removed, the header explains the new
contract, and historic sections stay as they were. Changelog Guard fails any
PR that edits the file by hand unless a maintainer applies the
`changelog-edit` label.

Since commit messages are now the changelog, add a Conventional Commits
workflow that lints every non-merge commit in a PR against the types
semantic-release recognizes.

Also drop the hand-written installation body from release.yml — the release
now carries just the attachments, and semantic-release writes the notes.
2026-08-26 22:41:01 -05:00
Hector Ventura 6496795708 fix(env): single-quote exported values in every product tree (#19)
`floci az env` printed the semicolon-separated Azure connection string
unquoted, so `eval $(floci az env)` set only
AZURE_STORAGE_CONNECTION_STRING=DefaultEndpointsProtocol=http and ran the
remaining segments as commands — `az` then reported "Invalid connection
string".

`floci env` and `floci gcp env` carried a byte-identical copy of the same
unquoted emitter (their values are `;`-free URLs today, so nobody hit it),
and the aws.cli.endpoint / az.cli.connection-string doctor checks suggested
export lines with the same flaw.

Extract the correct emitter that `floci oci env` already had into
io.floci.cli.output.ShellExport and use it everywhere: values are single
quoted with per-shell escaping for bash, fish, and PowerShell, so `;`, `$`,
backticks, and quotes can neither break nor inject through `eval`.

OciEnvFormatTest becomes ShellExportTest, keeping its four assertions and
adding the connection-string regression from the issue.

Closes #18
2026-08-26 22:12:29 -05:00
Hector Ventura fee32a76a1 docs: add MAINTAINERS.md (#17)
The org-wide GOVERNANCE.md states that maintainers are listed in each
repository's MAINTAINERS.md, but no repository had one. Add it here, following
the org-level template so the family does not drift into per-repo dialects.
2026-08-15 11:09:56 -05:00
Hector Ventura 980904e55a chore: release 0.2.0 0.2.0 2026-07-28 21:50:27 -05:00
Hector Ventura 6dc8fc9df4 refactor!: unify the four product command trees behind ProductProfile (#16)
* refactor!: unify the four product command trees behind ProductProfile

Every shared command now has ONE implementation in commands/,
parameterized by ProductProfile (the single source of per-product
config: endpoint, container, image, env prefix, control prefix,
display name). The gcp/az/oci command classes become ~8-line shims
(GcpStartCommand extends StartCommand { super(ProductProfile.GCP); })
that carry only their per-product help description; the three
near-identical *GlobalOptions clones are deleted. Each product tree
drops from ~1,360 to ~530 lines and copy-drift becomes impossible.

Mechanics: per-product option defaults are constructor-set field
values rendered in help via ${DEFAULT-VALUE} (annotation defaults are
compile-time constants); commands pre-initialize their GlobalOptions
mixin with the profile (picocli uses a non-null mixin field instance
as-is). Verified against a captured baseline of 480 CLI outputs
(every --help x 5 trees, env/status/doctor JSON, exit codes, routing)
plus new pinning tests: ProductProfileTest, ProductTreesParsingTest,
DoctorCheckListTest, GlobalOptionsTest.

Behavior changes, all deliberate:
- snapshot commands in gcp/az/oci trees now perform the real
  /snapshots API calls with graceful degradation and exit 1 while the
  server lacks the endpoints (previously: note + exit 0)
- product logs/services gained --service/--mode, and services now
  resolves the endpoint from the container port mapping in all trees
- the AWS tree brands itself 'Floci AWS' in banners and help,
  matching the other products
- snapshot errors link the product issue tracker instead of TODO.md
- completion generates from spec.root() instead of a hardcoded
  FlociCli instance (output unchanged)

BREAKING CHANGE: 'floci gcp|az|oci snapshot export/import' (and bare
'floci snapshot ...' with a non-AWS default product) now exit 1
instead of 0 while server-side snapshot support is pending; CI
scripts relying on the silent success of stubbed snapshot commands
will fail.

* fix: snapshot save/load/list/delete resolve the container host port

Same port auto-detection status/services/wait use — a container started
with --port <n> is now reachable by the snapshot commands without an
explicit --endpoint. Applies to all four trees via the unified base
commands.
2026-07-28 21:45:52 -05:00
Hector Ventura 0a65de2303 feat(oci): add floci oci command group for the Floci OCI emulator (#15)
* feat(oci): add floci oci command group for the Floci OCI emulator

Adds the fourth product tree targeting floci-oci (port 4599, container
floci-oci, control prefix /_floci-oci, FLOCI_OCI_* env overrides):
start/stop/restart/status/logs/wait/version/services/doctor/env/config
plus stub snapshot commands, mirroring the GCP/Azure trees.

- 'floci oci env' exports OCI_CLI_ENDPOINT, FLOCI_OCI_ENDPOINT, and
  TF_VAR_CLIENT_HOST_OVERRIDES for the OCI CLI, the ocilocal wrapper,
  and the oracle/oci Terraform provider; also OCI_CLI_PROFILE=FLOCI
  when that profile exists.
- 'floci oci setup' generates an RSA-2048 API signing key with a real
  computed fingerprint and writes a throwaway [FLOCI] profile to
  ~/.oci/config (idempotent, never touches existing profiles) — the
  OCI CLI/SDKs refuse to run without them.
- FlociHttpClient now accepts both health 'services' shapes: the array
  reported by AWS/GCP/Azure servers and the {name: status} object
  reported by floci-oci.
- 'floci config default-product oci' routes bare commands to the tree.

* fix(oci): address review findings on env, services, and setup profile

- Single-quote 'oci env' exports with per-shell escaping (bash/fish/
  PowerShell) so endpoint values containing shell metacharacters cannot
  inject commands through the documented 'eval $(floci oci env)' flow.
- 'oci services' resolves the endpoint from the container port mapping
  like status/wait/env, so a container started with --port <n> is found
  without passing --endpoint.
- 'oci env' exports OCI_CLI_PROFILE for whichever profile 'oci setup'
  wrote (detected via its key_file marker) instead of only the
  hardcoded FLOCI name; DEFAULT is skipped as the CLI uses it
  implicitly.
2026-07-28 21:15:42 -05:00
Hector Ventura 2ff3181198 chore: release 0.1.9 0.1.9 2026-07-24 11:57:39 -04:00
Juan Diego López 2498ea05b2 Feature/notifier-update (#13)
* fix: align ContainerInfo fields with inspect format template

* feat(update): add self-update command with checksum verification

* fix(update): harden self-update checksum, cleanup, and exit code

* feat(update): notify when a new release is available

* fix(update): validate release tag, avoid pre-release downgrades, clarify empty-body error

* feat(update): notify when a new release is available

* fix(cli): exempt update from default-product routing
2026-07-11 12:29:15 -05:00
Hector Ventura a2f97ae820 docs: add AGENTS.md, CONTRIBUTING.md, PR template; document GCP and self-update (#14)
* docs: add AGENTS.md, CONTRIBUTING.md, PR template; document GCP and self-update

- AGENTS.md (tracked): canonical agent guidance — architecture incl. the
  three product trees table, doctor check structure per tree, native-image
  constraints, code style rules, updated scope rules (self-update now in
  scope, must never auto-run)
- CONTRIBUTING.md: build/test setup, Conventional Commits, hand-maintained
  Keep-a-Changelog policy, PR guidelines, tag-driven release process
- .github/pull_request_template.md: adapted from the server repo with a
  'product trees affected' checklist
- README: document the floci gcp command group (quick start, command
  reference, global flags, gcp env variables, CI usage), floci update,
  Java 25+ fat-JAR requirement; drop the unwired snapshot --message flag
  from examples
- CHANGELOG: backfill [Unreleased] with #12 (self-update) and #11
  (ContainerInfo field alignment); document these docs changes
- release.yml: release notes said the fat JAR needs Java 21+, but it is
  built with --release 25 — corrected to Java 25+

* docs(changelog): use standard Keep a Changelog headings for Unreleased

The Documentation section is not one of the six types defined by Keep a
Changelog 1.1.0. New docs (AGENTS.md, CONTRIBUTING.md, README GCP section)
move under Added; the incorrect Java 21+ runtime claim moves under Fixed.
2026-07-06 20:15:32 -05:00
Juan Diego López 235be41f2a feat(update): add self-update command with checksum verification (#12)
* fix: align ContainerInfo fields with inspect format template

* feat(update): add self-update command with checksum verification

* fix(update): harden self-update checksum, cleanup, and exit code
2026-07-04 21:44:41 -05:00
Juan Diego López 0300251a0a fix: align ContainerInfo fields with inspect format template (#11) 2026-06-29 21:38:26 -05:00
Hector Ventura 96e28c1b11 chore: release 0.1.8 0.1.8 2026-06-21 09:53:22 -05:00
Hector Ventura 6af6ee096a fix(start): enable persistent storage mode when --persist is set (#9)
The server defaults to FLOCI_STORAGE_MODE=memory, so the --persist
bind mount to /app/data was a no-op: state was never written to disk
and did not survive a container restart.

Set FLOCI_STORAGE_MODE=persistent (per-cloud prefixed variant for GCP
and Azure) whenever --persist is provided, so emulator state is written
to the mounted host directory and survives restarts. Verified
end-to-end with S3 and DynamoDB across a stop --remove + start cycle.
2026-06-21 09:50:48 -05:00