Skip to content

chore: specify explicit options for all API paths in librarian.yaml#16762

Merged
jskeet merged 4 commits intogoogleapis:mainfrom
jskeet:explicit-options
Apr 23, 2026
Merged

chore: specify explicit options for all API paths in librarian.yaml#16762
jskeet merged 4 commits intogoogleapis:mainfrom
jskeet:explicit-options

Conversation

@jskeet
Copy link
Copy Markdown
Contributor

@jskeet jskeet commented Apr 22, 2026

This means we don't use the generator default for any of:

  • python-gapic-name
  • python-gapic-namespace
  • warehouse-package-name

Only API paths which didn't already have an explicit default were updated.

The changes are all from explicitly specifying warehouse-package-name, and are all corrections from where the generator was inferring the package name incorrectly. (And regenerating Datastore, which wasn't automated in #16737.)

This is the first step in googleapis/librarian#5163 - we will then change librarian to use a new approach to inference (deriving the namespace just from the first two components of the API path), and remove all the explicit options which would be inferred the same way. So while this PR adds a lot of lines to the config, many will later be removed again.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request standardizes package names across several Google Cloud Python libraries, updating type marker files, sample installation instructions, and snippet metadata to use consistent package identifiers. It also includes minor import reordering in test files and formatting adjustments in repository metadata. I have no feedback to provide.

@jskeet jskeet added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 22, 2026
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 22, 2026
@jskeet
Copy link
Copy Markdown
Contributor Author

jskeet commented Apr 22, 2026

(Having just prototyped the "remove redundant options", the librarian.yaml file will end up being smaller than it is today...)

Comment thread librarian.yaml
Comment thread librarian.yaml
@jskeet jskeet added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Apr 22, 2026
@jskeet jskeet force-pushed the explicit-options branch from 391d421 to 5cc56ab Compare April 22, 2026 15:04
@jskeet jskeet requested a review from a team as a code owner April 22, 2026 15:04
@jskeet
Copy link
Copy Markdown
Contributor Author

jskeet commented Apr 22, 2026

Rebased on main so that we don't reinstate the keep lists we removed before. I'm locally running a librarian generate --all to check that other changes that have come in since creating this haven't caused any issues.

@jskeet jskeet requested review from a team as code owners April 22, 2026 15:37
@jskeet jskeet removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Apr 22, 2026
@parthea
Copy link
Copy Markdown
Contributor

parthea commented Apr 22, 2026

#16764 should fix the prerelease tests for google-cloud-spanner

@jskeet
Copy link
Copy Markdown
Contributor Author

jskeet commented Apr 22, 2026

Great - will rebase tomorrow UK time and merge when green (assuming the approval sticks)

@jskeet
Copy link
Copy Markdown
Contributor Author

jskeet commented Apr 23, 2026

@parthea: Looking at the Kokoro logs, I believe these are Spanner failures

@jskeet jskeet added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 23, 2026
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 23, 2026
@jskeet jskeet added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 23, 2026
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 23, 2026
@jskeet
Copy link
Copy Markdown
Contributor Author

jskeet commented Apr 23, 2026

Ah, I hadn't realised that #16764 hadn't been merged. That explains why the presubmits are still failing. Happy to rebase again as soon as that's merged.

parthea added a commit that referenced this pull request Apr 23, 2026
…tests (#16764)

This PR fixes 2 failing tests which appear in
#16762

In the system test presubmit `Kokoro System Tests`, the assertion is too
strict. Protobuf objects may fail equality (==) if one has extra
metadata populated by the server that the other lacks. If the server
fills in a default field in one response but not another, the assertion
fails even if the ID is identical. In addition, we need to cater for the
chance that other spanner instances are created while tests are running.
For example, in [one test
result](https://btx.cloud.google.com/invocations/946e7000-b177-491a-947a-88f2daf52a68/log)
we expected instance
`projects/precise-truck-742/instances/google-cloud-python-systest` but
found `projects/precise-truck-742/instances/multi-region-1776903230037`

```
=================================== FAILURES ===================================
_____________________________ test_list_instances ______________________________
..

    def test_list_instances(
        no_create_instance,
        spanner_client,
        existing_instances,
        shared_instance,
    ):
        instances = list(spanner_client.list_instances())
    
        for instance in instances:
>           assert instance in existing_instances or instance is shared_instance
...
tests/system/test_instance_api.py:40: AssertionError
```

The other failure only appears in the `Kokoro Pre-release Tests`.
Updating the `prerelease_deps` nox session to match the system test
session resolves the issue.

```
==================================== ERRORS ====================================
____________________ ERROR at setup of test_table_not_found ____________________

self = 

    def setup(self) -> None:
        runner_fixture_id = f"_{self._loop_scope}_scoped_runner"
        if runner_fixture_id not in self.fixturenames:
            self.fixturenames.append(runner_fixture_id)
>       return super().setup()
               ^^^^^^^^^^^^^^^

.nox/8f8a4a6e/lib/python3.14/site-packages/pytest_asyncio/plugin.py:458: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

fixturedef = 
request = >

    @pytest.hookimpl(wrapper=True)
    def pytest_fixture_setup(fixturedef: FixtureDef, request) -> object | None:
        asyncio_mode = _get_asyncio_mode(request.config)
        if not _is_asyncio_fixture_function(fixturedef.func):
            if asyncio_mode == Mode.STRICT:
                # Ignore async fixtures without explicit asyncio mark in strict mode
                # This applies to pytest_trio fixtures, for example
>               return (yield)
                        ^^^^^
E               pytest.PytestRemovedIn9Warning: '' requested an async fixture 'instance_configs', with no plugin or hook that handled it. This is usually an error, as pytest does not natively support it. This will turn into an error in pytest 9.
E               See: https://docs.pytest.org/en/stable/deprecations.html#sync-test-depending-on-async-fixture

.nox/8f8a4a6e/lib/python3.14/site-packages/pytest_asyncio/plugin.py:728: PytestRemovedIn9Warning

```

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@parthea
Copy link
Copy Markdown
Contributor

parthea commented Apr 23, 2026

@jskeet Please could you rebase again to include the fix from #16764 ?

jskeet added 4 commits April 23, 2026 16:40
This means we don't use the generator default for any of:

- python-gapic-name
- python-gapic-namespace
- warehouse-package-name

A later change in librarian will start inferring these options itself,
at which point we can remove the options which are then redundant -
and new APIs should almost always use the inferred ones.
The changes here are all corrections where previously the package name
was incorrect in comments.
(Those packages weren't previously enabled for generation.)
@jskeet jskeet force-pushed the explicit-options branch from 231872c to d82998e Compare April 23, 2026 16:40
@jskeet
Copy link
Copy Markdown
Contributor Author

jskeet commented Apr 23, 2026

@parthea: Done. Fingers crossed...

@jskeet jskeet enabled auto-merge (squash) April 23, 2026 16:47
@parthea
Copy link
Copy Markdown
Contributor

parthea commented Apr 23, 2026

Kokoro Deps at HEAD Tests failed due to a Github outage. Retrying test. https://www.githubstatus.com/

  remote: Internal Server Error
  fatal: unable to access 'https://github.com/googleapis/google-cloud-python/': The requested URL returned error: 500
  error: subprocess-exited-with-error

@jskeet jskeet merged commit e816fdd into googleapis:main Apr 23, 2026
31 of 57 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants