Skip to content

chore: refactor gapic node processing#6784

Merged
sofisl merged 8 commits intomainfrom
refactorGapicNodeProcessing
Oct 7, 2025
Merged

chore: refactor gapic node processing#6784
sofisl merged 8 commits intomainfrom
refactorGapicNodeProcessing

Conversation

@sofisl
Copy link
Contributor

@sofisl sofisl commented Oct 3, 2025

This is a pre-PR for actual changes that I need. I'm refactoring the library so I can easily add a feature later on. For the time being, this merely consolidates all the library information into a library object.

Essentially we're moving a lot of target-library-specific information from the generate-index.ts command to a top-level library object so that we can use the information more globally.

The motivation for this PR is #6777. The test is failing because the system-test is testing all the clients in v1 - but not all those clients exist in v1beta1. Since the default version is still v1beta1, we need to test those clients, as opposed to the clients in v1. (separately, we should probably also upgrade this library). Basically this exposes the need to test the same clients in the default version, which means the clients and default version exposed globally vs. per function, hence the new library object.

I've tried to make as few changes as possible here so as to not break anything too much. I'll create a separate follow up PR putting more methods into the actual library object, for now we can just pass in the library object as is since it preserves functionality the best.

@sofisl sofisl requested review from a team and yoshi-approver as code owners October 3, 2025 16:55
Comment on lines +41 to +44
FAKE_DIRECTORY,
FAKE_DEST_DIRECTORY,
undefined,
true,
Copy link
Contributor

Choose a reason for hiding this comment

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

maintainability nit: can these be passed as named parameters rather than positional ones so it's easier to know which value is which parameter?

assert.match(contents, /..\/..\/protos\/protos.js/);
});

it('should guess the default version if not provided', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this test removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The functionality was moved to library.ts so it was moved to the library.test.ts file. The corresponding test is: should correctly initialize versions and clients if no default version is provided.

return defaultVersionAndClients;
}

// In case a default version isn't provided, this function should
Copy link
Contributor

Choose a reason for hiding this comment

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

nit - regular comment before more thorough docstring

sofisl added a commit that referenced this pull request Oct 3, 2025
@sofisl sofisl requested a review from leahecole October 6, 2025 22:08
@sofisl
Copy link
Contributor Author

sofisl commented Oct 6, 2025

@leahecole this is ready for review, PTAL!

sofisl and others added 3 commits October 7, 2025 09:13
Co-authored-by: Leah E. Cole <6719667+leahecole@users.noreply.github.com>
Co-authored-by: Leah E. Cole <6719667+leahecole@users.noreply.github.com>
@sofisl sofisl merged commit 191cac1 into main Oct 7, 2025
11 checks passed
@sofisl sofisl deleted the refactorGapicNodeProcessing branch October 7, 2025 17:41
feywind pushed a commit that referenced this pull request Oct 7, 2025
…#6777)

* chore: run compileProtos and update gapic-node-processing

PiperOrigin-RevId: 813843285

Source-Link: googleapis/googleapis@c61d80b

Source-Link: googleapis/googleapis-gen@e195618
Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLW1ldGFzdG9yZS8uT3dsQm90LnlhbWwiLCJoIjoiZTE5NTYxOGU4NWFmN2U0YTA5MmU0NDkzYTU4YzIxZmQ0M2Q3ZDE0OCJ9
Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLW1pZ3JhdGlvbmNlbnRlci8uT3dsQm90LnlhbWwiLCJoIjoiZTE5NTYxOGU4NWFmN2U0YTA5MmU0NDkzYTU4YzIxZmQ0M2Q3ZDE0OCJ9
Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLW1vZGVsYXJtb3IvLk93bEJvdC55YW1sIiwiaCI6ImUxOTU2MThlODVhZjdlNGEwOTJlNDQ5M2E1OGMyMWZkNDNkN2QxNDgifQ==
Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLW5ldGFwcC8uT3dsQm90LnlhbWwiLCJoIjoiZTE5NTYxOGU4NWFmN2U0YTA5MmU0NDkzYTU4YzIxZmQ0M2Q3ZDE0OCJ9
Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLW5ldHdvcmtjb25uZWN0aXZpdHkvLk93bEJvdC55YW1sIiwiaCI6ImUxOTU2MThlODVh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8uT3dsQm90LnlhbWwiLCJoIjoiZTE5NTYxOGU4NWFmN2U0YTA5MmU0NDkzYTU4YzIxZmQ0M2Q3ZDE0OCJ9
Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXBvbGljeXRyb3VibGVzaG9vdGVyLy5Pd2xCb3QueWFtbCIsImgiOiJlMTk1NjE4ZTg1YWY3ZTRhMDkyZTQ0OTNhNThjMjFmZDQzZDdkMTQ4In0=

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* fix: remove unmaintained file in networksecurity

* chore: manually fix what will be fixed by #6784

* remove extra clients

* fix typo

* undo change to published name

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Sofia Leon <sofialeon@google.com>
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.

2 participants