Skip to content

dotbot: README swarm-first rework + fetch defaults to latest#270

Merged
geonnave merged 27 commits into
DotBots:developfrom
geonnave:fw-fetch-latest-multisource
Jun 4, 2026
Merged

dotbot: README swarm-first rework + fetch defaults to latest#270
geonnave merged 27 commits into
DotBots:developfrom
geonnave:fw-fetch-latest-multisource

Conversation

@geonnave

@geonnave geonnave commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Two onboarding improvements for the conference, on one branch (kept together by request).

README / docs: lead with the swarm path

The README now flows ## Usage -> ## Quickstart - a swarm -> ## Going further. The one-bot walkthrough moved into a new doc/guides/one-bot.md; the LH2 quickstart already lived in the LH2 guide, so it's just removed from the README. ## Going further links both guides and now includes the config command (previously dropped from the "four namespaces" line). The device and config-reference docs also gained the per-machine vs per-project segger_dir/firmware_repo split.

fw fetch / flash: default to the latest release

Bare dotbot fw fetch (and flash-mari-gateway / flash-swarmit-sandbox with no -f) resolve the latest swarmit release via the GitHub /releases API - prereleases included, since the current newest is an rc - print the resolved tag, and cache under it. -f <tag> still pins; -f local is unchanged. The resolution happens in the CLI layer (before flash_role) so the concrete tag, not the literal "latest", drives the cache dir.

Fetch output is now package-manager style: a "no version specified, fetching latest: " line, clean per-file names + sizes, a one-line optional-skip summary, and relative paths - instead of the raw [GET]/[OK]/404 noise.

Validation

Host-side: the resolver (live + mocked unit tests) and an end-to-end fetch, 79 tests green with no network calls in the suite, docs build clean under -W. The role commands' on-bench flashing is unchanged logic (only the version now defaults to latest) - worth a quick bench confirm.

A follow-up will add a second fetch source (DotBot-firmware bare apps for a no-SES one-bot path) once that repo's release CI publishes them.

@codecov

codecov Bot commented Jun 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 78.42105% with 41 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.27%. Comparing base (6c8db27) to head (f93abc8).
⚠️ Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
dotbot/cli/_artifacts.py 25.92% 20 Missing ⚠️
dotbot/examples/circle/circle.py 30.43% 16 Missing ⚠️
dotbot/cli/fw.py 86.36% 3 Missing ⚠️
dotbot/cli/device.py 75.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #270      +/-   ##
===========================================
- Coverage    83.35%   83.27%   -0.08%     
===========================================
  Files          118      119       +1     
  Lines        10963    11120     +157     
  Branches       570      571       +1     
===========================================
+ Hits          9138     9260     +122     
- Misses        1822     1857      +35     
  Partials         3        3              
Files with missing lines Coverage Δ
dotbot/cli/demo.py 100.00% <100.00%> (ø)
dotbot/cli/main.py 100.00% <100.00%> (ø)
dotbot/config.py 98.02% <ø> (-0.02%) ⬇️
dotbot/tests/test_cli_helpers.py 100.00% <ø> (ø)
dotbot/tests/test_device.py 100.00% <100.00%> (ø)
dotbot/cli/device.py 83.51% <75.00%> (-0.83%) ⬇️
dotbot/cli/fw.py 90.60% <86.36%> (+1.79%) ⬆️
dotbot/examples/circle/circle.py 30.43% <30.43%> (ø)
dotbot/cli/_artifacts.py 33.33% <25.92%> (-6.07%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@geonnave geonnave force-pushed the fw-fetch-latest-multisource branch from efded24 to effa503 Compare June 3, 2026 07:43
@geonnave

geonnave commented Jun 3, 2026

Copy link
Copy Markdown
Contributor Author

This is probably ready, but needs more testing with real hardware.

geonnave added 25 commits June 4, 2026 12:17
The one-bot and LH2 quickstarts move into guides (doc/guides/one-bot.md
and the existing LH2 guide), not removed - Going further links both, so
the README leads straight into the swarm path.

AI-assisted: Claude Opus 4.8
latest resolves via the GitHub /releases API (not /releases/latest,
which skips prereleases like 0.8.0rcN). Resolution happens in the CLI
layer before flash_role, so the concrete tag - not the literal
"latest" - reaches resolve_fw_root and both the explicit fetch and the
auto-fetch hook land in the same ./artifacts/<tag>/ dir.

AI-assisted: Claude Opus 4.8
AI-assisted: Claude Opus 4.8
Drives the first bot in a circle over plain HTTP. Adds `requests` as a
dep: the demo (and the docs scripting example) talk to the controller
with no async and no internal client, so it doubles as a copy-paste
template; the internal httpx-based client stays for the richer examples.

AI-assisted: Claude Opus 4.8
AI-assisted: Claude Opus 4.8
The scripting example moved into the simulator guide (not removed); the
page now leads with install, then the no-hardware simulator, then the
"Deploy a real swarm" path.

AI-assisted: Claude Opus 4.8
The cache moves to user-level ~/.dotbot/artifacts/ (shared across dirs;
override DOTBOT_ARTIFACTS_DIR), as <source>-<version>/ dirs + a manifest, so
swarmit and DotBot-firmware (independent version schemes) never collide.
`fw fetch` pulls from both sources, downloading every .hex/.bin a release
lists via the GitHub API (fixing the silent .bin 404s). `device flash <app>`
searches the cache, preferring a local build over the newest release.

AI-assisted: Claude Opus 4.8
`dotbot fw fetch` with no args now resolves the pinned versions (swarmit from the installed package, dotbot-firmware from a declared constant) instead of the latest release; pass `-f latest` for the old behavior.

AI-assisted: Claude Opus 4.8
Aligns the no-`-f` default with `dotbot fw fetch` so both stage the same `swarmit-<version>/` cache dir; pass `-f latest` for the old behavior.

AI-assisted: Claude Opus 4.8
The key was never read - $DOTBOT_ARTIFACTS_DIR is the cache-location override. A config that still sets it now fails (extra keys are forbidden).

AI-assisted: Claude Opus 4.8
Pure move: flash.py keeps the device-flashing engine and imports fetch_assets/resolve_fw_root back from fetch.py for flash_role's auto-fetch (one-way dep, no cycle). No behavior change.

AI-assisted: Claude Opus 4.8
@geonnave geonnave force-pushed the fw-fetch-latest-multisource branch from 32c6e85 to b6e1fc0 Compare June 4, 2026 10:49
@geonnave geonnave force-pushed the fw-fetch-latest-multisource branch from b6e1fc0 to f93abc8 Compare June 4, 2026 11:50
@geonnave

geonnave commented Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

The README was validated by @RasdaCorentin, with improvements noted at #272. Nothing prevents merging this now, and improvements can land later.

@geonnave geonnave merged commit 25bd167 into DotBots:develop Jun 4, 2026
14 checks passed
@geonnave geonnave deleted the fw-fetch-latest-multisource branch June 4, 2026 16:44
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