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 Firestore session handler. #2258

Merged
merged 20 commits into from
Sep 24, 2019
Merged

Conversation

bshaffer
Copy link
Contributor

No description provided.

@bshaffer bshaffer requested a review from jdpedrie as a code owner August 20, 2019 23:02
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Aug 20, 2019
@codecov
Copy link

codecov bot commented Aug 20, 2019

Codecov Report

Merging #2258 into master will decrease coverage by 0.07%.
The diff coverage is 97.52%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2258      +/-   ##
============================================
- Coverage      92.6%   92.53%   -0.08%     
- Complexity     4467     4501      +34     
============================================
  Files           307      312       +5     
  Lines         13323    13479     +156     
============================================
+ Hits          12338    12473     +135     
- Misses          985     1006      +21
Impacted Files Coverage Δ Complexity Δ
Firestore/src/Query.php 99.2% <ø> (ø) 86 <0> (ø) ⬇️
Firestore/src/FirestoreClient.php 100% <100%> (ø) 21 <1> (+1) ⬆️
Firestore/src/FirestoreSessionHandler.php 97.36% <97.36%> (ø) 21 <21> (?)
Core/src/Logger/AppEngineFlexHandler.php 0% <0%> (-83.34%) 3% <0%> (ø)
Core/src/Logger/AppEngineFlexFormatter.php 0% <0%> (-77.78%) 2% <0%> (-1%)
BigQuery/src/ExtractJobConfiguration.php 100% <0%> (ø) 8% <0%> (+1%) ⬆️
Spanner/src/Transaction.php 100% <0%> (ø) 24% <0%> (ø) ⬇️
BigQuery/src/LoadJobConfiguration.php 100% <0%> (ø) 24% <0%> (+1%) ⬆️
Core/src/Logger/FormatterTrait.php 100% <0%> (ø) 2% <0%> (?)
Core/src/Logger/AppEngineFlexHandlerV2.php 100% <0%> (ø) 3% <0%> (?)
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 92a5dd0...da89a0a. Read the comment docs.

Firestore/src/FirestoreSessionHandler.php Outdated Show resolved Hide resolved
Firestore/src/FirestoreSessionHandler.php Outdated Show resolved Hide resolved
Firestore/src/FirestoreSessionHandler.php Outdated Show resolved Hide resolved
@jdpedrie jdpedrie changed the title Adds Firestore session handler feat: Add Firestore session handler Aug 21, 2019
@jdpedrie jdpedrie changed the title feat: Add Firestore session handler feat: Add Firestore session handler. Aug 21, 2019
Firestore/src/FirestoreSessionHandler.php Outdated Show resolved Hide resolved
@jdpedrie jdpedrie force-pushed the firestore-session-handler branch from 5bd5dba to 9166018 Compare August 28, 2019 17:24
@googlebot
Copy link

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: no This human has *not* signed the Contributor License Agreement. and removed cla: yes This human has signed the Contributor License Agreement. labels Aug 28, 2019
@dwsupplee dwsupplee added cla: yes This human has signed the Contributor License Agreement. and removed cla: no This human has *not* signed the Contributor License Agreement. labels Aug 28, 2019
@googlebot
Copy link

A Googler has manually verified that the CLAs look good.

(Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.)

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: no This human has *not* signed the Contributor License Agreement. and removed cla: yes This human has signed the Contributor License Agreement. labels Aug 28, 2019
@jdpedrie
Copy link
Contributor

@bshaffer I added some snippet and system tests to this based off the work I merged in #2266, and rebased against latest master. I have my work off on my fork as well, so if I have broken your intent in any way, feel free to force push again. ;)

@dwsupplee dwsupplee added cla: yes This human has signed the Contributor License Agreement. and removed cla: no This human has *not* signed the Contributor License Agreement. labels Aug 28, 2019
@googlebot
Copy link

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@googlebot googlebot removed the cla: yes This human has signed the Contributor License Agreement. label Aug 28, 2019
Copy link
Contributor

@jdpedrie jdpedrie left a comment

Choose a reason for hiding this comment

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

looks good! stoked you solved the transaction problem. :)

Firestore/src/FirestoreSessionHandler.php Outdated Show resolved Hide resolved
Firestore/src/FirestoreSessionHandler.php Outdated Show resolved Hide resolved
Firestore/src/FirestoreSessionHandler.php Outdated Show resolved Hide resolved
Firestore/src/FirestoreSessionHandler.php Outdated Show resolved Hide resolved
Firestore/src/FirestoreSessionHandler.php Outdated Show resolved Hide resolved
Firestore/src/FirestoreSessionHandler.php Show resolved Hide resolved
Copy link
Contributor

@jdpedrie jdpedrie left a comment

Choose a reason for hiding this comment

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

surface lgtm. couple minor test suggestions.

@bshaffer
Copy link
Contributor Author

When I used $this instead of $phpunit, the tests fail with method not found exceptions. Looks like $this is being assigned to the Connection class, so the phpunit methods are not available in that context.

@jdpedrie
Copy link
Contributor

so the phpunit methods are not available in that context.

Apologies for steering you wrong!

Copy link
Contributor

@dwsupplee dwsupplee left a comment

Choose a reason for hiding this comment

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

One small question, outside of that looks great :)

$this->sessionName = $sessionName;
$database = $this->databaseName($this->projectId, $this->database);

$beginTransaction = $this->connection->beginTransaction([
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we wrap this in a try/catch block as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we do this, open will return false instead of throwing an exception if it fails. This seems consistent and correct to me.

@dwsupplee dwsupplee added cla: yes This human has signed the Contributor License Agreement. and removed cla: no This human has *not* signed the Contributor License Agreement. labels Sep 24, 2019
@googlebot
Copy link

A Googler has manually verified that the CLAs look good.

(Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.)

ℹ️ Googlers: Go here for more info.

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. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants