Skip to content

refactor(preingestion): let firmware upload results move their counter - #3743

Merged
chet merged 1 commit into
NVIDIA:mainfrom
chet:gh-issue-3734
Jul 20, 2026
Merged

refactor(preingestion): let firmware upload results move their counter#3743
chet merged 1 commit into
NVIDIA:mainfrom
chet:gh-issue-3734

Conversation

@chet

@chet chet commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

I was walking the preingestion firmware upload fallback and noticed every terminal result already had both halves of an Event: a {method,outcome} counter observation, and a nearby record explaining the failure. Multipart being unsupported is the fun edge -- it is a real multipart outcome and then an HttpPush attempt, so flattening the flow would lose useful history.

So, this gives the upload outcomes typed Events that own both signals. FirmwareUploadFinished dynamically keeps each historical failure level and message, while successful uploads stay metric-only. The unsupported multipart path gets a sibling Event so its fallback-specific WARN keeps the exact schema operators already know.

carbide_preingestion_firmware_upload_total, its description, and every method/outcome label stay put. BMC addresses and error details stay in log-only context. Most importantly, multipart fallback still records two honest observations -- the unsupported multipart result, followed by the HttpPush result -- because that is what actually happened.

And yep, the fallback sequence has a test! I ran:

  • cargo test -p carbide-preingestion-manager
  • cargo make format-nightly
  • cargo make clippy
  • cargo make carbide-lints
  • cargo make check-event-names
  • cargo xtask check-metric-docs

The local CodeRabbit and independent Claude passes were clean, too.

This supports #3734

Closes #3734

Let firmware upload Events own the existing Redfish failure records along with the frozen method and outcome counter.

Successful routes stay metric-only, failures retain their historical level, message, and context, and the unsupported-multipart sibling preserves the error-then-HttpPush fallback sequence. Paired tests lock every route and outcome.

This supports NVIDIA#3734

Signed-off-by: Chet Nichols III <chetn@nvidia.com>
@chet
chet requested a review from a team as a code owner July 20, 2026 22:17
@chet

chet commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full_review, thanks!

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Preingestion firmware upload metrics now include BMC addresses and failure details, emit route-specific logs dynamically, distinguish unsupported multipart uploads, and validate counters and historical log output across upload methods.

Changes

Firmware upload observability

Layer / File(s) Summary
Dynamic firmware upload instrumentation
crates/preingestion-manager/src/metrics.rs
FirmwareUploadFinished carries BMC and error context with dynamic success/failure logging, while MultipartFirmwareUploadUnsupported records unsupported multipart attempts separately.
Upload-path metric emissions
crates/preingestion-manager/src/lib.rs
SimpleUpdate, HttpPush, and multipart paths populate destination and error details; unsupported multipart paths emit the dedicated event.
Metric and log validation
crates/preingestion-manager/src/metrics.rs
Table-driven tests verify counter deltas, route-specific failure logs, silent successes, and multipart warning behavior.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related issues

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title is clearly related to the firmware upload refactor and the counter/logging behavior change.
Description check ✅ Passed The description matches the changeset and explains the firmware upload event and fallback refactor.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

@chet: I’ll perform a complete re-review of the pull request. 🐇

✅ Action performed

Full review finished.

@chet chet changed the title refactor(preingestion): emit firmware upload outcomes refactor(preingestion): let firmware upload results move their counter Jul 20, 2026
@chet
chet merged commit 5cd1e17 into NVIDIA:main Jul 20, 2026
63 checks passed
chet added a commit to chet/bare-metal-manager-core that referenced this pull request Jul 21, 2026
The API and BMC proxy TLS listeners incremented their existing failure counters separately from the ERROR records that explained those failures.

Typed sibling `Event`s now pair TCP accept, certificate reload, and handshake failures with their historical records. Counter names, reason labels, messages, peer addresses, and error context remain unchanged; connection attempts and successes stay metric-only rather than adding new log volume.

The branch also moves the merged NVIDIA#3743 firmware-upload outcome cases into a table-driven test. Production behavior in that area is unchanged.

This supports NVIDIA#3728

Signed-off-by: Chet Nichols III <chetn@nvidia.com>
@chet
chet deleted the gh-issue-3734 branch July 21, 2026 15:54
chet added a commit to chet/bare-metal-manager-core that referenced this pull request Jul 21, 2026
The API and BMC proxy TLS listeners incremented their existing failure counters separately from the ERROR records that explained those failures.

Typed sibling `Event`s now pair TCP accept, certificate reload, and handshake failures with their historical records. Counter names, reason labels, messages, peer addresses, and error context remain unchanged; connection attempts and successes stay metric-only rather than adding new log volume.

The branch also moves the merged NVIDIA#3743 firmware-upload outcome cases into a table-driven test. Production behavior in that area is unchanged.

This supports NVIDIA#3728

Signed-off-by: Chet Nichols III <chetn@nvidia.com>
chet added a commit to chet/bare-metal-manager-core that referenced this pull request Jul 21, 2026
The API and BMC proxy TLS listeners incremented their existing failure counters separately from the ERROR records that explained those failures.

Typed sibling `Event`s now pair TCP accept, certificate reload, and handshake failures with their historical records. Counter names, reason labels, messages, peer addresses, and error context remain unchanged; connection attempts and successes stay metric-only rather than adding new log volume.

The branch also moves the merged NVIDIA#3743 firmware-upload outcome cases into a table-driven test. Production behavior in that area is unchanged.

This supports NVIDIA#3728

Signed-off-by: Chet Nichols III <chetn@nvidia.com>
chet added a commit that referenced this pull request Jul 21, 2026
…#3741)

The API and BMC proxy TLS listeners incremented their existing failure
counters separately from the ERROR records that explained those
failures.

Typed sibling `Event`s now pair TCP accept, certificate reload, and
handshake failures with their historical records. Counter names, reason
labels, messages, peer addresses, and error context remain unchanged;
connection attempts and successes stay metric-only rather than adding
new log volume.

The branch also moves the merged #3743 firmware-upload outcome cases
into a table-driven test. Production behavior in that area is unchanged.

## Related issues

- This supports #3728
- Part of #3169

## Type of Change

- [ ] **Add** - New feature or capability
- [ ] **Change** - Changes in existing functionality
- [ ] **Fix** - Bug fixes
- [ ] **Remove** - Removed features or deprecated functionality
- [x] **Internal** - Internal changes (refactoring, tests, docs, etc.)

## Breaking Changes

- [ ] **This PR contains breaking changes**

## Testing

- [x] Unit tests added/updated
- [ ] Integration tests added/updated
- [ ] Manual testing performed
- [ ] No testing required (docs, internal refactor, etc.)

The API and BMC proxy failure matrices use `check_values` to verify that
every reason produces one counter increment and one historical ERROR
record. Since #3743 merged while this branch was open, it also converts
that PR's seven firmware-upload outcome cases to `check_values`; the
multipart fallback remains explicit because the ordered pair of attempts
is the behavior under test.

Verified with:

- the focused `carbide-api-core` TLS failure `Event` test
- the focused `carbide-bmc-proxy` TLS failure `Event` test
- the focused `carbide-preingestion-manager` firmware-upload outcome
test
- `cargo make format-nightly`
- `cargo make clippy`
- `cargo make carbide-lints`
- `cargo make check-event-names`
- `cargo xtask check-metric-docs`

## Additional Notes

The firmware-upload changes are test-only; production behavior in that
area remains the version merged through #3743.

Signed-off-by: Chet Nichols III <chetn@nvidia.com>
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.

Unify preingestion firmware upload logs and metrics

2 participants