Skip to content
Projects
Groups
Snippets
Help
Sign in / Register
Toggle navigation
Minds Backend - Engine
Project overview
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
264
Merge Requests
27
CI / CD
Security & Compliance
Packages
Wiki
Snippets
Members
Collapse sidebar
Close sidebar
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Backend - Engine
Compare Revisions
32a0308f10f5719287c4118933ee31c18e044668...26263a2fee050dae3460a46801187b2c9d544a47
Source
26263a2fee050dae3460a46801187b2c9d544a47
...
Target
32a0308f10f5719287c4118933ee31c18e044668
Compare
Commits (2)
Onboarding
· 4e803d5c
Marcelo Rivera
authored
12 minutes ago
4e803d5c
Merge branch 'feat/onboarding' into 'master'
· 26263a2f
Mark Harding
authored
12 minutes ago
Onboarding Closes
front#2112
See merge request
!423
26263a2f
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
85 additions
and
9 deletions
+85
-9
Controllers/api/v1/register.php
View file @
26263a2f
...
...
@@ -78,7 +78,7 @@ class register implements Interfaces\Api, Interfaces\ApiIgnorePam
$hasSignupTags
=
false
;
if
(
isset
(
$_COOKIE
[
'mexp'
]))
{
$manager
=
Core\Di\Di
::
_
()
->
get
(
'Experiments\Manager'
);
$bucket
=
$manager
->
getBucketForExperiment
(
'Homepage
2006
19'
);
$bucket
=
$manager
->
getBucketForExperiment
(
'Homepage
1211
19'
);
$user
->
expHomepage200619
=
$bucket
->
getId
();
}
...
...
This diff is collapsed.
Controllers/api/v2/experiments.php
View file @
26263a2f
...
...
@@ -49,6 +49,7 @@ class experiments implements Interfaces\Api
$_COOKIE
[
'mexp'
]
=
$cookieid
;
}
/** @var Core\Experiments\Manager $manager */
$manager
=
Di
::
_
()
->
get
(
'Experiments\Manager'
);
if
(
Core\Session
::
isLoggedIn
())
{
...
...
This diff is collapsed.
Controllers/api/v2/onboarding/progress.php
View file @
26263a2f
...
...
@@ -3,6 +3,7 @@
namespace
Minds\Controllers\api\v2\onboarding
;
use
Minds\Api\Factory
;
use
Minds\Core\Di\Di
;
use
Minds\Core\Onboarding\Manager
;
use
Minds\Core\Session
;
use
Minds\Interfaces
;
...
...
@@ -11,7 +12,7 @@ class progress implements Interfaces\Api
{
/**
* Equivalent to HTTP GET method
* @param
array $pages
* @param array $pages
* @return mixed|null
* @throws \Exception
*/
...
...
@@ -23,11 +24,20 @@ class progress implements Interfaces\Api
$manager
=
new
Manager
();
$manager
->
setUser
(
Session
::
getLoggedInUser
());
/** @var \Minds\Core\Features\Manager $manager */
$manager
=
Di
::
_
()
->
get
(
'Features\Manager'
);
if
(
$manager
->
has
(
'onboarding-december-2019'
))
{
return
Factory
::
response
([
'show_onboarding'
=>
!
$manager
->
wasOnboardingShown
(),
]);
}
$allItems
=
$manager
->
getAllItems
();
$completedItems
=
$manager
->
getCompletedItems
();
return
Factory
::
response
([
'show_onboarding'
=>
!
$manager
->
wasOnboardingShown
()
&&
count
(
$allItems
)
>
count
(
$completedItems
)
,
'show_onboarding'
=>
!
$manager
->
wasOnboardingShown
()
&&
count
(
$allItems
)
>
count
(
$completedItems
),
'all_items'
=>
$allItems
,
'completed_items'
=>
$completedItems
,
'creator_frequency'
=>
$manager
->
getCreatorFrequency
(),
...
...
@@ -36,7 +46,7 @@ class progress implements Interfaces\Api
/**
* Equivalent to HTTP POST method
* @param
array $pages
* @param array $pages
* @return mixed|null
* @throws \Exception
*/
...
...
@@ -47,7 +57,7 @@ class progress implements Interfaces\Api
/**
* Equivalent to HTTP PUT method
* @param
array $pages
* @param array $pages
* @return mixed|null
*/
public
function
put
(
$pages
)
...
...
@@ -57,7 +67,7 @@ class progress implements Interfaces\Api
/**
* Equivalent to HTTP DELETE method
* @param
array $pages
* @param array $pages
* @return mixed|null
*/
public
function
delete
(
$pages
)
...
...
This diff is collapsed.
Core/Experiments/Hypotheses/Homepage121119.php
0 → 100644
View file @
26263a2f
<?php
namespace
Minds\Core\Experiments\Hypotheses
;
use
Minds\Core\Experiments\Bucket
;
class
Homepage121119
implements
HypothesisInterface
{
/**
* Return the id for the hypothesis
* @return string
*/
public
function
getId
()
{
return
"Homepage121119"
;
}
/**
* Return the buckets for the hypothesis
* @return Bucket[]
*/
public
function
getBuckets
()
{
return
[
(
new
Bucket
)
->
setId
(
'base'
)
->
setWeight
(
50
),
(
new
Bucket
)
->
setId
(
'form'
)
->
setWeight
(
50
),
];
}
}
This diff is collapsed.
Core/Experiments/Manager.php
View file @
26263a2f
...
...
@@ -18,6 +18,7 @@ class Manager
private
$experiments
=
[
'Homepage121118'
=>
Hypotheses\Homepage121118
::
class
,
'Homepage200619'
=>
Hypotheses\Homepage200619
::
class
,
'Homepage121119'
=>
Hypotheses\Homepage121119
::
class
,
];
public
function
__construct
(
$sampler
=
null
)
...
...
@@ -49,6 +50,7 @@ class Manager
* Return the bucket for an experiment
* @param string $experimentId
* @return Bucket
* @throws \Exception
*/
public
function
getBucketForExperiment
(
$experimentId
)
{
...
...
This diff is collapsed.
Core/Experiments/Sampler.php
View file @
26263a2f
...
...
@@ -5,6 +5,9 @@
*/
namespace
Minds\Core\Experiments
;
use
Minds\Core\Analytics\User
;
use
Minds\Core\Data\Client
;
use
Minds\Core\Experiments\Hypotheses\HypothesisInterface
;
use
Minds\Interfaces\ModuleInterface
;
use
Minds\Core\Di\Di
;
use
Minds\Core\Data\Cassandra\Prepared
;
...
...
@@ -17,7 +20,7 @@ class Sampler
/** @param User $user */
private
$user
;
/** @param Hyp
those
sInterface $hypothesis */
/** @param Hyp
othesi
sInterface $hypothesis */
private
$hypothesis
;
/** @param array $buckets */
...
...
@@ -43,6 +46,7 @@ class Sampler
* Set the hypothesis to sample
* @param HypothesisInterface $hypothesis
* @return Sampler
* @throws \Exception
*/
public
function
setHypothesis
(
$hypothesis
)
{
...
...
@@ -71,6 +75,7 @@ class Sampler
/**
* Return the bucket for a user
* @return Bucket
* @throws \Exception
*/
public
function
getBucket
()
{
...
...
This diff is collapsed.
Core/Provisioner/Provisioners/cassandra-provision.cql
View file @
26263a2f
...
...
@@ -921,7 +921,7 @@ CREATE TABLE minds.notifications (
CREATE MATERIALIZED VIEW minds.notifications_by_type_group AS
SELECT *
FROM minds.notifications
WHERE to_guid IS NOT NULL
WHERE to_guid IS NOT NULL
AND uuid IS NOT NULL
AND type_group IS NOT NULL
PRIMARY KEY (to_guid, type_group, uuid)
...
...
@@ -1525,6 +1525,28 @@ CREATE TABLE minds.notification_batches (
primary key (user_guid, batch_id)
);
CREATE TABLE minds.experiments (
id text,
bucket text,
key text,
PRIMARY KEY (id, bucket, key)
) WITH CLUSTERING ORDER BY (bucket ASC, key ASC)
AND bloom_filter_fp_chance = 0.01
AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
AND comment = ''
AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold': '32', 'min_threshold': '4'}
AND compression = {'chunk_length_in_kb': '64', 'class': 'org.apache.cassandra.io.compress.LZ4Compressor'}
AND crc_check_chance = 1.0
AND dclocal_read_repair_chance = 0.1
AND default_time_to_live = 0
AND gc_grace_seconds = 864000
AND max_index_interval = 2048
AND memtable_flush_period_in_ms = 0
AND min_index_interval = 128
AND read_repair_chance = 0.0
AND speculative_retry = '99PERCENTILE';
CREATE INDEX experiments_key_idx ON minds.experiments (key);
ALTER TABLE minds.withdrawals ADD (status text, address text, gas varint);
CREATE MATERIALIZED VIEW minds.withdrawals_by_status AS
...
...
This diff is collapsed.
Spec/Core/Experiments/ManagerSpec.php
View file @
26263a2f
...
...
@@ -19,7 +19,7 @@ class ManagerSpec extends ObjectBehavior
public
function
it_should_return_a_list_of_experiments
()
{
$this
->
getExperiments
()
->
shouldHaveCount
(
2
);
$this
->
getExperiments
()
->
shouldHaveCount
(
3
);
}
public
function
it_should_return_bucket_for_experiment
(
...
...
This diff is collapsed.
settings.example.php
View file @
26263a2f
...
...
@@ -483,6 +483,9 @@ $CONFIG->set('features', [
'pro'
=>
false
,
'webtorrent'
=>
false
,
'top-feeds-by-age'
=>
true
,
'homepage-december-2019'
=>
true
,
'onboarding-december-2019'
=>
true
,
'register_pages-december-2019'
=>
true
,
]);
$CONFIG
->
set
(
'email'
,
[
...
...
This diff is collapsed.