feat(provider): add BidScreening RPC and validation proto#243
Conversation
WalkthroughAdds a new Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
proto/provider/akash/provider/v1/service.proto (1)
29-29: Add a doc comment and considergoogle.api.httpannotation.Two minor gaps:
Missing doc comment —
GetStatusandStreamStatusboth have documentation comments;BidScreeninghas none. Add a comment like:+ // BidScreening screens a deployment group specification for bid eligibility + // against the provider's capabilities. rpc BidScreening(BidScreeningRequest) returns (BidScreeningResponse);No
google.api.httpoption —GetStatusis exposed via REST with this annotation. IfBidScreeningis intended to be callable over HTTP (e.g., by off-chain tooling querying the provider's gRPC-gateway), it needs anoption (google.api.http)block. Omitting it is fine if this is intentionally gRPC-only, but worth confirming.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@proto/provider/akash/provider/v1/service.proto` at line 29, Add a one-line doc comment for the BidScreening RPC (e.g., describing that it evaluates or filters bids and what BidScreeningRequest/BidScreeningResponse contain) to match the style used for GetStatus and StreamStatus, and if this RPC should be exposed via REST also add an option (google.api.http) block for BidScreening that maps an appropriate HTTP method/path to the BidScreeningRequest; if it is intentionally gRPC-only explicitly leave out the google.api.http option but still add the doc comment.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@proto/provider/akash/provider/v1/validation.proto`:
- Around line 48-53: The price field currently uses (gogoproto.nullable)=true
but its (gogoproto.jsontag) is "price" so unset values serialize as "price":
null; update the price field metadata to include omitempty (e.g., change
(gogoproto.jsontag) to "price,omitempty") and mirror the omission behavior for
other tags (optionally add omitempty to (gogoproto.moretags) like
yaml:"price,omitempty") so that when the Price pointer is nil the JSON output
omits the key, matching resource_offer.
---
Nitpick comments:
In `@proto/provider/akash/provider/v1/service.proto`:
- Line 29: Add a one-line doc comment for the BidScreening RPC (e.g., describing
that it evaluates or filters bids and what
BidScreeningRequest/BidScreeningResponse contain) to match the style used for
GetStatus and StreamStatus, and if this RPC should be exposed via REST also add
an option (google.api.http) block for BidScreening that maps an appropriate HTTP
method/path to the BidScreeningRequest; if it is intentionally gRPC-only
explicitly leave out the google.api.http option but still add the doc comment.
ℹ️ Review info
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
go/provider/v1/service.pb.gois excluded by!**/*.pb.gogo/provider/v1/validation.pb.gois excluded by!**/*.pb.go
📒 Files selected for processing (2)
proto/provider/akash/provider/v1/service.protoproto/provider/akash/provider/v1/validation.proto
Signed-off-by: Artur Troian <troian@users.noreply.github.com>
29d187d to
3cdfd20
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/proto/provider.md`:
- Around line 1105-1141: The generated validation section produces indented
headings and unresolved fragment links for types used by
BidScreeningRequest/BidScreeningResponse (fields: group_spec, hostnames, passed,
reasons, resource_offer, price); update the doc generator (or markdownlint
config) so headings are emitted at column 1 (no leading spaces) and modify link
generation to either emit local anchors for external types (e.g.,
akash.deployment.v1beta4.GroupSpec, akash.market.v1beta5.ResourceOffer,
cosmos.base.v1beta1.DecCoin) or produce full external URLs when the fragment
cannot be resolved, ensuring all references are resolvable by the linter.
- Line 1179: The table row for BidScreening in docs/proto/provider.md is missing
the Endpoint column; update the generator/template that emits the row for the
BidScreening RPC so the row has six pipe-separated cells (e.g., add an empty
endpoint cell between the description and the trailing pipe). Locate the code
that outputs the RPC table entry for BidScreening (references: BidScreening,
BidScreeningRequest, BidScreeningResponse) and ensure it emits the additional
empty cell (or the actual endpoint string) to match the table header.
ℹ️ Review info
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (9)
go/provider/v1/service.pb.gois excluded by!**/*.pb.gogo/provider/v1/validation.pb.gois excluded by!**/*.pb.gots/src/generated/createProviderSDK.tsis excluded by!**/generated/**ts/src/generated/patches/providerCustomTypePatches.spec.tsis excluded by!**/generated/**ts/src/generated/patches/providerCustomTypePatches.tsis excluded by!**/generated/**ts/src/generated/patches/providerPatchMessage.tsis excluded by!**/generated/**ts/src/generated/protos/akash/provider/v1/service_akash.tsis excluded by!**/generated/**ts/src/generated/protos/akash/provider/v1/validation.tsis excluded by!**/generated/**ts/src/generated/protos/index.provider.akash.v1.tsis excluded by!**/generated/**
📒 Files selected for processing (3)
docs/proto/provider.mdproto/provider/akash/provider/v1/service.protoproto/provider/akash/provider/v1/validation.proto
🚧 Files skipped from review as they are similar to previous changes (1)
- proto/provider/akash/provider/v1/service.proto
| <a name="akash/provider/v1/validation.proto"></a> | ||
| <p align="right"><a href="#top">Top</a></p> | ||
|
|
||
| ## akash/provider/v1/validation.proto | ||
|
|
||
|
|
||
|
|
||
| <a name="akash.provider.v1.BidScreeningRequest"></a> | ||
|
|
||
| ### BidScreeningRequest | ||
| BidScreeningRequest represents a request to screen a deployment group | ||
| specification for bid eligibility against the provider's capabilities. | ||
|
|
||
|
|
||
| | Field | Type | Label | Description | | ||
| | ----- | ---- | ----- | ----------- | | ||
| | `group_spec` | [akash.deployment.v1beta4.GroupSpec](#akash.deployment.v1beta4.GroupSpec) | | GroupSpec is the deployment group specification to screen for bid eligibility. | | ||
| | `hostnames` | [string](#string) | repeated | Hostnames is the list of hostnames requested by the deployment. | | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| <a name="akash.provider.v1.BidScreeningResponse"></a> | ||
|
|
||
| ### BidScreeningResponse | ||
| BidScreeningResponse represents the result of screening a deployment group | ||
| specification for bid eligibility against the provider's capabilities. | ||
|
|
||
|
|
||
| | Field | Type | Label | Description | | ||
| | ----- | ---- | ----- | ----------- | | ||
| | `passed` | [bool](#bool) | | Passed indicates whether the deployment group passed bid screening. | | ||
| | `reasons` | [string](#string) | repeated | Reasons contains explanations when screening fails. | | ||
| | `resource_offer` | [akash.market.v1beta5.ResourceOffer](#akash.market.v1beta5.ResourceOffer) | | ResourceOffer is the provider's resource offer for the screened group, if passed. | | ||
| | `price` | [cosmos.base.v1beta1.DecCoin](#cosmos.base.v1beta1.DecCoin) | | Price is the minimum bid price for the screened group. | |
There was a problem hiding this comment.
Fix markdownlint warnings in the generated validation section.
Headings appear indented and the new field links reference fragments that aren’t resolvable in this doc. Since the file is auto-generated, update the doc generator (or lint config) to:
- emit headings at column 1, and
- ensure anchors exist for referenced external types or use external links.
🧰 Tools
🪛 markdownlint-cli2 (0.21.0)
[warning] 1108-1108: Headings must start at the beginning of the line
(MD023, heading-start-left)
[warning] 1114-1114: Headings must start at the beginning of the line
(MD023, heading-start-left)
[warning] 1121-1121: Link fragments should be valid
(MD051, link-fragments)
[warning] 1131-1131: Headings must start at the beginning of the line
(MD023, heading-start-left)
[warning] 1140-1140: Link fragments should be valid
(MD051, link-fragments)
[warning] 1141-1141: Link fragments should be valid
(MD051, link-fragments)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@docs/proto/provider.md` around lines 1105 - 1141, The generated validation
section produces indented headings and unresolved fragment links for types used
by BidScreeningRequest/BidScreeningResponse (fields: group_spec, hostnames,
passed, reasons, resource_offer, price); update the doc generator (or
markdownlint config) so headings are emitted at column 1 (no leading spaces) and
modify link generation to either emit local anchors for external types (e.g.,
akash.deployment.v1beta4.GroupSpec, akash.market.v1beta5.ResourceOffer,
cosmos.base.v1beta1.DecCoin) or produce full external URLs when the fragment
cannot be resolved, ensuring all references are resolvable by the linter.
| | ----------- | ------------ | ------------- | ------------| ------- | -------- | | ||
| | `GetStatus` | [.google.protobuf.Empty](#google.protobuf.Empty) | [Status](#akash.provider.v1.Status) | GetStatus defines a method to query provider state buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE buf:lint:ignore RPC_RESPONSE_STANDARD_NAME | GET|/v1/status| | ||
| | `StreamStatus` | [.google.protobuf.Empty](#google.protobuf.Empty) | [Status](#akash.provider.v1.Status) stream | Status defines a method to stream provider state buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE buf:lint:ignore RPC_RESPONSE_STANDARD_NAME | | | ||
| | `BidScreening` | [BidScreeningRequest](#akash.provider.v1.BidScreeningRequest) | [BidScreeningResponse](#akash.provider.v1.BidScreeningResponse) | BidScreening screens a deployment group spec for bid eligibility and returns pricing | | |
There was a problem hiding this comment.
Table row is missing the Endpoint column.
The BidScreening row has 5 cells but the header expects 6. Add an empty endpoint cell (or a real endpoint if applicable) in the generator.
Suggested row format
-| `BidScreening` | [BidScreeningRequest](`#akash.provider.v1.BidScreeningRequest`) | [BidScreeningResponse](`#akash.provider.v1.BidScreeningResponse`) | BidScreening screens a deployment group spec for bid eligibility and returns pricing | |
+| `BidScreening` | [BidScreeningRequest](`#akash.provider.v1.BidScreeningRequest`) | [BidScreeningResponse](`#akash.provider.v1.BidScreeningResponse`) | BidScreening screens a deployment group spec for bid eligibility and returns pricing | | |📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| | `BidScreening` | [BidScreeningRequest](#akash.provider.v1.BidScreeningRequest) | [BidScreeningResponse](#akash.provider.v1.BidScreeningResponse) | BidScreening screens a deployment group spec for bid eligibility and returns pricing | | | |
| | `BidScreening` | [BidScreeningRequest](`#akash.provider.v1.BidScreeningRequest`) | [BidScreeningResponse](`#akash.provider.v1.BidScreeningResponse`) | BidScreening screens a deployment group spec for bid eligibility and returns pricing | | | |
🧰 Tools
🪛 markdownlint-cli2 (0.21.0)
[warning] 1179-1179: Table column count
Expected: 6; Actual: 5; Too few cells, row will be missing data
(MD056, table-column-count)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@docs/proto/provider.md` at line 1179, The table row for BidScreening in
docs/proto/provider.md is missing the Endpoint column; update the
generator/template that emits the row for the BidScreening RPC so the row has
six pipe-separated cells (e.g., add an empty endpoint cell between the
description and the trailing pipe). Locate the code that outputs the RPC table
entry for BidScreening (references: BidScreening, BidScreeningRequest,
BidScreeningResponse) and ensure it emits the additional empty cell (or the
actual endpoint string) to match the table header.
Signed-off-by: Artur Troian <troian@users.noreply.github.com> Co-authored-by: Artur Troian <troian@users.noreply.github.com>
📝 Description
[Explain what this PR does in 2-3 sentences. Include context about the feature or problem being solved]
🔧 Purpose of the Change
📌 Related Issues
✅ Checklist
📎 Notes for Reviewers
[Include any additional context, architectural decisions, or specific areas to focus on]