Skip to content

Next

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
Minds Backend - Engine
Minds Backend - Engine
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Dependency List
    • Cycle Analytics
    • Insights
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
    • Locked Files
  • Issues 176
    • Issues 176
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 38
    • Merge Requests 38
  • 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
  • !235

Open
Opened 3 weeks ago by Emiliano Balbuena@edgebal
  • Report abuse
Report abuse

WIP: Boost Campaigns (&24)

Check out, review, and merge locally

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

git fetch origin
git checkout -b goal/boost-campaigns-e24 origin/goal/boost-campaigns-e24

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 goal/boost-campaigns-e24

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 goal/boost-campaigns-e24 into master
The source branch is 18 commits behind the target branch
Open in Web IDE
  • Email patches
  • Plain diff
Pipeline #72539963 passed for 6dead061 on goal/boost-campaigns-e24
          Requires 2 more approvals from Devs.
          Martin Santangelo
          Martin Santangelo
          Rami Albatal
          Rami Albatal
          Mark Harding
          Mark Harding
          Brian Hatchet
          Brian Hatchet
          Marcelo Rivera
          Marcelo Rivera
          This is a Work in Progress

          Deletes source branch

          You can merge this merge request manually using the
          • Discussion 8
          • Commits 74
          • Pipelines 44
          • Changes 50
          0/5 threads resolved
          • Loading...
          • Emiliano Balbuena @edgebal mentioned in merge request !207 (closed) 3 weeks ago

            mentioned in merge request !207 (closed)

          • Emiliano Balbuena @edgebal added MR::Awaiting Review scoped label 3 weeks ago

            added MR::Awaiting Review scoped label

          • Emiliano Balbuena @edgebal added 1 commit 3 weeks ago

            added 1 commit

            • d587d4cf - (wip)(refactor): Campaigns should use their own ES index and cql table

            Compare with previous version

          • Emiliano Balbuena @edgebal added 1 commit 3 weeks ago

            added 1 commit

            • 99168bdd - (chore): Lifecycle tweaks

            Compare with previous version

          • Emiliano Balbuena @edgebal added 16 commits 2 weeks ago

            added 16 commits

            • 99168bdd...1674767b - 15 commits from branch master
            • fdfd433c - Merge remote-tracking branch 'upstream/master' into goal/boost-campaigns-e24

            Compare with previous version

          • Emiliano Balbuena @edgebal added 1 commit 2 weeks ago

            added 1 commit

            • a95f6094 - (chore): Revert Network Boost changes

            Compare with previous version

          • Emiliano Balbuena @edgebal added 1 commit 2 weeks ago

            added 1 commit

            • 797d592d - (chore): Revert root Boost Repository

            Compare with previous version

          • Marcelo Rivera @eiennohi added 3 commits 2 weeks ago

            added 3 commits

            • 186b42e9 - (feat): queue runner for completing boosts
            • ee60ae69 - (feat): boost campaigns iterator
            • 5cd99f03 - (feat): BoostCampaigns starter CLI

            Compare with previous version

          • Emiliano Balbuena @edgebal added 1 commit 2 weeks ago

            added 1 commit

            • eaacfe65 - (wip): Payments

            Compare with previous version

          • Emiliano Balbuena @edgebal added 1 commit 2 weeks ago

            added 1 commit

            • f9ea874b - (wip)(refactor): Payments

            Compare with previous version

          • Emiliano Balbuena @edgebal added 1 commit 2 weeks ago

            added 1 commit

            • 68a973d9 - (test): Fix blockchain spec tests

            Compare with previous version

          • Emiliano Balbuena @edgebal added 1 commit 2 weeks ago

            added 1 commit

            • 41ae7d2a - (wip): Onchain payments

            Compare with previous version

          • Emiliano Balbuena @edgebal added 1 commit 2 weeks ago

            added 1 commit

            • c64885d2 - (feat): Lifecycle based on payment events

            Compare with previous version

          • Marcelo Rivera @eiennohi added 4 commits 2 weeks ago

            added 4 commits

            • c5348209 - (feat): added rating and quality to Campaign entity
            • 3905dd69 - (feat): updated campaign repositories to also make use of rating and quality
            • 51c8ca06 - (feat): Campaigns/Iterator can now filter by rating and quality
            • 53dffa04 - (feat): v2/boost/fetch/campaigns

            Compare with previous version

            Toggle commit list
          • Marcelo Rivera @eiennohi added 1 commit 2 weeks ago

            added 1 commit

            • 78104aa8 - (feat): v2/boost/fetch/campaigns

            Compare with previous version

          • Emiliano Balbuena @edgebal added 1 commit 1 week ago

            added 1 commit

            • 434afa0a - (wip): Metrics

            Compare with previous version

          • Emiliano Balbuena @edgebal added 18 commits 1 week ago

            added 18 commits

            • 434afa0a...5797d6ea - 16 commits from branch master
            • 986398b1 - (chore): Tweaks on Resolver ACL ignoring
            • e83768eb - Merge remote-tracking branch 'upstream/master' into goal/boost-campaigns-e24

            Compare with previous version

          • Marcelo Rivera @eiennohi added 3 commits 1 week ago

            added 3 commits

            • a5e57551 - (fix): moved sorting to ES
            • 6e862c12 - (fix): remove unused $next array
            • 2a77703e - (feat): calculate campaign rating based on nsfw value

            Compare with previous version

          • Marcelo Rivera @eiennohi added 2 commits 1 week ago

            added 2 commits

            • d8a8fbf1 - (fix): use _index vs index
            • 836245a1 - (fix): double declaration error, add timestamp

            Compare with previous version

          • Ben Hayward
            Ben Hayward @benhayward.ben · 1 week ago
            Developer

            Is this awaiting review with a WIP: accidentally left on, or the other way around?

          • Emiliano Balbuena @edgebal added 1 commit 1 week ago

            added 1 commit

            • 130b7876 - (feat): Refunds

            Compare with previous version

          • Emiliano Balbuena @edgebal automatically removed MR::Awaiting Review label 1 week ago

            automatically removed MR::Awaiting Review label

          • Emiliano Balbuena @edgebal added 30 commits 1 week ago

            added 30 commits

            • 130b7876...e33eedaf - 29 commits from branch master
            • 8f3875e0 - Merge remote-tracking branch 'origin/master' into goal/boost-campaigns-e24

            Compare with previous version

          • Marcelo Rivera @eiennohi added 1 commit 1 week ago

            added 1 commit

            • a6f14b0f - (feat): add date validation

            Compare with previous version

          • Mark Harding @markeharding added Squad::Yellow scoped label 6 days ago

            added Squad::Yellow scoped label

          • Emiliano Balbuena @edgebal added 1 commit 6 days ago

            added 1 commit

            • 23abc088 - (chore): Add `cpm` to settings

            Compare with previous version

          • Emiliano Balbuena @edgebal added 9 commits 6 days ago

            added 9 commits

            • 23abc088...88286ad8 - 8 commits from branch master
            • f9178dcc - Merge remote-tracking branch 'origin/master' into goal/boost-campaigns-e24

            Compare with previous version

          • Emiliano Balbuena @edgebal added 1 commit 5 days ago

            added 1 commit

            • 635f25dc - (wip): Campaign stats preview

            Compare with previous version

          • Marcelo Rivera @eiennohi added 1 commit 5 days ago

            added 1 commit

            • 3e9e4235 - (feat): implemented new offsets from v2/boost/feeds

            Compare with previous version

          • Marcelo Rivera @eiennohi added 2 commits 5 days ago

            added 2 commits

            • 92748bec - (feat): implemented new offsets from v2/boost/feeds
            • 683c8704 - (fix): if offset isn't cached, set it as 0

            Compare with previous version

          • Marcelo Rivera @eiennohi added 1 commit 5 days ago

            added 1 commit

            • da99f974 - (fix): check $data[0] vs $next

            Compare with previous version

          • Marcelo Rivera @eiennohi added 1 commit 4 days ago

            added 1 commit

            • 50260574 - (fix): rating filtering

            Compare with previous version

          • Marcelo Rivera @eiennohi added 1 commit 4 days ago

            added 1 commit

            • e690c3b3 - (fix): 1 = safe; 2 = open

            Compare with previous version

          • Marcelo Rivera @eiennohi added 1 commit 4 days ago

            added 1 commit

            • d5aeeb74 - (fix): 1 = safe; 2 = open

            Compare with previous version

          • Marcelo Rivera @eiennohi added 1 commit 4 days ago

            added 1 commit

            • 7605ba61 - (fix): quality filtering

            Compare with previous version

          • Marcelo Rivera @eiennohi added 1 commit 4 days ago

            added 1 commit

            • 09adb0ac - (fix): disable caching for now

            Compare with previous version

          • Marcelo Rivera @eiennohi added 2 commits 4 days ago

            added 2 commits

            • c34608ff - (fix): $cacheKey should consider quality and rating
            • 3f3f52ec - (fix): ios and new users check should be done before checking cache

            Compare with previous version

          • Emiliano Balbuena @edgebal added 1 commit 4 days ago

            added 1 commit

            • a821454e - (fix): Resolve campaigns

            Compare with previous version

          • Emiliano Balbuena @edgebal added 11 commits 4 days ago

            added 11 commits

            • a821454e...3f81d85a - 9 commits from branch master
            • 89ef1571 - Merge remote-tracking branch 'origin/master' into goal/boost-campaigns-e24
            • 7fb97f93 - (test): Fix foreign test failures due to Resolver changes

            Compare with previous version

          • Emiliano Balbuena @edgebal added 1 commit 4 days ago

            added 1 commit

            • 9ca3cbb4 - (fix): Circular DI issue on Entities\Resolver

            Compare with previous version

          • Emiliano Balbuena @edgebal added 1 commit 4 days ago

            added 1 commit

            • e9a5016e - (fix): Campaigns not being listed because of defaults

            Compare with previous version

          • Emiliano Balbuena @edgebal added 1 commit 3 days ago

            added 1 commit

            • d3ebab5d - (chore): Default CPM

            Compare with previous version

          • Marcelo Rivera @eiennohi added 1 commit 1 day ago

            added 1 commit

            • 843b09fc - (fix): should return 'entities' vs 'boosts'

            Compare with previous version

          • Marcelo Rivera @eiennohi added 2 commits 1 day ago

            added 2 commits

            • f151d290 - (feat): check if entity exists before mapping
            • c1da061f - (fix): send urn vs string when resolving boosted entity

            Compare with previous version

          • Marcelo Rivera @eiennohi added 1 commit 1 day ago

            added 1 commit

            • ea54fea4 - (chore): PHPDoc for Resolver->single

            Compare with previous version

          • Emiliano Balbuena @edgebal added 1 commit 4 hours ago

            added 1 commit

            • a6d916e7 - (fix): Counters

            Compare with previous version

          • Emiliano Balbuena @edgebal added 1 commit 4 hours ago

            added 1 commit

            • 8149cde1 - (fix): Operator relevance on CPM default

            Compare with previous version

          • Emiliano Balbuena @edgebal added 1 commit 2 hours ago

            added 1 commit

            • 6dead061 - (fix): Wrong state check when completing

            Compare with previous version

          • Mark Harding
            Mark Harding @markeharding started a thread on the diff 49 minutes ago
            Core/Boost/Campaigns/Delegates/NormalizeDatesDelegate.php
            27
            28 $today = strtotime(date('Y-m-d') . ' 00:00:00') * 1000;
            29 $start = strtotime(date('Y-m-d', $start) . ' 00:00:00') * 1000;
            30 $end = strtotime(date('Y-m-d', $end) . ' 23:59:59') * 1000;
            31
            32 if ($start < $today) {
            33 throw new CampaignException('Campaign start should not be in the past');
            34 } elseif ($start >= $end) {
            35 throw new CampaignException('Campaign end before starting');
            36 }
            37
            38 $campaign
            39 ->setStart($start)
            40 ->setEnd($end);
            41
            42 return $campaign;
            • Mark Harding
              Mark Harding @markeharding · 49 minutes ago
              Owner

              I think, generally, delegates should not return values and be void?

            • Please register or sign in to reply
          • Mark Harding
            Mark Harding @markeharding started a thread on the diff 48 minutes ago
            Core/Boost/Campaigns/Delegates/NormalizeDatesDelegate.php
            27
            28 $today = strtotime(date('Y-m-d') . ' 00:00:00') * 1000;
            29 $start = strtotime(date('Y-m-d', $start) . ' 00:00:00') * 1000;
            30 $end = strtotime(date('Y-m-d', $end) . ' 23:59:59') * 1000;
            31
            32 if ($start < $today) {
            33 throw new CampaignException('Campaign start should not be in the past');
            34 } elseif ($start >= $end) {
            35 throw new CampaignException('Campaign end before starting');
            36 }
            37
            38 $campaign
            39 ->setStart($start)
            40 ->setEnd($end);
            41
            42 return $campaign;
            • Mark Harding
              Mark Harding @markeharding · 48 minutes ago
              Owner

              also, some PHP 7 scala typing would be :tada:

            • Please register or sign in to reply
          • Mark Harding
            Mark Harding @markeharding started a thread on the diff 48 minutes ago
            Core/Boost/Campaigns/Iterator.php
            118 return $this;
            119 }
            120
            121 /**
            122 * @param int $quality
            123 * @return Iterator
            124 */
            125 public function setQuality(int $quality)
            126 {
            127 $this->quality = $quality;
            128 return $this;
            129 }
            130
            131 public function getList()
            132 {
            133 $response = $this->manager->getList(['limit' => $this->limit, 'from' => $this->from, 'offset' => $this->offset, 'type' => $this->type, 'owner_guid' => $this->ownerGuid, 'state' => $this->state, 'rating' => $this->rating, 'quality' => $this->quality,]);
            • Mark Harding
              Mark Harding @markeharding · 48 minutes ago
              Owner

              can we format this?

            • Please register or sign in to reply
          • Mark Harding
            Mark Harding @markeharding started a thread on the diff 44 minutes ago
            Last updated by Mark Harding 43 minutes ago
            Core/Entities/Resolver.php
            125 131
            126 132 $sorted = array_filter($sorted, function ($entity) { return (bool) $entity; });
            127 133
            128 // Filter out forbidden entities
            134 // Filter out forbidden entities, if not ignoring ACL
            135
            136 $ignoreAcl = $this->opts['ignoreAcl'] ?? false;
            129 137
            130 $sorted = array_filter($sorted, function ($entity) {
            131 return $this->acl->read($entity, $this->user);
            132 //&& !Flags::shouldFail($entity);
            133 });
            138 if (!$ignoreAcl) {
            • Mark Harding
              Mark Harding @markeharding · 44 minutes ago
              Owner

              Should this not be the job of the Security\ACL::$ignore? cc\ @brianhatchet with his new RBAC wisdom.

            • Mark Harding
              Mark Harding @markeharding · 43 minutes ago
              Owner

              patching the acl skipping in multiple different places doesn't seem right

            • Please register or sign in to reply
          • Mark Harding
            Mark Harding @markeharding started a thread on the diff 42 minutes ago
            Core/Boost/Campaigns/Repository.php
            39 throw new NotImplementedException();
            40 }
            41
            42 /**
            43 * @param Campaign $campaign
            44 * @return bool
            45 * @throws Exception
            46 */
            47 public function add(Campaign $campaign)
            48 {
            49 $cql = "INSERT INTO boost_campaigns (type, guid, owner_guid, json_data, delivery_status) VALUES (?, ?, ?, ?, ?)";
            50 $values = [
            51 $campaign->getType(),
            52 new Varint($campaign->getGuid()),
            53 new Varint($campaign->getOwnerGuid()),
            54 json_encode([
            • Mark Harding
              Mark Harding @markeharding · 42 minutes ago
              Owner

              Perhaps move this outside of values to avoid confusion?

            • Please register or sign in to reply
          • Mark Harding
            Mark Harding @markeharding · 40 minutes ago
            Owner

            Looking good from a first quick glance! ACl needs some clarification. Whats the remaining steps?

          • 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
          Assignee
          Emiliano Balbuena's avatar Emiliano Balbuena @edgebal
          Assign to
          None
          Milestone
          None
          Assign milestone
          None
          Time tracking
          No estimate or time spent
          1
          Labels
          Squad::Yellow
          Assign labels
          • View project labels
          Lock merge request
          Unlocked
          7
          7 participants
          user avatar
          Martin Santangelo
          user avatar
          Rami Albatal
          user avatar
          Mark Harding
          user avatar
          Brian Hatchet
          user avatar
          Marcelo Rivera
          user avatar
          Ben Hayward
          user avatar
          Emiliano Balbuena
          Reference: minds/engine!235