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: [PubSub] add Google Pub/Sub Schema Revision support #9

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mrbiya
Copy link
Contributor

@mrbiya mrbiya commented Sep 19, 2023

This pull request addresses a critical gap in the existing functionality of the Google Library in PHP by introducing support for managing schema revisions within Google Pub/Sub. Currently, this feature is missing, and this PR aims to rectify that by providing the ability to retrieve all revisions for a specific schema, as well as the capability to commit and delete these revisions.

Key Changes:

Schema Revision Retrieval: We've added a new method to the Google Library that allows users to retrieve all revisions associated with a particular schema. This enhancement makes it easier to track and manage schema changes over time.

Example Usage:

$client = new PubSubClient();
$schema = $client->schema('schema_name');
$revisions = $schema->listRevisions();

foreach ($revisions['schemas'] as $revision) {
    echo $revision['definition'];
}

Commit and Delete Revisions: To provide comprehensive schema management, we've introduced methods for committing and deleting schema revisions. These functions empower users to control their schema history effectively.

Example Usage (Committing a Revision):

$client = new PubSubClient();
$schema = $client->schema('schema_name');
$definition = file_get_contents('path_to_your_schema_definition.json');
$revision = $schema->commit($definition, $typw);
$client = new PubSubClient();
$schema = $client->schema('schema_name');
$revisions = $schema->deleteRevision('revision_id);

Benefits:

Improved Schema Management: Users can now effortlessly access, commit, and delete schema revisions, enhancing the overall schema management experience.
Comprehensive Control: This addition provides a holistic solution for handling schema revisions within Google Pub/Sub, ensuring better version control and traceability.
We believe that this PR will significantly improve the functionality and usability of the Google Library in PHP, making it a more powerful tool for developers working with Google Pub/Sub schemas. Your feedback and review on this PR are highly appreciated.

@google-cla
Copy link

google-cla bot commented Sep 19, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@product-auto-label product-auto-label bot added the api: pubsub Issues related to the googleapis/google-cloud-php-pubsub API. label Sep 19, 2023
@mrbiya mrbiya changed the title Add Google Pub/Sub Schema Revision support feat: [PubSub] add Google Pub/Sub Schema Revision support Sep 19, 2023
@conventional-commit-lint-gcf
Copy link

🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use automerge label. Good luck human!

-- conventional-commit-lint bot
https://conventionalcommits.org/

@mrbiya mrbiya force-pushed the add-schema-revisions branch from 537a522 to f921d44 Compare September 19, 2023 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsub Issues related to the googleapis/google-cloud-php-pubsub API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant