googleapis / googleapis/google-cloud-cpp

Use first client with a `List*()` operation for quickstart skeleton

Open
#12,632 2 comments 0 reactions 0 assignees View on GitHub
cpp: generator cpp: operator type: cleanup
Dominant language
C++
Stars
659
Forks
462
Avg merge
1d 2h
Merged PRs (30d)
89

Description

The scaffold generator runs without any context of the protos in use. We could move the generation of the quickstart skeleton to have access to the service definition. With that information we could generate a correct include file here:

https://github.com/googleapis/google-cloud-cpp/blob/43cd3d9a65df32310bca8d8878ee322d73493a03/generator/internal/scaffold_generator.cc#L938

and maybe pick the first `List*()` overload consuming a string (with some fallback to "EDIT HERE" if there is none):

https://github.com/googleapis/google-cloud-cpp/blob/43cd3d9a65df32310bca8d8878ee322d73493a03/generator/internal/scaffold_generator.cc#L953

Contributor guide

Open the contributing guide

Research direction

Start in generator/internal/scaffold_generator.cc at the referenced include-generation and List*() selection points. Trace how the scaffold generator currently runs without proto context, then determine how service definitions can be made available. Done means the quickstart skeleton emits the correct include and selects the first string-consuming List*() overload, falling back to "EDIT HERE" when none exists.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.