Skip to content

feat: Add getProjectId getter for ComputeEngineCredentials#1833

Open
psx95 wants to merge 3 commits intogoogleapis:mainfrom
psx95:project-id-gce
Open

feat: Add getProjectId getter for ComputeEngineCredentials#1833
psx95 wants to merge 3 commits intogoogleapis:mainfrom
psx95:project-id-gce

Conversation

@psx95
Copy link

@psx95 psx95 commented Oct 16, 2025

This PR adds a project ID getter for ComputeEngineCredentials.

This is a follow-up to work done in #1813

@product-auto-label product-auto-label bot added the size: m Pull request size is medium. label Oct 16, 2025
@psx95 psx95 force-pushed the project-id-gce branch 2 times, most recently from 06dcbb3 to f8ef6e5 Compare October 16, 2025 21:35
@lqiu96 lqiu96 requested review from lqiu96 and zhumin8 October 20, 2025 19:52
@psx95 psx95 marked this pull request as ready for review February 23, 2026 23:25
@psx95 psx95 requested review from a team as code owners February 23, 2026 23:25
Comment on lines +367 to +369
synchronized (this) {
this.projectId = projectIdFromMetadata;
}
Copy link
Member

Choose a reason for hiding this comment

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

Can we add a check that we only set this if projectIdFromMetadata is not null.

I think one small possibility is is that if there are multiple getProjectId() calls at the same time and all but the last one work. Last one errors out and resets this to null.

I don't think we need to worry about trying to ensure that only one projectId call ever goes.

@lqiu96 lqiu96 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 25, 2026
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants