fix(ci): green CI — clippy + jsonwebtoken dev-dep + build-linux tag-only #19

Closed
mik-tf wants to merge 2 commits from development_mik_1 into development
Owner

Third repo in the home#188 CI sweep.

Three classes of root-cause fix per the engineering discipline, in one PR because they all gate the same goal (green CI on hero_embedder/development).

1. Missing jsonwebtoken dev-dependency

tests/auth_integration_test.rs imports jsonwebtoken but the crate was never declared as a dev-dep on hero_embedder_lib. cargo build --tests failed E0432/E0433; cargo clippy --all-targets followed.

Fix: added jsonwebtoken = "9" to [dev-dependencies] with a comment explaining why.

2. 17 clippy -D warnings errors

Auto-fixed by cargo clippy --fix:

  • 16 collapsible-if
  • 2 unnecessary mut
  • 2 clone_on_copy on Option<Callback>
  • 2 manual arithmetic check
  • 1 unused variable
  • 1 needless_borrow

Three manual fixes (each with a comment):

  • hero_embedder_proxy/src/main.rs — dead match with both arms {}; collapsed to let _ = ... preserving the side-effect call
  • hero_embedder_lib/src/proc_client.rs..Default::default() on JobCreateInput was redundant for the currently-resolved hero_proc_sdk pin. Removed; when the SDK pin is bumped to include inputs, the missing-field compile error will surface and be fixed explicitly per the discipline.
  • hero_embedder_app/src/components/kvs_tab.rsLeaf(String) field unused at render (matched as Leaf(_)). Kept with #[allow(dead_code)] + comment because it's preserved for a future click handler.

3. build-linux.yaml triggers on every dev push

Same issue as hero_proxy #27: build-linux.yaml fired on every push to main and development in addition to tags. Its publish_binaries step tries to upload to a Forgejo release tagged with the pushed ref — for non-tag pushes that release doesn't exist, so every dev push went red.

Restricted trigger to v* tags + workflow_dispatch only. Matches the canonical release.yaml pattern. Header comment documents the deviation from full canonical (ONNX / esaxx-rs C++ deps will need follow-up for static-pie musl when the home#187 release-artifacts P0 lands).

Local verification

make check  ✓
make test   ✓
make lint   ✓  (cargo clippy --workspace --all-targets -- -D warnings)

Out of scope (per home#188 — separate follow-up PRs)

  • Canonicalise build-linux.yamlrelease.yaml shape (full home#187 release-artifacts pattern, with documented ONNX/esaxx deviations)
  • Pre-existing fmt drift in hero_embedder_lib/src/api/* (current workflow doesn't enforce fmt-check; not blocking CI green)

Discipline confirmation

  • Audited ALL workflows (test.yaml + build-linux.yaml) before declaring scope — caught the build-linux trigger problem upfront, not post-merge
  • Real fixes for clippy warnings (17 of 17), not loosening -D warnings
  • Per-fix comment for every non-mechanical change
  • Did NOT silently #[allow(...)] away clippy warnings
  • Did NOT delete the failing build-linux.yaml workflow — kept it as the future release pipeline

Tracker: home#188

Signed-off-by: mik-tf

Third repo in the [home#188](https://forge.ourworld.tf/lhumina_code/home/issues/188) CI sweep. Three classes of root-cause fix per the engineering discipline, in one PR because they all gate the same goal (green CI on `hero_embedder/development`). ## 1. Missing `jsonwebtoken` dev-dependency `tests/auth_integration_test.rs` imports `jsonwebtoken` but the crate was never declared as a dev-dep on `hero_embedder_lib`. `cargo build --tests` failed E0432/E0433; `cargo clippy --all-targets` followed. Fix: added `jsonwebtoken = "9"` to `[dev-dependencies]` with a comment explaining why. ## 2. 17 clippy `-D warnings` errors Auto-fixed by `cargo clippy --fix`: - 16 collapsible-if - 2 unnecessary `mut` - 2 `clone_on_copy` on `Option<Callback>` - 2 manual arithmetic check - 1 unused variable - 1 needless_borrow Three manual fixes (each with a comment): - `hero_embedder_proxy/src/main.rs` — dead `match` with both arms `{}`; collapsed to `let _ = ...` preserving the side-effect call - `hero_embedder_lib/src/proc_client.rs` — `..Default::default()` on `JobCreateInput` was redundant for the currently-resolved hero_proc_sdk pin. Removed; when the SDK pin is bumped to include `inputs`, the missing-field compile error will surface and be fixed explicitly per the discipline. - `hero_embedder_app/src/components/kvs_tab.rs` — `Leaf(String)` field unused at render (matched as `Leaf(_)`). Kept with `#[allow(dead_code)]` + comment because it's preserved for a future click handler. ## 3. `build-linux.yaml` triggers on every dev push Same issue as [hero_proxy #27](https://forge.ourworld.tf/lhumina_code/hero_proxy/pulls/27): `build-linux.yaml` fired on every push to `main` and `development` in addition to tags. Its `publish_binaries` step tries to upload to a Forgejo release tagged with the pushed ref — for non-tag pushes that release doesn't exist, so every dev push went red. Restricted trigger to `v*` tags + `workflow_dispatch` only. Matches the canonical release.yaml pattern. Header comment documents the deviation from full canonical (ONNX / esaxx-rs C++ deps will need follow-up for static-pie musl when the [home#187](https://forge.ourworld.tf/lhumina_code/home/issues/187) release-artifacts P0 lands). ## Local verification ``` make check ✓ make test ✓ make lint ✓ (cargo clippy --workspace --all-targets -- -D warnings) ``` ## Out of scope (per home#188 — separate follow-up PRs) - Canonicalise `build-linux.yaml` → `release.yaml` shape (full home#187 release-artifacts pattern, with documented ONNX/esaxx deviations) - Pre-existing fmt drift in `hero_embedder_lib/src/api/*` (current workflow doesn't enforce `fmt-check`; not blocking CI green) ## Discipline confirmation - ✅ Audited ALL workflows (`test.yaml` + `build-linux.yaml`) before declaring scope — caught the build-linux trigger problem upfront, not post-merge - ✅ Real fixes for clippy warnings (17 of 17), not loosening `-D warnings` - ✅ Per-fix comment for every non-mechanical change - ❌ Did NOT silently `#[allow(...)]` away clippy warnings - ❌ Did NOT delete the failing `build-linux.yaml` workflow — kept it as the future release pipeline Tracker: [home#188](https://forge.ourworld.tf/lhumina_code/home/issues/188) Signed-off-by: mik-tf
Three classes of root-cause fix per home#188 engineering discipline,
in one PR because they all gate the same goal (green CI on
hero_embedder/development).

## 1. Add missing jsonwebtoken dev-dependency

`tests/auth_integration_test.rs` imports `jsonwebtoken` but the crate
was never declared as a dev-dependency on `hero_embedder_lib`.
`cargo build --tests` failed with E0432/E0433 unresolved-import errors;
clippy --all-targets followed.

Fix: added `jsonwebtoken = "9"` to `[dev-dependencies]` with a comment
explaining why.

## 2. Resolve 17 clippy --all-targets warnings (was -D warnings)

Mostly auto-fixable by `cargo clippy --fix`:
- 16 collapsible-if (collapsed)
- 2 unnecessary mut variables (removed mut)
- 2 clone_on_copy on Option<Callback> (removed clone)
- 2 manual arithmetic check (replaced with checked_*)
- 1 unused variable (removed)
- 1 needless_borrow (removed)

Three required manual fixes:
- `hero_embedder_proxy/src/main.rs` — dead `match` with both arms `{}`;
  collapsed to `let _ = ...` preserving side effect
- `hero_embedder_lib/src/proc_client.rs` — `..Default::default()` on
  JobCreateInput was redundant for the currently-resolved hero_proc_sdk
  pin (which doesn't yet have the `inputs` field).  Removed; when the
  SDK pin is bumped to include `inputs`, the missing-field compile
  error will surface and be fixed explicitly per the discipline.
- `hero_embedder_app/src/components/kvs_tab.rs` — `Leaf(String)` field
  is unused at the render site (matched as `Leaf(_)`); kept the field
  with `#[allow(dead_code)]` + comment because it's preserved for a
  future click handler (line ~155 just doesn't read it yet).

## 3. Fix build-linux.yaml trigger — tag-only

`build-linux.yaml` was firing on every push to `main` and `development`
in addition to tags.  Its `publish_binaries` step at the end tries to
upload to a Forgejo release tagged with the pushed ref — for non-tag
pushes that release doesn't exist, so every dev push went red.

Restricted trigger to `v*` tags + `workflow_dispatch` only, matching
the canonical release.yaml pattern.  Same approach as
hero_proxy #27.  Header comment notes the deviation from canonical
(ONNX / esaxx-rs C++ deps will need follow-up for static-pie musl
once the home#187 release-artifacts P0 lands).

## Local verification

```
make check  ✓
make test   ✓
make lint   ✓ (cargo clippy --workspace --all-targets -- -D warnings)
```

## Out of scope (per home#188 — separate follow-up PRs)

- Canonicalise build-linux.yaml → release.yaml shape (full home#187
  release-artifacts pattern, with documented ONNX/esaxx deviations).
- pre-existing fmt drift in hero_embedder_lib/src/api/* (current
  workflow doesn't enforce fmt-check; not blocking).

Third repo in the home#188 CI sweep.

Tracker: lhumina_code/home#188

Signed-off-by: mik-tf
Author
Owner

Pushed 4acc4dd — fixes the CI failure on run #344. Root cause:

  • I had removed ..Default::default() from JobCreateInput reasoning the locally-resolved hero_proc_sdk pin (8e7e9850) had no inputs field, so the spread was redundant.
  • CI gitignores Cargo.lock, so it resolves fresh to the latest branch=development of hero_proc_sdk on every run.
  • Today’s hero_proc PR #49 (9b134018) ADDED the inputs field.
  • CI saw the new field, my removal made the struct-literal incomplete → E0063 missing-field error.

Fix: set inputs: None explicitly. Works on both pre- and post-#49 SDK pins. Comment in the source documents the cross-repo dependency for future readers.

Verified locally after cargo update -p hero_proc_sdk (now resolves to #9b134018, same as CI):

cargo check --workspace --all-targets  ✓
cargo clippy --workspace --all-targets -- -D warnings  ✓

Lesson: locally-resolved cargo state can diverge from CI when Cargo.lock isn’t committed. Will file a separate issue for committing Cargo.lock to hero_embedder for reproducibility (out of scope for this PR).

Pushed `4acc4dd` — fixes the CI failure on run #344. Root cause: - I had removed `..Default::default()` from `JobCreateInput` reasoning the locally-resolved hero_proc_sdk pin (`8e7e9850`) had no `inputs` field, so the spread was redundant. - CI gitignores `Cargo.lock`, so it resolves fresh to the latest `branch=development` of hero_proc_sdk on every run. - Today’s [hero_proc PR #49](https://forge.ourworld.tf/lhumina_code/hero_proc/pulls/49) (`9b134018`) ADDED the `inputs` field. - CI saw the new field, my removal made the struct-literal incomplete → E0063 missing-field error. Fix: set `inputs: None` explicitly. Works on both pre- and post-#49 SDK pins. Comment in the source documents the cross-repo dependency for future readers. Verified locally after `cargo update -p hero_proc_sdk` (now resolves to `#9b134018`, same as CI): ``` cargo check --workspace --all-targets ✓ cargo clippy --workspace --all-targets -- -D warnings ✓ ``` Lesson: locally-resolved cargo state can diverge from CI when `Cargo.lock` isn’t committed. Will file a separate issue for committing `Cargo.lock` to hero_embedder for reproducibility (out of scope for this PR).
fix(proc_client): explicit inputs: None — CI resolves new hero_proc_sdk pin
All checks were successful
Test / test (pull_request) Successful in 3m26s
4acc4dd1d5
CI run #344 (https://forge.ourworld.tf/lhumina_code/hero_embedder/actions/runs/344)
caught the bug my local repro missed.

I had REMOVED `..Default::default()` from JobCreateInput in the previous
commit, reasoning that the locally-resolved hero_proc_sdk pin
(8e7e9850) didn't have the `inputs` field yet so the spread was
clippy-flagged as redundant.

CI gitignores Cargo.lock so it always resolves the latest commit on
`branch=development`.  Today's hero_proc PR #49 (commit 9b134018)
ADDED the `inputs` field.  CI's fresh resolution → SDK has `inputs` →
my removal of the spread → E0063 missing-field error → red.

Set `inputs: None` explicitly so the code compiles on both pre- and
post-#49 SDK pins.  Comment documents the cross-repo dependency for
future readers.

Verified locally after `cargo update -p hero_proc_sdk` (now resolves
to #9b134018, same as CI):
  cargo check --workspace --all-targets  ✓
  cargo clippy --workspace --all-targets -- -D warnings  ✓

Discipline note: the env-dependent surprise was the exact case home#188
talks about — local resolution diverged from CI resolution because
Cargo.lock isn't committed.  Worth filing a follow-up to commit
Cargo.lock here for reproducibility (separate concern from CI green).
mik-tf closed this pull request 2026-04-26 00:28:34 +00:00
Author
Owner

Squash-merged to development as 6a305a8. Branch deleted. Post-merge push CI awaiting verification.

Squash-merged to `development` as [`6a305a8`](https://forge.ourworld.tf/lhumina_code/hero_embedder/commit/6a305a8). Branch deleted. Post-merge push CI awaiting verification.
All checks were successful
Test / test (pull_request) Successful in 3m26s

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_embedder!19
No description provided.