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

GODRIVER-2962 Remove setters from AbortTransaction and CommitTransaction. #1363

Conversation

matthewdale
Copy link
Collaborator

GODRIVER-2962

Summary

Remove setters from AbortTransaction and CommitTransaction.

Background & Motivation

The field setters on the operation types in the x/mongo/driver/operation package provide no usability improvement but create a maintenance burden whenever we have to update the operations. Remove the field setters and use struct literals instead.

Split the change into multiple PRs to make reviewing them easier.

@matthewdale matthewdale requested a review from a team as a code owner August 28, 2023 22:54
@matthewdale matthewdale requested review from blink1073 and removed request for a team August 28, 2023 22:54
@matthewdale matthewdale temporarily deployed to api-report August 28, 2023 22:54 — with GitHub Actions Inactive
@matthewdale matthewdale force-pushed the godriver2962-remove-op-setters-1 branch from 853c561 to 8305771 Compare August 28, 2023 23:41
@github-actions
Copy link

API Change Report

./x/mongo/driver/operation

incompatible changes

(*AbortTransaction).ClusterClock: removed
(*AbortTransaction).Collection: removed
(*AbortTransaction).CommandMonitor: removed
(*AbortTransaction).Crypt: removed
(*AbortTransaction).Database: removed
(*AbortTransaction).Deployment: removed
(*AbortTransaction).RecoveryToken: removed
(*AbortTransaction).Retry: removed
(*AbortTransaction).ServerAPI: removed
(*AbortTransaction).ServerSelector: removed
(*AbortTransaction).Session: removed
(*AbortTransaction).WriteConcern: removed
(*CommitTransaction).ClusterClock: removed
(*CommitTransaction).CommandMonitor: removed
(*CommitTransaction).Crypt: removed
(*CommitTransaction).Database: removed
(*CommitTransaction).Deployment: removed
(*CommitTransaction).MaxTime: removed
(*CommitTransaction).RecoveryToken: removed
(*CommitTransaction).Retry: removed
(*CommitTransaction).ServerAPI: removed
(*CommitTransaction).ServerSelector: removed
(*CommitTransaction).Session: removed
(*CommitTransaction).WriteConcern: removed
NewAbortTransaction: removed
NewCommitTransaction: removed

compatible changes

AbortTransaction.Clock: added
AbortTransaction.Crypt: added
AbortTransaction.Deployment: added
AbortTransaction.Monitor: added
AbortTransaction.RecoveryToken: added
AbortTransaction.Retry: added
AbortTransaction.Selector: added
AbortTransaction.ServerAPI: added
AbortTransaction.Session: added
AbortTransaction.WriteConcern: added
CommitTransaction.Clock: added
CommitTransaction.Crypt: added
CommitTransaction.Deployment: added
CommitTransaction.MaxTime: added
CommitTransaction.Monitor: added
CommitTransaction.RecoveryToken: added
CommitTransaction.Retry: added
CommitTransaction.Selector: added
CommitTransaction.ServerAPI: added
CommitTransaction.Session: added
CommitTransaction.WriteConcern: added

blink1073
blink1073 previously approved these changes Sep 5, 2023
Copy link
Member

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

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

LGTM!

@prestonvasquez prestonvasquez changed the base branch from master to v1 September 13, 2023 18:04
@matthewdale matthewdale changed the base branch from v1 to master September 20, 2023 04:35
@matthewdale matthewdale dismissed blink1073’s stale review September 20, 2023 04:35

The base branch was changed.

@blink1073
Copy link
Member

Should this also be on the 2.0 epic?

@matthewdale
Copy link
Collaborator Author

Not sure what's going on with the tests, but this isn't important to complete right now. I'm closing this for now, will revisit later.

@matthewdale
Copy link
Collaborator Author

Should this also be on the 2.0 epic?

@blink1073 No, these can go in any release because they're unstable API. I switched them to master because I didn't think the code improvement was worth the additional overhead of syncing between branches. I actually closed this PR because I'm not going to get back to it soon and I didn't want to keep it open for a long time.

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