-
Notifications
You must be signed in to change notification settings - Fork 14
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
CMS 5 compatability #46
CMS 5 compatability #46
Conversation
12f61fc
to
1f0a0ef
Compare
"installer-name": "silverstripe-dynamodb", | ||
"branch-alias": { | ||
"dev-master": "4.0.x-dev" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed branch alias as a matter of course.
Removed installer-name
because it wasn't actually working anyway and is non-standard to ss modules.
a46acd2
to
a01bb1e
Compare
// cache credentials when IAM fetches the credentials from EC2 metadata service | ||
// this will use doctrine/cache (included via composer) to do the actual caching into APCu | ||
// http://docs.aws.amazon.com/aws-sdk-php/guide/latest/performance.html#cache-instance-profile-credentials | ||
$dynamoOptions['credentials'] = new DoctrineCacheAdapter(new ApcuCache()); | ||
$dynamoOptions['credentials'] = CredentialProvider::defaultProvider(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doctrine/cache is deprecated - this is from their readme:
This library is deprecated and will no longer receive bug fixes from the Doctrine Project. Please use a different cache library, preferably PSR-6 or PSR-16 instead.
The default credential provider is memoised, which is a fancy way of saying it caches the credentials after finding them.
AWS_REGION_NAME=us-east-1 | ||
AWS_REGION_NAME=ap-southeast-2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to use the same example as above
@@ -1,43 +1,40 @@ | |||
{ | |||
"name": "silverstripe/dynamodb", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All lines were touched because I replaced tabs with spaces. May be easier to look through each commit to see what changed here and why.
Environment::setEnv('AWS_DYNAMODB_SESSION_TABLE', $origValue); | ||
} | ||
|
||
public function testGetReturnsSessionWhenConfigured() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added this because the other test could be satisfied by simply always returning null - which is obviously not correct.
a01bb1e
to
3fe1a54
Compare
Also removed a bunch of unnecessary exclusions.
cc7a706
to
2a3c93f
Compare
[![Build Status](https://travis-ci.org/silverstripe/silverstripe-dynamodb.svg?branch=master)](https://travis-ci.org/silverstripe/silverstripe-dynamodb) | ||
[![CI](https://github.com/silverstripe/silverstripe-dynamodb/actions/workflows/ci.yml/badge.svg)](https://github.com/silverstripe/silverstripe-dynamodb/actions/workflows/ci.yml) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this is wrong in the preview because currently there is no github actions in this repo. It'll fix itself after this PR is merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally, it works.
I'll provide a follow up PR to improve docs / CI a little more
Tagged as 5.0.0-beta1 |
Note there aren't really any useful tests in this module but that's out of scope for this PR. I've created a separate card for that concern: #47
For now, manually test this with a local dynamodb install (or docker image) and use the AWS CLI to confirm that the sessions table gets updated as expected.
Don't squash
Each commit here is its own concern (albeit related to the overall purpose of making this module CMS 5 compatible) - we should keep the commit history readable by keeping all of these commits.
CI Run
Because this is the first time github actions are being added to this module, they won't run on this PR (because they're not in the default branch yet).
See the CI run on creative-commoners.
AFTER MERGING
After you merge this, create a new
5.0
branch off the5
branch, and tag5.0.0-beta1
!Parent issue