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(firestore): add WithCommitResponseTo TransactionOption #6967

Merged
merged 1 commit into from
Oct 1, 2024

Conversation

galenwarren
Copy link
Contributor

@galenwarren galenwarren commented Oct 31, 2022

Adds a new TransactionOption -- GetCommitTime -- that allows the caller to specify the address of a time.Time where the commit time of the transaction should be written, upon successful commit.

@galenwarren galenwarren requested review from enocom, telpirion and a team as code owners October 31, 2022 01:34
@google-cla
Copy link

google-cla bot commented Oct 31, 2022

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 size: s Pull request size is small. api: firestore Issues related to the Firestore API. labels Oct 31, 2022
@product-auto-label product-auto-label bot added the stale: old Pull request is old and needs attention. label Nov 30, 2022
@product-auto-label product-auto-label bot added stale: extraold Pull request is critically old and needs prioritization. and removed stale: old Pull request is old and needs attention. labels Dec 30, 2022
@galenwarren
Copy link
Contributor Author

@telpirion @enocom I was just checking on this. Would either of you be able to provide a code review? Thanks.

@enocom
Copy link
Member

enocom commented Mar 30, 2023

Sorry for the slow response @galenwarren. Ownership of this library has changed in the past few months. Let me reach out to some folks and see who should be looking at this.

@galenwarren
Copy link
Contributor Author

galenwarren commented Mar 30, 2023 via email

@enocom
Copy link
Member

enocom commented Apr 5, 2023

cc @bhshkh and @kolea2 who might know who should look at this.

@galenwarren
Copy link
Contributor Author

@enocom @bhshkh @kolea2 Any update here? Thanks.

@bhshkh
Copy link
Contributor

bhshkh commented Jun 14, 2023

Reviewing

@galenwarren
Copy link
Contributor Author

@bhshkh Thanks, please let me know if you have any questions or suggestions.

@galenwarren
Copy link
Contributor Author

@bhshkh Hi, just checking in here. Is there any update? Thanks.

@bhshkh
Copy link
Contributor

bhshkh commented Sep 13, 2023

Under discussion internally. Will update

@galenwarren
Copy link
Contributor Author

@bhshkh Is there anything I can do here to help?

@galenwarren
Copy link
Contributor Author

Is this one not going to get merged?

@codyoss
Copy link
Member

codyoss commented Jul 24, 2024

@bhshkh is this something we want to support?

@galenwarren
Copy link
Contributor Author

If anyone would like me to rebase, just let me know. Thanks!

@bhshkh
Copy link
Contributor

bhshkh commented Jul 25, 2024

Sorry for the very delayed response. Reviewing this

@bhshkh
Copy link
Contributor

bhshkh commented Jul 25, 2024

One problem I see with the current design is that it is not extendable. This is what the commit response looks like

// The response for [Firestore.Commit][google.firestore.v1.Firestore.Commit].
type CommitResponse struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	// The result of applying the writes.
	//
	// This i-th write result corresponds to the i-th write in the
	// request.
	WriteResults []*WriteResult `protobuf:"bytes,1,rep,name=write_results,json=writeResults,proto3" json:"write_results,omitempty"`
	// The time at which the commit occurred. Any read with an equal or greater
	// `read_time` is guaranteed to see the effects of the commit.
	CommitTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=commit_time,json=commitTime,proto3" json:"commit_time,omitempty"`
}

Apart from CommitTime field, there is another field called WriteResults. If/when in the future, we want to support retrieving WriteResults, we will have to introduce another transaction option and so on and so forth for any more fields added to the above struct.

Another thing is that the name GetCommitTime does not look appropriate. Open to any alternatives to that.
One option could be to rename the transaction option to WithCommitResponseTo(*pb.CommitResponse)

@bhshkh
Copy link
Contributor

bhshkh commented Jul 25, 2024

To minimize friction, consider setting Allow edits from maintainers on the PR, which will enable project committers and automation to update your PR.

@bhshkh
Copy link
Contributor

bhshkh commented Sep 5, 2024

I'm happy to enable Allow edits from maintainers but I can't seem to find the option to select.

Side note: Found the reason. #10824 (comment)

@galenwarren
Copy link
Contributor Author

@bhshkh @jba @codyoss Thanks all.

The only things that still seem to be failing are API checks against other parts of the project, I'm guessing those are due to outdated code in this branch, so I kicked off a merge to main.

What are the next steps, anything I need to do?

@galenwarren
Copy link
Contributor Author

@bhshkh @jba @codyoss What are the next steps here? Thanks.

@bhshkh bhshkh enabled auto-merge (squash) September 27, 2024 22:47
@bhshkh bhshkh added kokoro:force-run Add this label to force Kokoro to re-run the tests. kokoro:run Add this label to force Kokoro to re-run the tests. labels Sep 27, 2024
@kokoro-team kokoro-team removed kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Sep 27, 2024
@bhshkh
Copy link
Contributor

bhshkh commented Sep 27, 2024

Sorry for late response.
Forced kokoro run and enabled auto merge
Will monitor

@bhshkh
Copy link
Contributor

bhshkh commented Sep 27, 2024

Unable to merge. This branch is out-of-date with the base branch

@bhshkh
Copy link
Contributor

bhshkh commented Sep 27, 2024

I'm happy to enable Allow edits from maintainers but I can't seem to find the option to select.

Side note: Found the reason. #10824 (comment)

@galenwarren , can you please recreate this PR from personal fork so that I have permissions to update the branch ?

@galenwarren
Copy link
Contributor Author

@bhshkh I'd really like to avoid recreating the PR if possible. I've invited you to (temporarily) be a collaborator (writer) on the project in my organization, does that get you what you need?

@bhshkh
Copy link
Contributor

bhshkh commented Sep 30, 2024

@bhshkh I'd really like to avoid recreating the PR if possible. I've invited you to (temporarily) be a collaborator (writer) on the project in my organization, does that get you what you need?

Sorry, I can't accept the invite

@galenwarren
Copy link
Contributor Author

galenwarren commented Sep 30, 2024

@bhshkh Do you mean it doesn't work or you're not allowed, by policy or something like that?

EDIT: Also, could I just push the "Update Branch" button for you, to sync to base branch?

@galenwarren
Copy link
Contributor Author

@bhshkh Wasn't sure if you saw my suggestion that I just rebase to main for you?

@bhshkh
Copy link
Contributor

bhshkh commented Oct 1, 2024

I'm not allowed to. Please rebase. I'll actively monitor the PR. Thanks!

auto-merge was automatically disabled October 1, 2024 17:44

Head branch was pushed to by a user without write access

@galenwarren
Copy link
Contributor Author

@bhshkh Understood, thanks. I just rebased to main.

@bhshkh bhshkh enabled auto-merge (squash) October 1, 2024 18:06
@bhshkh bhshkh added kokoro:force-run Add this label to force Kokoro to re-run the tests. kokoro:run Add this label to force Kokoro to re-run the tests. labels Oct 1, 2024
@kokoro-team kokoro-team removed kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Oct 1, 2024
@bhshkh bhshkh merged commit eb25266 into googleapis:main Oct 1, 2024
8 checks passed
@bhshkh
Copy link
Contributor

bhshkh commented Oct 1, 2024

Merged !

@galenwarren
Copy link
Contributor Author

galenwarren commented Oct 1, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: firestore Issues related to the Firestore API. size: s Pull request size is small. stale: extraold Pull request is critically old and needs prioritization.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants