Skip to content

feat(inventory): add CPU arch reporting and SDL arch attribute support - #337

Open
chainzero wants to merge 3 commits into
mainfrom
feat/cpu-arch-inventory
Open

feat(inventory): add CPU arch reporting and SDL arch attribute support#337
chainzero wants to merge 3 commits into
mainfrom
feat/cpu-arch-inventory

Conversation

@chainzero

Copy link
Copy Markdown

📝 Description

Covers inventory CPU arch reporting, bid engine filtering, and SDL arch attribute support

🔧 Purpose of the Change

  • [ X] New feature implementation
  • Bug fix
  • Documentation update
  • Code refactoring
  • Dependency upgrade
  • Other: [specify]

📌 Related Issues

  • Closes #ISSUE_NUMBER
  • References #ISSUE_NUMBER

✅ Checklist

  • [ X] I've updated relevant documentation
  • [ X] Code follows Akash Network's style guide
  • [ X] I've added/updated relevant unit tests
  • [ X] Dependencies have been properly updated
  • [ X] I agree and adhered to the Contribution Guidelines

@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The PR adds an arch field to CPU inventory data, preserves it during duplication, and adds YAML unmarshalling for CPU resources with a test covering input that omits arch.

Changes

CPU arch propagation

Layer / File(s) Summary
Schema and duplication
proto/provider/akash/inventory/v1/cpu.proto, go/inventory/v1/cpu.go
CPUInfo adds arch, and CPUInfoS.Dup() copies Arch into each duplicated item.
YAML decoding and test
go/sdl/cpu.go, go/sdl/cpu_test.go
v2ResourceCPU.UnmarshalYAML decodes units and attributes, rejects unsupported fields, and the new test covers YAML without arch.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A bunny hopped through CPU fields bright,
with arch tucked in just right.
I nibbled YAML, clean and neat,
and copied dupes without a leak.
🐇🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The description follows the template and covers the change, purpose, checklist, and issue references, though some fields remain placeholders.
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 clearly summarizes the main change: CPU architecture reporting plus SDL CPU arch attribute support.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/cpu-arch-inventory

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@go/sdl/cpu.go`:
- Around line 19-38: In v2ResourceCPU.UnmarshalYAML, validate that the incoming
yaml.Node is a mapping before iterating node.Content; currently scalar or
sequence nodes fall through and return an empty v2ResourceCPU without error. Add
an early node.Kind check in UnmarshalYAML and return a clear error for
non-mapping CPU resources, then keep the existing field decoding logic for units
and attributes unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f02118f0-e2f0-4126-b412-4b1dcd49212d

📥 Commits

Reviewing files that changed from the base of the PR and between cbe61a5 and 70049ca.

⛔ Files ignored due to path filters (1)
  • go/inventory/v1/cpu.pb.go is excluded by !**/*.pb.go
📒 Files selected for processing (4)
  • go/inventory/v1/cpu.go
  • go/sdl/cpu.go
  • go/sdl/cpu_test.go
  • proto/provider/akash/inventory/v1/cpu.proto

Comment thread go/sdl/cpu.go
@chainzero chainzero changed the title Feat/cpu arch inventory feat(inventory): add CPU arch reporting and SDL arch attribute support Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants