Skip to content

Next

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Support
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
Minds Backend - Engine
Minds Backend - Engine
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
    • Insights
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
    • Locked Files
  • Issues 219
    • Issues 219
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 30
    • Merge Requests 30
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Packages
    • Packages
    • List
    • Container Registry
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Minds
  • Minds Backend - EngineMinds Backend - Engine
  • Merge Requests
  • !285

Open
Opened 3 weeks ago by Guy Thouret@gthouret
  • Report abuse
Report abuse

Reward Factors for User Activity

Edited 1 week ago by Guy Thouret

Check out, review, and merge locally

Step 1. Fetch and check out the branch for this merge request

git fetch origin
git checkout -b feat/588-state-on-user origin/feat/588-state-on-user

Step 2. Review the changes locally

Step 3. Merge the branch and fix any conflicts that come up

git fetch origin
git checkout origin/master
git merge --no-ff feat/588-state-on-user

Step 4. Push the result of the merge to GitLab

git push origin master

Note that pushing to GitLab requires write access to this repository.

Tip: You can also checkout merge requests locally by following these guidelines.

Request to merge feat/588-state-on-user into master
The source branch is 77 commits behind the target branch
Open in Web IDE
  • Email patches
  • Plain diff
Pipeline #75121292 passed for fba7d4e7 on feat/588-state-on-user
          Requires 2 more approvals from Devs and Deployers.
          Brian Hatchet
          Brian Hatchet
          Martin Santangelo
          Martin Santangelo
          Mark Harding
          Mark Harding
          Emiliano Balbuena
          Emiliano Balbuena
          Ben Hayward
          Ben Hayward
          There are merge conflicts. Resolve these conflicts or ask someone with write access to this repository to merge it locally
          You can merge this merge request manually using the
          • Discussion 4
          • Commits 32
          • Pipelines 11
          • Changes 28
          0/3 threads resolved
          • Loading...
          • Guy Thouret @gthouret changed milestone to %sprint: Jolly Jellyfish 3 weeks ago

            changed milestone to %sprint: Jolly Jellyfish

          • Guy Thouret @gthouret added MR::Awaiting Review Priority::2 - Normal Product::Wallet Squad::Blue Type::Feature scoped labels 3 weeks ago

            added MR::Awaiting Review Priority::2 - Normal Product::Wallet Squad::Blue Type::Feature scoped labels

          • Guy Thouret @gthouret added 2 commits 3 weeks ago

            added 2 commits

            • 8d2051bc - (fix) Update UserStates Manager test with reward factor fields - #589
            • 42e5591b - (feat) Add state change value to UserState object - #588

            Compare with previous version

          • Guy Thouret @gthouret added 1 commit 3 weeks ago

            added 1 commit

            • 59e50c27 - (feat) Split state change view to separate views for increasing and decreasing user state - #589

            Compare with previous version

          • Guy Thouret @gthouret added 6 commits 3 weeks ago

            added 6 commits

            • 01b11f8d - (fix) Rewards\Contributions: Fix typo in word contribution - #587
            • c036456b - (fix) Spec bootstrap should load configs (prevents errors connecting to Redis and MQ in dev) - #587
            • d0425dd2 - (chore) Add missing help descriptions to rewards cli controller - #587
            • 444c6081 - (feat) Add missing type hints in Contributions Manager - #588
            • f150613d - (feat) Add action types help text and dry run warning to rewards cli - #587
            • 18084897 - (feat) Apply the user state reward multiplier to contribution scores - #587

            Compare with previous version

            Toggle commit list
          • Guy Thouret @gthouret added 3 commits 2 weeks ago

            added 3 commits

            • 00beca90 - (fix) Fix expected value in Rewards Manager Spec test
            • 9c166d03 - (chore) Add missing command help and dry run option to contributions cli - #587
            • 3b80c207 - (feat) Add decimal score value to contributions table - #587

            Compare with previous version

          • Guy Thouret @gthouret added 2 commits 2 weeks ago

            added 2 commits

            • c11424f2 - (fix) Record null value for old contributions score by omitting from INSERT query - #587
            • d7f0d443 - (feat) Add current reward factor to contributions api - #661 (closed)

            Compare with previous version

          • Guy Thouret @gthouret added 3 commits 2 weeks ago

            added 3 commits

            • 167c20ef - (fix) Notification view for user state should be plural rewards_* - #589
            • d8348319 - (fix) Divide by zero error Contributions\DailyCollection - #587
            • 6a760f03 - (fix) Send a notification when a user is rewarded with tokens for contributions - #636

            Compare with previous version

          • Guy Thouret @gthouret added 1 commit 1 week ago

            added 1 commit

            • fba7d4e7 - (fix) Test regression in UpdateUserState delegate - #588

            Compare with previous version

          • Guy Thouret @gthouret unmarked as a Work In Progress 1 week ago

            unmarked as a Work In Progress

          • Guy Thouret
            Guy Thouret @gthouret · 5 days ago
            Developer

            NOTE: Requires schema changes to minds.contributions:

            ALTER TABLE minds.contributions ADD score_decimal decimal;
            DROP MATERIALIZED VIEW minds.contributions_by_timestamp;
            CREATE MATERIALIZED VIEW minds.contributions_by_timestamp AS
                SELECT timestamp, user_guid, metric, amount, score, score_decimal
                FROM minds.contributions
                WHERE user_guid IS NOT NULL AND timestamp IS NOT NULL AND metric IS NOT NULL AND amount IS NOT NULL
                PRIMARY KEY (timestamp, user_guid, metric)
                WITH CLUSTERING ORDER BY (user_guid ASC, metric ASC);
          • Mark Harding
            Mark Harding @markeharding started a thread on the diff 11 minutes ago
            Core/Analytics/UserStates/RewardFactor.php
            1 <?php
            2
            3 namespace Minds\Core\Analytics\UserStates;
            4
            5 class RewardFactor
            6 {
            7 static $values = [
            8 UserState::STATE_CASUAL => 1.5,
            9 UserState::STATE_COLD => 0.5,
            10 UserState::STATE_CORE => 0.5,
            11 UserState::STATE_CURIOUS => 1,
            12 UserState::STATE_NEW => 2,
            13 UserState::STATE_RESURRECTED => 1.5,
            14 UserState::STATE_UNKNOWN => 1
            • Mark Harding
              Mark Harding @markeharding · 11 minutes ago
              Owner

              Some new multipliers to use

              UserState::STATE_CASUAL => 1.10, // 10% credit
              UserState::STATE_COLD => 0.5, // 50% of normal
              UserState::STATE_CORE => 1.25, // 25% credit
              UserState::STATE_CURIOUS => 1, // normal
              UserState::STATE_NEW => 1.25, // 25% credit
              UserState::STATE_RESURRECTED => 1.25, // 25% credit
              UserState::STATE_UNKNOWN => 1
              
            • Please register or sign in to reply
          • Mark Harding
            Mark Harding @markeharding started a thread on the diff 11 minutes ago
            Core/Analytics/UserStates/UserActivityBuckets.php
            18 * @method int getReferenceDateMs()
            19 * @ignore UserActivityBuckets setDaysActiveBuckets(array $daysActiveBuckets)
            20 * @method array getDaysActiveBuckets()
            21 * @method UserActivityBuckets setNumberOfDays(int $numberOfDays)
            22 * @method int getNumberOfDays()
            23 * @method UserActivityBuckets setMostRecentDaysCount(int $mostRecentDaysCount)
            24 * @method int getMostRecentDaysCount()
            25 * @method UserActivityBuckets setOldestDaysCount(int $oldestDaysCount)
            26 * @method int getOldestDaysCount()
            27 * @method UserActivityBuckets setActivityPercentage(int $activityPercentage)
            28 */
            11 29 class UserActivityBuckets
            12 30 {
            13 31 use MagicAttributes;
            14 32
            15 const STATE_CASUAL = 'casual';
            • Mark Harding
              Mark Harding @markeharding · 11 minutes ago
              Owner

              Are these constants not used?

            • Please register or sign in to reply
          • Mark Harding
            Mark Harding @markeharding started a thread on the diff 10 minutes ago
            Core/Notification/Events.php
            93 93 $notification
            94 94 ]);
            95 95
            96 });
            96 });
            • Mark Harding
              Mark Harding @markeharding · 10 minutes ago
              Owner

              any reason for this change?

            • Please register or sign in to reply
          • You're only seeing other activity in the feed. To add a comment, switch to one of the following options.
          Please register or sign in to reply
          0 Assignees
          None
          Assign to
          sprint: Jolly Jellyfish
          Milestone
          sprint: Jolly Jellyfish
          Assign milestone
          None
          Time tracking
          No estimate or time spent
          5
          Labels
          MR::Awaiting Review Priority::2 - Normal Product::Wallet Squad::Blue Type::Feature
          Assign labels
          • View project labels
          Lock merge request
          Unlocked
          8
          8 participants
          user avatar
          Brian Hatchet
          user avatar
          Martin Santangelo
          user avatar
          Mark Harding
          user avatar
          Emiliano Balbuena
          user avatar
          Ben Hayward
          user avatar
          Rami Albatal
          user avatar
          Marcelo Rivera
          Reference: minds/engine!285