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 225
    • Issues 225
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 33
    • Merge Requests 33
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Security & Compliance
    • Security & Compliance
    • Dependency List
  • 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 2 months ago by Guy Thouret@gthouret
  • Report abuse
Report abuse

Reward Factors for User Activity

Edited 2 months 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
Open in Web IDE
  • Email patches
  • Plain diff
Pipeline #87584390 passed for 6ac138db on feat/588-state-on-user
          Requires 2 more approvals from Devs and Deployers.
          Rami Albatal
          Rami Albatal
          Mark Harding
          Mark Harding
          Marcelo Rivera
          Marcelo Rivera
          Emiliano Balbuena
          Emiliano Balbuena
          Martin Santangelo
          Martin Santangelo
          Ready to be merged automatically. Ask someone with write access to this repository to merge this request

          Closes #810 (closed)

          • Discussion 12
          • Commits 71
          • Pipelines 35
          • Changes 104
          3/5 threads resolved
          • Loading...
          • Guy Thouret @gthouret changed milestone to %"sprint: Jolly Jellyfish" 2 months 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 2 months ago

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

          • Guy Thouret @gthouret added 2 commits 2 months ago

            added 2 commits

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

            Compare with previous version

          • Guy Thouret @gthouret added 1 commit 2 months ago

            added 1 commit

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

            Compare with previous version

          • Guy Thouret @gthouret added 6 commits 2 months ago

            added 6 commits

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

            Compare with previous version

            Toggle commit list
          • Guy Thouret @gthouret added 3 commits 2 months 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 (closed)
            • 3b80c207 - (feat) Add decimal score value to contributions table - #587 (closed)

            Compare with previous version

          • Guy Thouret @gthouret added 2 commits 2 months ago

            added 2 commits

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

            Compare with previous version

          • Guy Thouret @gthouret added 3 commits 2 months ago

            added 3 commits

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

            Compare with previous version

          • Guy Thouret @gthouret added 1 commit 2 months ago

            added 1 commit

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

            Compare with previous version

          • Guy Thouret @gthouret unmarked as a Work In Progress 2 months ago

            unmarked as a Work In Progress

          • Guy Thouret
            Guy Thouret @gthouret · 1 month 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 1 month ago
            Resolved by Guy Thouret 1 month ago
          • Mark Harding
            Mark Harding @markeharding started a thread on the diff 1 month ago
            Resolved by Guy Thouret 1 month ago
          • Mark Harding
            Mark Harding @markeharding started a thread on an old version of the diff 1 month ago
            Resolved by Guy Thouret 1 month ago
          • Guy Thouret @gthouret added 1 commit 1 month ago

            added 1 commit

            • 2d9337ef - (chore) Convert a rogue tab in whitespace to spaces

            Compare with previous version

          • Guy Thouret @gthouret resolved all threads 1 month ago

            resolved all threads

          • Guy Thouret @gthouret added 1 commit 1 month ago

            added 1 commit

            • 9268f852 - (chore) Update failing UserStates ManagerSpec with new reward factor value - #588 (closed)

            Compare with previous version

          • Mark Harding @markeharding approved this merge request 1 month ago

            approved this merge request

          • Guy Thouret @gthouret added 34 commits 1 month ago

            added 34 commits

            • 9268f852...d684846f - 32 commits from branch master
            • cc1b2a2d - (chore) Result of linting branch before merge - #588 (closed)
            • 6458b943 - (chore) Merge linted master to branch - #588 (closed)

            Compare with previous version

          • Guy Thouret @gthouret added 1 commit 1 month ago

            added 1 commit

            • 8df0dac5 - (chore) More lints that got mised from last commit - #588 (closed)

            Compare with previous version

          • Guy Thouret @gthouret added 1 commit 1 month ago

            added 1 commit

            • 87e2f5b3 - (chore) Fix test regression after linting - #588 (closed)

            Compare with previous version

          • Guy Thouret @gthouret added 1 commit 1 month ago

            added 1 commit

            • 0e8d8b00 - (fix) Previously fixed typo made it back into branch - #588 (closed)

            Compare with previous version

          • Guy Thouret @gthouret added 2 commits 4 weeks ago

            added 2 commits

            • 634f63e5 - (chore) Refactor ActiveUsersIterator to extract the query builder from the...
            • 0628b4d2 - (feat) Allow for 'incremental' running of the syncUsers analytics cli to emit...

            Compare with previous version

          • Guy Thouret @gthouret added 3 commits 3 weeks ago

            added 3 commits

            • 9252c893 - (chore) Fix up broken test and add test for the active users query builder - #590 (closed)
            • 163b8a2f - (chore) Remove debug code from UpdateUserStateEstimate and simplify notification logic - #590 (closed)
            • 343a3648 - (chore) Spacing in ActiveUsersIterator - #590 (closed)

            Compare with previous version

          • Guy Thouret @gthouret added 1 commit 3 weeks ago

            added 1 commit

            • 12ec947c - (chore) Linting recent changes - #590 (closed)

            Compare with previous version

          • Guy Thouret @gthouret added 1 commit 3 weeks ago

            added 1 commit

            • 1fbb590f - (feat) Add reward factors to v1/blockchain/contributions API endpoint - Fixes #810 (closed)

            Compare with previous version

          • Guy Thouret @gthouret added 1 commit 3 weeks ago

            added 1 commit

            • 96748a37 - (feat) Return reward factors as objects in v1/blockchain/contributions API endpoint - #810 (closed)

            Compare with previous version

          • Guy Thouret @gthouret added 1 commit 3 weeks ago

            added 1 commit

            • af3c0bce - (fix) ActiveUsersQueryBuilder Spec test is only successful with a specific base time - #590 (closed)

            Compare with previous version

          • Guy Thouret @gthouret added 10 commits 3 weeks ago

            added 10 commits

            • af3c0bce...14f32dc5 - 9 commits from branch master
            • e491df61 - Merge branch 'master' into feat/588-state-on-user

            Compare with previous version

          • Guy Thouret @gthouret added 23 commits 3 weeks ago

            added 23 commits

            • e491df61...91c223dc - 22 commits from branch master
            • 348c3a46 - Merge branch 'master' into feat/588-state-on-user

            Compare with previous version

          • Guy Thouret @gthouret added 8 commits 2 weeks ago

            added 8 commits

            • 4cdd24ee - (feat) Simplify UserActivityBuckets - transition detection to cold is not...
            • 362df68b - (fix) userActivity data is now sorted by date to guarantee correct ordering - #841 (closed)
            • 46251ea2 - (fix) UserStates - Only allow update of previousState back to ES if it is not empty - #841 (closed)
            • 9825278b - (feat) Add debug option and fakeactivity command to analyics cli - #841 (closed)
            • e4159346 - (feat) Add setTimestamp to Event for generating fake activity in the past - #841 (closed)
            • 1bc69e5d - (fix) Record actual update time in UpdateUserState delegates - #841 (closed)
            • 41149a48 - (feat) Simplify the ActiveUser and UserState Iterators; Use more meaningful...
            • 01222a57 - (fix) Allow UserState export to exclude fields with null values to prevent...

            Compare with previous version

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

            added 3 commits

            • 46a3081d - (fix) Create correct 'active' fake data in analytics cli - #841 (closed)
            • ed9109ca - (fix) Regression - ActiveUsers query should have 200 partitions - #841 (closed)
            • 00ffa02e - (fix) Fix all tests for most recent changes to ActiveUsers and UserStates Iterators - #841 (closed)

            Compare with previous version

          • Guy Thouret @gthouret added 1 commit 2 weeks ago

            added 1 commit

            • 168ca91b - (fix) Regression in UpdateUserStateSpec - #841 (closed)

            Compare with previous version

          • Guy Thouret @gthouret added 11 commits 2 weeks ago

            added 11 commits

            • 168ca91b...72c7048d - 9 commits from branch master
            • b6aab277 - (feat) Modify analytics cli and active action event so that activity days...
            • 0770cf69 - Merge branch 'master' into feat/588-state-on-user

            Compare with previous version

          • Guy Thouret @gthouret added 1 commit 2 weeks ago

            added 1 commit

            • 142841ae - (fix) action property of analytics event is not always present

            Compare with previous version

          • Guy Thouret
            Guy Thouret @gthouret · 2 weeks ago
            Developer

            QA was carried out on the review site, testing procedure and outputs for achieving all user states are in #841 (closed).

          • Guy Thouret
            Guy Thouret @gthouret · 2 weeks ago
            Developer

            Transitions are generating the required notifications with the exception of reward_state_decline_today which should not be telling people that they are declining into resurrected.

          • Guy Thouret @gthouret added 1 commit 2 weeks ago

            added 1 commit

            • c6d2641f - (feat) Ignore certain state changes when sending user notifications

            Compare with previous version

          • Guy Thouret @gthouret added 1 commit 2 weeks ago

            added 1 commit

            • a88597d7 - (fix) Update spec test for UpdateUserState delegate as state it used does not...

            Compare with previous version

          • Mark Harding @markeharding added 41 commits 1 hour ago

            added 41 commits

            • a88597d7...416076ce - 40 commits from branch master
            • 2684cdb5 - Merge branch 'master' of gitlab.com:minds/engine into feat/588-state-on-user

            Compare with previous version

          • Mark Harding @markeharding added 1 commit 1 hour ago

            added 1 commit

            • 6ac138db - (fix): decimal needs wrapping

            Compare with previous version

          • Mark Harding
            Mark Harding @markeharding started a thread on the diff 58 minutes ago
            Core/Rewards/Contributions/Sums.php
            76 76 $query = new Custom();
            77 77
            78 78 if ($this->user) {
            79 $query->query("SELECT SUM(score) as score from contributions WHERE user_guid = ?
            79 $query->query("SELECT SUM(score_decimal) as score from contributions WHERE user_guid = ?
            • Mark Harding
              Mark Harding @markeharding · 58 minutes ago
              Owner

              We still need to be able to read the sums from score for the failover.

            • Please register or sign in to reply
          • Mark Harding
            Mark Harding @markeharding started a thread on the diff 58 minutes ago
            Core/Rewards/Contributions/Sums.php
            76 76 $query = new Custom();
            77 77
            78 78 if ($this->user) {
            79 $query->query("SELECT SUM(score) as score from contributions WHERE user_guid = ?
            79 $query->query("SELECT SUM(score_decimal) as score from contributions WHERE user_guid = ?
            80 80 AND timestamp = ?",
            81 81 [
            82 82 new Varint((int) $this->user->guid),
            83 83 new Timestamp($this->timestamp / 1000)
            84 84 ]);
            85 85 } else {
            86 $query->query("SELECT SUM(score) as score from contributions_by_timestamp WHERE timestamp = ?",
            86 $query->query("SELECT SUM(score_decimal) as score from contributions_by_timestamp WHERE timestamp = ?",
            • Mark Harding
              Mark Harding @markeharding · 58 minutes ago
              Owner

              here also

            • Please register or sign in to reply
          • Mark Harding @markeharding added MR::Requires Changes scoped label and automatically removed MR::Awaiting Review label 58 minutes ago

            added MR::Requires Changes scoped label and automatically removed MR::Awaiting Review label

          • 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
          (07/17) Jolly Jellyfish
          Milestone
          (07/17) Jolly Jellyfish
          Assign milestone
          None
          Time tracking
          No estimate or time spent
          5
          Labels
          MR::Requires Changes Priority::2 - Normal Product::Wallet Squad::Blue Type::Feature
          Assign labels
          • View project labels
          Lock merge request
          Unlocked
          8
          8 participants
          user avatar
          Rami Albatal
          user avatar
          Mark Harding
          user avatar
          Marcelo Rivera
          user avatar
          Emiliano Balbuena
          user avatar
          Martin Santangelo
          user avatar
          Brian Hatchet
          user avatar
          Ben Hayward
          Reference: minds/engine!285