Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add new LongRunning client, rename LongRunning namespace (and add alias for BC) #6675

Merged
merged 10 commits into from
Apr 10, 2024

Conversation

bshaffer
Copy link
Contributor

@bshaffer bshaffer commented Oct 2, 2023

In order for docs references to render correctly, the google-longrunning client should be in the same namespace as its protos. This is also just a better practice, since the proto package is google.longrunning for the client, so we should use the one defined in it.

We should potentially update longrunning_gapic.yaml as well (which is no longer used AFAIK).

BREAKING_CHANGE_REASON=this should not cause any breaking changes, but the detector does not recognize class aliases

@bshaffer bshaffer changed the title chore: fix LongRunning client namespace (and add alias for BC) chore: rename LongRunning client namespace (and add alias for BC) Oct 11, 2023
Copy link
Contributor

@noahdietz noahdietz left a comment

Choose a reason for hiding this comment

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

Yep definitely want to update the old gapic yaml even just to clean up the old ref.

very nice :)

}
// Autoload the class and its alias
class_exists('\Google\LongRunning\OperationsClient');
@trigger_error('Google\LongRunning\ApiCore\OperationsClient is deprecated and will be removed in the next major release. Use Google\LongRunning\OperationsClient instead', E_USER_DEPRECATED);
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to do this if all of our clients are currently using this?

Maybe we add it later once we've also migrated GAPIC v1 and v2 to the new namespace?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's suppressed (hence the @ before the trigger_error), so it won't actually produce the error, but it will show up in logs and IDEs. So I think it's okay to do. But I am also okay removing it if you think it's overkill.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's great to add, but just not immediately, since for the most part, end users don't interact with this client directly, but all of our GAPICs do. The effect is that end users see a warning that they can't do anything about. Like they can't change the GAPIC code, only we can.

So we'd want to update GAPIC v1 surfaces to reference the new class instead, regenerate everything, push that out, then add the warning here. Does that make sense or?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a very good point and definitely makes sense! Thanks for pointing it out, I'll remove the call.

// the generated {@see OperationsGapicClient} class.
}

class_alias('Google\LongRunning\OperationsClient', 'Google\ApiCore\LongRunning\OperationsClient');
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need an Alias? My guess is that we are trying to avoid breaking changes. Is that right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes that's correct! We don't want to introduce any behavioral change

@bshaffer
Copy link
Contributor Author

@noahdietz

Yep definitely want to update the old gapic yaml even just to clean up the old ref.

Do you think this needs to happen before or after we release these changes? I assume after is fine but I'm not super clear on the implications of the GAPIC YAML files at this point.

Copy link
Contributor

@Hectorhammett Hectorhammett left a comment

Choose a reason for hiding this comment

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

🚢

@bshaffer bshaffer enabled auto-merge (squash) April 10, 2024 22:50
@bshaffer bshaffer merged commit 2fe9eaf into main Apr 10, 2024
24 checks passed
@bshaffer bshaffer deleted the fix-longrunning-client-namespace branch April 10, 2024 23:03
@bshaffer bshaffer changed the title chore: rename LongRunning client namespace (and add alias for BC) feat: feat: add new LongRunning client, rename LongRunning namespace (and add alias for BC) Apr 10, 2024
@bshaffer bshaffer changed the title feat: feat: add new LongRunning client, rename LongRunning namespace (and add alias for BC) feat: add new LongRunning client, rename LongRunning namespace (and add alias for BC) Apr 10, 2024
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.

None yet

3 participants