googleapis / googleapis/librarian

rust: create a presubmit check to verify parsed codec object from `librarian.yaml`

Open
#6,464 0 comments 0 reactions 0 assignees View on GitHub
priority: p3
Dominant language
Go
Stars
45
Forks
61
Avg merge
18h 32m
Merged PRs (30d)
175

Description

> I can repro locally but there is no error message...
>
> That is because the `main()` function eats the error:
>
> https://github.com/googleapis/librarian/blob/7a433e71b701feda02bcf63e78624dcd08c5eb27/cmd/librarian/main.go#L28
>
> That `log.` prints nothing by default... The actual `err` value is:
>
> ```
> ibrarian: generate library "google-cloud-billing-v1" (rust): cannot find field in method signature for method .google.cloud.billing.v1.CloudCatalog.ListServices
> ```
>
> caused by:
>
> https://github.com/googleapis/googleapis/blob/7af3f2c7b8927cffb548fd2cf09b04c6371437ee/google/cloud/billing/v1/cloud_catalog.proto#L48

_Originally posted by @coryan in [#6455](https://github.com/googleapis/librarian/issues/6455#issuecomment-4724184816)_

The root cause of this issue is the source (protos, `sdk.yaml` and `librarian.yaml`) of the codec object used in rust generation has unexpected values.

We could create a presubmit check to verify the parsed codec object doesn't have error.

Contributor guide

Open the contributing guide

Research direction

Start with cmd/librarian/main.go around line 28 to understand the swallowed error, then trace how protos, sdk.yaml, and librarian.yaml are parsed into the codec object for Rust generation. Add a presubmit validation that detects invalid parsed codec data and reports the error; done means the malformed Cloud Catalog input is caught before generation.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, rust
Domain
build-system, ci-cd, testing-qa
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.