googleapis / googleapis/librarian

proposal: librarian add default.exclude_list

Open
#6,985 2 comments 0 reactions 0 assignees View on GitHub
priority: p3 type: feat
Dominant language
Go
Stars
45
Forks
61
Avg merge
19h 11m
Merged PRs (30d)
181

Description

While in https://github.com/googleapis/librarian/pull/6959 we removed all language restrictions and https://github.com/googleapis/librarian/pull/6165 we removed all API path restrictions for onboarding, we also acknowledge in https://github.com/googleapis/librarian/issues/4997 and https://github.com/googleapis/librarian/issues/5535 that some languages may want to limit the APIs that would be onboarded e.g. if it was entirely automated and done in bulk.

For example, Rust currently doesn't have any pre-GA API versions i.e. alpha or beta. If we implemented https://github.com/googleapis/librarian/issues/6468 and automated onboarding in bulk, Rust should be able to specify the APIs to exclude from onboarding. Similarly, the Google Ads API has its own SDK organization and we do not generate clients in any language for `//google/ads/googleads/...`.

This might all lead back to the question "why did we remove the `languages`/`path` restrictions from sdk.yaml?". The answer is that each SDK repo `librarian.yaml` should be the source of truth for which APIs that SDK contains. As such, it should control which APIs it onboards. Furthermore, the previous implementation focused on producing an error attempting to onboard a restricted API, when our goals now are more oriented towards "just ignore the things we don't want, and make it really easy to onboard the things we do want".

All that said, to facilitate the language SDK's "sovereignty" while enabling bulk onboarding, we should consider a new top-level property:

```go
type Default struct {
//...

// ExcludeList contains both the exact path of and regex
// patterns matching API directories to silently exclude from
// onboarding with librarian add --all. If an excluded path is
// explicitly provided as the argument to a direct librarian add
// the command will fail and an error will be logged.
ExcludeList []string
}
```

Contributor guide

Open the contributing guide

Research direction

Start by locating the Go Default configuration type and the entry points for `librarian add --all` and direct `librarian add`. Trace how API directories are selected and how excluded paths currently surface errors. Done means a top-level `ExcludeList` can silently filter bulk onboarding while an explicitly requested excluded path fails and logs an error.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.