|
50538
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Close tab
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
Skip to content
Skip to content
Open menu
Homepage (g then d)
jiminny
jiminny
app
app
Search or jump to…
Type
/
to search
Chat with Copilot
Open Copilot…
Create new...
All issues(g then i)
All pull requests
All repositories
You have unread notifications(g then n)
Open user navigation menu
Repository navigation
Repository navigation
Code
Code
Pull requests (29)
Pull requests
(
29
)
Agents
Agents
Actions
Actions...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes#diff-4a1 github.com/jiminny/app/pull/12088/changes#diff-4a1e0ff3a25c28615f1bf22dc2d6b441b1d1926a2befa1226494a7aed1aeef53...
|
50538
|
|
50234
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Close tab
New Tab
Customize sidebar
Open Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
Skip to content
Skip to content
Open menu
Homepage (g then d)
jiminny
jiminny
app
app
Search or jump to…
Type
/
to search
Chat with Copilot
Open Copilot…
Create new...
All issues(g then i)
All pull requests
All repositories
You have unread notifications(g then n)
Open user navigation menu
Repository navigation
Repository navigation
Code
Code
Pull requests (29)
Pull requests
(
29
)
Agents
Agents
Actions
Actions
Wiki
Wiki
Security and quality
Security and quality
Insights
Insights
Settings
Settings
Important update
Important update
On April 24 we'll start using GitHub Copilot interaction data for AI model training unless you opt out.
Review this update
Review this update
and manage your preferences in your
GitHub account settings
GitHub account settings
.
Dismiss banner
Jy 20918 remove redis switch for priority reindexing #12088 Edit title
Jy 20918 remove redis switch for priority reindexing
#
12088
Edit title
Preview
Preview
Awaiting approval
Awaiting approval
Code
Code
Open
Vasil-Jiminny
Vasil-Jiminny
wants to merge 6 commits into
master
master
from
JY-20918-remove-redis-switch-for-priority-reindexing
JY-20918-remove-redis-switch-for-priority-reindexing
Copy head branch name to clipboard
Lines changed: 6 additions & 72 deletions
Conversation (5)
Conversation
(
5
)
Commits (6)
Commits
(
6
)
Checks (3)
Checks
(
3
)
Files changed (7)
Files changed
(
7
)
Pull Request Toolbar
Pull Request Toolbar
Collapse file tree
All commits
All commits
0 of 7 files viewed
Submit review
Submit
review
Open diff view settings
Open overview panel
Open comments panel
(
0
)
Filter files…
Filter options
File tree
File tree
app/Component/ES/Processor/Traits
SelectEntityListTrait.php
SelectEntityListTrait.php
tests/Unit/Component/ES
Listeners
UpdateMultipleTargetsListenerTest.php
UpdateMultipleTargetsListenerTest.php
UpdateSingleTargetListenerTest.php
UpdateSingleTargetListenerTest.php
Processor
Traits
SelectEntityListTraitTest.php
SelectEntityListTraitTest.php
TargetEntitiesSelectorTest.php
TargetEntitiesSelectorTest.php
AsyncUpdateElasticSearchTest.php
AsyncUpdateElasticSearchTest.php
UpdateProcessManagerTest.php
UpdateProcessManagerTest.php
Collapse file
app/Component/ES/Processor/Traits/SelectEntityListTrait.php
app/Component/ES/Processor/Traits/SelectEntityListTrait.php
app/Component/ES/Processor/Traits/SelectEntityListTrait.php
Copy file name to clipboard
Expand all lines: app/Component/ES/Processor/Traits/SelectEntityListTrait.php
Lines changed: 0 additions & 20 deletions
Not Viewed
Viewed
Comment on this file
More options
Original file line number
Original file line
Diff line number
Diff line change
@@ -5,7 +5,6 @@
5
namespace
Jiminny
\
Component
\
ES
\
Processor
\
Traits
;
5
namespace
Jiminny
\
Component
\
ES
\
Processor
\
Traits
;
6
6
7
use
Illuminate
\
Support
\
Facades
\
Log
;
7
use
Illuminate
\
Support
\
Facades
\
Log
;
8
-
use
Illuminate
\
Support
\
Facades
\
Redis
;
9
use
Jiminny
\
Component
\
ES
\
Processor
\
UpdateTarget
;
8...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes
|
50234
|
|
50235
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Close tab
New Tab
Customize sidebar
Open Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
Skip to content
Skip to content
Open menu
Homepage (g then d)
jiminny
jiminny
app
app
Search or jump to…
Type
/
to search
Chat with Copilot
Open Copilot…
Create new...
All issues(g then i)
All pull requests
All repositories
You have unread notifications(g then n)
Open user navigation menu
Repository navigation
Repository navigation
Code
Code
Pull requests (29)
Pull requests
(
29
)
Agents
Agents
Actions...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes
|
50235
|
|
50236
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Close tab
New Tab
Customize sidebar
Open Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
Skip to content
Skip to content
Open menu
Homepage (g then d)
jiminny
jiminny
app
app
Search or jump to…
Type
/
to search
Chat with Copilot
Open Copilot…
Create new...
All issues(g then i)
All pull requests
All repositories
You have unread notifications(g then n)
Open user navigation menu
Repository navigation
Repository navigation
Code
Code
Pull requests (29)
Pull requests
(
29
)...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes
|
50236
|
|
50237
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Close tab
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
PRO
PRO
Conversation with Gemini
Conversation with Gemini
Hi Lukas
Where should we start?
Where should we start?
🖼️ Create image, button, tap to use tool
🖼️ Create image
🎸 Create music, button, tap to use tool
🎸 Create music
Write anything, button, tap to use tool
Write anything
Boost my day, button, tap to use tool
Boost my day
Help me learn, button, tap to use tool
Help me learn
m
m
Open mode picker
Fast
Send message
Summarize page
Summarize page
Skip to content
Skip to content
Open menu
Homepage (g then d)
jiminny
jiminny
app
app
Search or jump to…
Type
/
to search
Chat with Copilot
Open Copilot…
Create new...
All issues(g then i)
All pull requests
All repositories
You have unread notifications(g then n)
Open user navigation menu
Repository navigation
Repository navigation
Code
Code
Pull requests (29)
Pull requests
(
29
)
Agents
Agents
Actions
Actions
Wiki
Wiki
Security and quality
Security and quality
Insights
Insights
Settings
Settings
Important update
Important update
On April 24 we'll start using GitHub Copilot interaction data for AI model training unless you opt out.
Review this update
Review this update
and manage your preferences in your
GitHub account settings
GitHub account settings
.
Dismiss banner
Jy 20918 remove redis switch for priority reindexing #12088 Edit title
Jy 20918 remove redis switch for priority reindexing
#
12088
Edit title
Preview
Preview
Awaiting approval
Awaiting approval
Code
Code
Open
Vasil-Jiminny
Vasil-Jiminny
wants to merge 6 commits into
master
master
from
JY-20918-remove-redis-switch-for-priority-reindexing
JY-20918-remove-redis-switch-for-priority-reindexing
Copy head branch name to clipboard
Lines changed: 6 additions & 72 deletions
Conversation (5)
Conversation
(
5
)
Commits (6)
Commits
(
6
)
Checks (3)
Checks
(
3
)
Files changed (7)
Files changed
(
7
)
Pull Request Toolbar
Pull Request Toolbar
Collapse file tree
All commits
All commits
0 of 7 files viewed
Submit review
Submit
review
Open diff view settings
Open overview panel
Open comments panel
(
0
)
Filter files…
Filter options
File tree
File tree
app/Component/ES/Processor/Traits
SelectEntityListTrait.php
SelectEntityListTrait.php
tests/Unit/Component/ES
Listeners
UpdateMultipleTargetsListenerTest.php
UpdateMultipleTargetsListenerTest.php
UpdateSingleTargetListenerTest.php
UpdateSingleTargetListenerTest.php
Processor
Traits
SelectEntityListTraitTest.php
SelectEntityListTraitTest.php
TargetEntitiesSelectorTest.php
TargetEntitiesSelectorTest.php
AsyncUpdateElasticSearchTest.php
AsyncUpdateElasticSearchTest.php
UpdateProcessManagerTest.php
UpdateProcessManagerTest.php
Collapse file
app/Component/ES/Processor/Traits/SelectEntityListTrait.php
app/Component/ES/Processor/Traits/SelectEntityListTrait.php
app/Component/ES/Processor/Traits/SelectEntityListTrait.php
Copy file name to clipboard
Expand all lines: app/Component/ES/Processor/Traits/SelectEntityListTrait.php
Lines changed: 0 additions & 20 deletions
Not Viewed
Viewed
Comment on this file
More options
Original file line number
Original file line
Diff line number
Diff line change
@@ -5,7 +5,6 @@
5
namespace
Jiminny
\
Component
\
ES
\
Processor
\
Traits
;
5
namespace
Jiminny
\
Component
\
ES
\
Processor
\
Traits
;
6
6
7
use
Illuminate
\
Support
\
Facades
\...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes
|
50237
|
|
50238
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Close tab
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
PRO
PRO
Conversation with Gemini
Conversation with Gemini
Hi Lukas
Where should we start?
Where should we start?
🖼️ Create image, button, tap to use tool
🖼️ Create image
🎸 Create music, button, tap to use tool
🎸 Create music
Write anything, button, tap to use tool
Write anything
Boost my day, button, tap to use tool
Boost my day
Help me learn, button, tap to use tool
Help me learn
mysql up
mysql up
Open upload file menu
Tools
Open mode picker
Fast
Send message
Summarize page
Summarize page
Skip to content
Skip to content
Open menu
Homepage (g then d)
jiminny
jiminny
app
app
Search or jump to…
Type
/
to search
Chat with Copilot
Open Copilot…
Create new...
All issues(g then i)
All pull requests
All repositories
You have unread notifications(g then n)
Open user navigation menu
Repository navigation
Repository navigation
Code
Code
Pull requests (29)
Pull requests
(
29
)
Agents
Agents
Actions
Actions
Wiki
Wiki
Security and quality
Security and quality
Insights
Insights
Settings
Settings
Important update
Important update
On April 24 we'll start using GitHub Copilot interaction data for AI model training unless you opt out.
Review this update
Review this update
and manage your preferences in your
GitHub account settings
GitHub account settings
.
Dismiss banner
Jy 20918 remove redis switch for priority reindexing #12088 Edit title
Jy 20918 remove redis switch for priority reindexing
#
12088
Edit title
Preview
Preview
Awaiting approval
Awaiting approval
Code
Code
Open
Vasil-Jiminny
Vasil-Jiminny
wants to merge 6 commits into
master
master
from
JY-20918-remove-redis-switch-for-priority-reindexing
JY-20918-remove-redis-switch-for-priority-reindexing
Copy head branch name to clipboard
Lines changed: 6 additions & 72 deletions
Conversation (5)
Conversation
(
5
)
Commits (6)
Commits
(
6
)
Checks (3)
Checks
(
3
)
Files changed (7)
Files changed
(
7
)
Pull Request Toolbar
Pull Request Toolbar
Collapse file tree
All commits
All commits
0 of 7 files viewed
Submit review
Submit
review
Open diff view settings
Open overview panel
Open comments panel
(
0
)
Filter files…
Filter options
File tree
File tree
app/Component/ES/Processor/Traits
SelectEntityListTrait.php
SelectEntityListTrait.php
tests/Unit/Component/ES
Listeners
UpdateMultipleTargetsListenerTest.php
UpdateMultipleTargetsListenerTest.php
UpdateSingleTargetListenerTest.php
UpdateSingleTargetListenerTest.php
Processor
Traits
SelectEntityListTraitTest.php
SelectEntityListTraitTest.php
TargetEntitiesSelectorTest.php
TargetEntitiesSelectorTest.php
AsyncUpdateElasticSearchTest.php
AsyncUpdateElasticSearchTest.php
UpdateProcessManagerTest.php
UpdateProcessManagerTest.php
Collapse file
app/Component/ES/Processor/Traits/SelectEntityListTrait.php
app/Component/ES/Processor/Traits/SelectEntityListTrait.php
app/Component/ES/Processor/Traits/SelectEntityListTrait.php
Copy file name to clipboard
Expand all lines: app/Component/ES/Processor/Traits/SelectEntityListTrait.php
Lines changed: 0 additions & 20 deletions
Not Viewed
Viewed
Comment on this file
More options
Original file line number
Original file line
Diff line number
Diff line change
@@ -5,7 +5,6 @@
5
namespace
Jiminny
\
Component
\
ES
\
Processor
\
Traits
;
5
namespace
Jiminny
\
Component
\
ES
\
Processor
\
Traits
;
6
6
7
use
Illuminate
\
Support
\
Facades
\
Log
;
7
use
Illuminate
\
Support
\
Facades
\
Log
;
8
-
use
Illuminate
\
Support
\
Facades
\
Redis
;
9
use
Jiminny
\
Component
\
ES
\
Processor
\
UpdateTarget
;
8
use
Jiminny
\
Component
\
ES...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes
|
50238
|
|
50239
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Close tab
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
PRO
PRO
Conversation with Gemini
Conversation with Gemini
Copy prompt
Edit
You said mysql update query
You said
mysql update query
Enter a prompt for Gemini
encrypted
Enter a prompt for Gemini
encrypted
Open upload file menu
Tools
Open mode picker
Fast
Stop response
Your Jiminny chats aren’t used to improve our models. Gemini is AI. It can make mistakes, so double check it.
Your privacy & Gemini Opens in a new window
Your privacy & Gemini
Opens in a new window
Gemini is typing
Summarize page
Summarize page
Skip to content
Skip to content
Open menu
Homepage (g then d)
jiminny
jiminny
app
app
Search or jump to…
Type
/
to search
Chat with Copilot
Open Copilot…
Create new...
All issues(g then i)
All pull requests
All repositories
You have unread notifications(g then n)
Open user navigation menu
Repository navigation
Repository navigation
Code
Code
Pull requests (29)
Pull requests
(
29
)
Agents
Agents
Actions
Actions
Wiki
Wiki
Security and quality
Security and quality
Insights
Insights
Settings
Settings
Important update
Important update
On April 24 we'll start using GitHub Copilot interaction data for AI model training unless you opt out.
Review this update
Review this update
and manage your preferences in your
GitHub account settings
GitHub account settings
.
Dismiss banner
Jy 20918 remove redis switch for priority reindexing #12088 Edit title
Jy 20918 remove redis switch for priority reindexing
#
12088
Edit title
Preview
Preview
Awaiting approval
Awaiting approval
Code
Code
Open
Vasil-Jiminny
Vasil-Jiminny
wants to merge 6 commits into
master
master
from
JY-20918-remove-redis-switch-for-priority-reindexing
JY-20918-remove-redis-switch-for-priority-reindexing
Copy head branch name to clipboard
Lines changed: 6 additions & 72 deletions
Conversation (5)
Conversation
(
5
)
Commits (6)
Commits
(
6
)
Checks (3)
Checks
(
3
)
Files changed (7)
Files changed
(
7
)
Pull Request Toolbar
Pull Request Toolbar
Collapse file tree
All commits
All commits
0 of 7 files viewed
Submit review
Submit
review
Open diff view settings
Open overview panel
Open comments panel
(
0
)
Filter files…
Filter options
File tree
File tree
app/Component/ES/Processor/Traits
SelectEntityListTrait.php
SelectEntityListTrait.php
tests/Unit/Component/ES
Listeners
UpdateMultipleTargetsListenerTest.php
UpdateMultipleTargetsListenerTest.php
UpdateSingleTargetListenerTest.php
UpdateSingleTargetListenerTest.php
Processor
Traits
SelectEntityListTraitTest.php
SelectEntityListTraitTest.php
TargetEntitiesSelectorTest.php
TargetEntitiesSelectorTest.php
AsyncUpdateElasticSearchTest.php
AsyncUpdateElasticSearchTest.php
UpdateProcessManagerTest.php
UpdateProcessManagerTest.php
Collapse file
app/Component/ES/Processor/Traits/SelectEntityListTrait.php
app/Component/ES/Processor/Traits/SelectEntityListTrait.php
app/Component/ES/Processor/Traits/SelectEntityListTrait.php
Copy file name to clipboard
Expand all lines: app/Component/ES/Processor/Traits/SelectEntityListTrait.php
Lines changed: 0 additions & 20 deletions
Not Viewed
Viewed
Comment on this file
More options
Original file line number
Original file line
Diff line number
Diff line change
@@ -5,7 +5,6 @@
5
namespace
Jiminny
\
Component
\
ES
\
Processor
\
Traits
;
5
namespace
Jiminny
\
Component
\
ES
\
Processor
\
Traits
;
6
6
7
use
Illuminate
\
Support
\
Facades
\
Log
;
7...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes
|
50239
|
|
50240
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Close tab
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
Edit
You said mysql update query
You said
mysql update query
Gemini said
Gemini said
The
UPDATE
statement in MySQL is used to modify existing records in a table.
Here is a complete guide to how it works,
from basic usage to safer practices.
1. The Basic Syntax
1. The Basic Syntax
The most critical part of an
Enter a prompt for Gemini
encrypted
Enter a prompt for Gemini
encrypted
Open upload file menu
Tools
Open mode picker
Fast
Stop response
Your Jiminny chats aren’t used to improve our models. Gemini is AI. It can make mistakes, so double check it.
Your privacy & Gemini Opens in a new window
Your privacy & Gemini
Opens in a new window
Gemini replied
Summarize page
Summarize page
Skip to content
Skip to content
Open menu
Homepage (g then d)
jiminny
jiminny
app
app
Search or jump to…
Type
/
to search
Chat with Copilot
Open Copilot…
Create new...
All issues(g then i)
All pull requests
All repositories
You have unread notifications(g then n)
Open user navigation menu
Repository navigation
Repository navigation
Code
Code
Pull requests (29)
Pull requests
(
29
)
Agents
Agents
Actions
Actions
Wiki
Wiki
Security and quality
Security and quality
Insights
Insights
Settings
Settings
Important update
Important update
On April 24 we'll start using GitHub Copilot interaction data for AI model training unless you opt out.
Review this update
Review this update
and manage your preferences in your
GitHub account settings
GitHub account settings
.
Dismiss banner
Jy 20918 remove redis switch for priority reindexing #12088 Edit title
Jy 20918 remove redis switch for priority reindexing
#
12088
Edit title
Preview
Preview
Awaiting approval
Awaiting approval
Code
Code
Open
Vasil-Jiminny
Vasil-Jiminny
wants to merge 6 commits into
master
master
from
JY-20918-remove-redis-switch-for-priority-reindexing
JY-20918-remove-redis-switch-for-priority-reindexing
Copy head branch name to clipboard
Lines changed: 6 additions & 72 deletions
Conversation (5)
Conversation
(
5
)
Commits (6)
Commits
(
6
)
Checks (3)
Checks
(
3
)
Files changed (7)
Files changed
(
7
)
Pull Request Toolbar
Pull Request Toolbar
Collapse file tree
All commits
All commits
0 of 7 files viewed
Submit review
Submit
review
Open diff view settings
Open overview panel
Open comments panel
(
0
)
Filter files…
Filter options
File tree
File tree
app/Component/ES/Processor/Traits
SelectEntityListTrait.php
SelectEntityListTrait.php
tests/Unit/Component/ES
Listeners
UpdateMultipleTargetsListenerTest.php
UpdateMultipleTargetsListenerTest.php
UpdateSingleTargetListenerTest.php
UpdateSingleTargetListenerTest.php
Processor
Traits
SelectEntityListTraitTest.php
SelectEntityListTraitTest.php
TargetEntitiesSelectorTest.php
TargetEntitiesSelectorTest.php
AsyncUpdateElasticSearchTest.php
AsyncUpdateElasticSearchTest.php
UpdateProcessManagerTest.php
UpdateProcessManagerTest.php
Collapse file
app/Component/ES/Processor/Traits/SelectEntityListTrait.php
app/Component/ES/Processor/Traits/SelectEntityListTrait.php
app/Component/ES/Processor/Traits/SelectEntityListTrait.php
Copy file name to clipboard
Expand all lines: app/Component/ES/Processor/Traits/SelectEntityListTrait.php
Lines changed: 0 additions & 20 deletions
Not Viewed
Viewed
Comment on this file
More options
Original file line number
Original file line
Diff line number
Diff line change
@@ -5,7 +5,6 @@
5
namespace
Jiminny
\
Component
\
ES
\
Processor
\
Traits
;
5
namespace
Jiminny
\
Component
\
ES
\
Processor
\
Traits
;
6
6
7
use
Illuminate
\
Support
\
Facades
\
Log
;
7
use
Illuminate
\
Support...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes
|
50240
|
|
50241
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Close tab
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
Edit
You said mysql update query
You said
mysql update query
Gemini said
Gemini said
The
UPDATE
statement in MySQL is used to modify existing records in a table.
Here is a complete guide to how it works,
from basic usage to safer practices.
1. The Basic Syntax
1. The Basic Syntax
The most critical part of an
UPDATE
query is the
WHERE
clause.
If you omit it,
every single row
in your table will be updated.
SQL
Download code
Copy code
UPDATE table_name
SET
column1
=
value1, column2
=
value2, ...
WHERE
condition
;
2. Common Examples
2. Common Examples
Example A: Updating a single column for a specific row
Example A: Updating a single column for a specific row
Let's say you want to update the email address of an employee whose ID is
105
.
SQL
Download code
Copy code
UPDATE employees
SET
email
=
'[EMAIL]'
WHERE
employee_id
=
105
;
Enter a prompt for Gemini
encrypted
Enter a prompt for Gemini
encrypted
Open upload file menu
Tools
Open mode picker
Fast
Stop response
Your Jiminny chats aren’t used to improve our models. Gemini is AI. It can make mistakes, so double check it.
Your privacy & Gemini Opens in a new window
Your privacy & Gemini
Opens in a new window
Summarize page
Summarize page
Skip to content
Skip to content
Open menu
Homepage (g then d)
jiminny
jiminny
app
app
Search or jump to…
Type
/
to search
Chat with Copilot
Open Copilot…
Create new...
All issues(g then i)
All pull requests
All repositories
You have unread notifications(g then n)
Open user navigation menu
Repository navigation
Repository navigation
Code
Code
Pull requests (29)
Pull requests
(
29
)
Agents
Agents
Actions
Actions
Wiki
Wiki
Security and quality
Security and quality
Insights
Insights
Settings
Settings
Important update
Important update
On April 24 we'll start using GitHub Copilot interaction data for AI model training unless you opt out.
Review this update
Review this update
and manage your preferences in your
GitHub account settings
GitHub account settings
.
Dismiss banner
Jy 20918 remove redis switch for priority reindexing #12088 Edit title
Jy 20918 remove redis switch for priority reindexing
#
12088
Edit title
Preview
Preview
Awaiting approval
Awaiting approval
Code
Code
Open
Vasil-Jiminny
Vasil-Jiminny
wants to merge 6 commits into
master
master
from
JY-20918-remove-redis-switch-for-priority-reindexing
JY-20918-remove-redis-switch-for-priority-reindexing
Copy head branch name to clipboard
Lines changed: 6 additions & 72 deletions
Conversation (5)
Conversation
(
5
)
Commits (6)
Commits
(
6
)
Checks (3)
Checks
(
3
)
Files changed (7)
Files changed
(
7
)
Pull Request Toolbar
Pull Request Toolbar
Collapse file tree
All commits
All commits
0 of 7 files viewed
Submit review
Submit
review
Open diff view settings
Open overview panel
Open comments panel
(
0
)
Filter files…
Filter options
File tree
File tree
app/Component/ES/Processor/Traits
SelectEntityListTrait.php...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes
|
50241
|
|
50242
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Close tab
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
Edit
You said mysql update query
You said
mysql update query
Gemini said
Gemini said
The
UPDATE
statement in MySQL is used to modify existing records in a table.
Here is a complete guide to how it works,
from basic usage to safer practices.
1. The Basic Syntax
1. The Basic Syntax
The most critical part of an
UPDATE
query is the
WHERE
clause.
If you omit it,
every single row
in your table will be updated.
SQL
Download code
Copy code
UPDATE table_name
SET
column1
=
value1, column2
=
value2, ...
WHERE
condition
;
Let's say you want to update the email address of an employee whose ID is
105
.
SQL
Download code
Copy code
UPDATE employees
SET
email
=
'[EMAIL]'
WHERE
employee_id
=
105
;
You can change multiple values at once by separating the
column = value
pairs with commas.
SQL
Download code
Copy code
UPDATE employees
SET
role
=
'Senior Developer'
, salary
=
95000
WHERE
employee_id
=
105
;
You can update a value based on its current value.
For example,
giving a 10% raise to everyone in department
4
:
SQL
Download code
Copy code
UPDATE employees
SET
salary
=
salary
*
1.10
WHERE
department_id
=
4
;
Sometimes you need to update a table based on values inside a completely different table.
SQL
Download code
Copy code
UPDATE employees e
JOIN
departments d
ON
e.department_id
=
d.id
SET
e.location
=
d.headquarters_city
WHERE
d.region
=
'North America'
;
To ensure you don't accidentally alter thousands of rows if your
WHERE
clause is too broad,
you can append a
LIMIT
Enter a prompt for Gemini
encrypted
Enter a prompt for Gemini
encrypted
Open upload file menu
Tools
Open mode picker
Fast
Stop response
Your Jiminny chats aren’t used to improve our models. Gemini is AI. It can make mistakes, so double check it.
Your privacy & Gemini Opens in a new window
Your privacy & Gemini
Opens in a new window
Summarize page
Summarize page
Skip to content
Skip to content
Open menu
Homepage (g then d)
jiminny
jiminny
app
app
Search or jump to…
Type
/
to search
Chat with Copilot
Open Copilot…
Create new...
All issues(g then i)
All pull requests
All repositories
You have unread notifications(g then n)
Open user navigation menu
Repository navigation
Repository navigation
Code
Code
Pull requests (29)
Pull requests
(
29
)
Agents
Agents
Actions
Actions
Wiki
Wiki
Security and quality
Security and quality
Insights
Insights
Settings
Settings
Important update
Important update
On April 24 we'll start using GitHub Copilot interaction data for AI model training unless you opt out.
Review this update
Review this update
and manage your preferences in your
GitHub account settings
GitHub account settings
.
Dismiss banner
Jy 20918 remove redis switch for priority reindexing #12088 Edit title
Jy 20918 remove redis switch for priority reindexing
#
12088
Edit title
Preview
Preview
Awaiting approval
Awaiting approval
Code
Code
Open
Vasil-Jiminny
Vasil-Jiminny
wants to merge 6 commits into
master
master
from
JY-20918-remove-redis-switch-for-priority-reindexing
JY-20918-remove-redis-switch-for-priority-reindexing
Copy head branch name to clipboard
Lines changed: 6 additions & 72 deletions
Conversation (5)
Conversation
(
5
)
Commits (6)
Commits
(
6
)
Checks (3)
Checks
(
3
)
Files changed (7)
Files changed
(
7
)
Pull Request Toolbar
Pull Request Toolbar
Collapse file tree
All commits
All commits
0 of 7 files viewed
Submit review
Submit
review
Open diff view settings
Open overview panel...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes
|
50242
|
|
50254
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Close tab
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
Edit
You said mysql update query
You said
mysql update query
Listen
Gemini said
Gemini said
The
UPDATE
statement in MySQL is used to modify existing records in a table.
Here is a complete guide to how it works, from basic usage to safer practices.
1. The Basic Syntax
1. The Basic Syntax
The most critical part of an
UPDATE
query is the
WHERE
clause. If you omit it,
every single row
in your table will be updated.
SQL
Download code
Copy code...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes
|
50254
|
|
50255
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Close tab
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
Edit
You said mysql update query
You said
mysql update query
Listen
Gemini said
Gemini said
The
UPDATE
statement in MySQL is used to modify existing records in a table.
Here is a complete guide to how it works, from basic usage to safer practices.
1. The Basic Syntax
1. The Basic Syntax
The most critical part of an
UPDATE
query is the
WHERE
clause. If you omit it,
every single row
in your table will be updated....
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes
|
50255
|
|
50256
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Close tab
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
Edit
You said mysql update query
You said
mysql update query
Listen
Gemini said
Gemini said
The
UPDATE
statement in MySQL is used to modify existing records in a table.
Here is a complete guide to how it works, from basic usage to safer practices.
1. The Basic Syntax
1. The Basic Syntax
The most critical part of an
UPDATE
query is the
WHERE
clause. If you omit it,
every single row
in your table will be updated.
SQL
Download code
Copy code
UPDATE table_name
SET
column1
=
value1, column2
=
value2, ...
WHERE
condition
;
2. Common Examples
2. Common Examples
Example A: Updating a single column for a specific row
Example A: Updating a single column for a specific row
Let's say you want to update the email address of an employee whose ID is
105
.
SQL
Download code
Copy code
UPDATE employees
SET
email
=
'[EMAIL]'
WHERE
employee_id
=
105
;
Example B: Updating multiple columns
Example B: Updating multiple columns
You can change multiple values at once by separating the
column = value
pairs with commas.
SQL
Download code
Copy code
UPDATE employees...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes
|
50256
|
|
50481
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Close tab
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Gemini said...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes
|
50481
|
|
50482
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
github.com/jiminny/app/pull/12086#pullrequestreview-4308125516
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Close tab
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Gemini said
Gemini said
Summary of Changes
Summary of Changes
The selected diff updates
TargetEntitiesSelectorTest
by replacing hardcoded class constants with local variables (
$mainChunkSize
and
$staleChunkSize
) to make the tests more flexible, while explicitly tightening the expected call counts on mock objects.
Detailed Modifications
Detailed Modifications
1. Test Parameterization
1. Test Parameterization
Introduced Local Variables:
Replaced references to
TargetEntitiesSelector::ES_CHUNK_SIZE
with
$mainChunkSize = 200
and
TargetEntitiesSelector::SMALL_CHUNK_SIZE
with...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes
|
50482
|
|
50483
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
github.com/jiminny/app/pull/12086#pullrequestreview-4308125516
github.com/jiminny/app/pull/12086#pullrequestreview-4308125516...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes
|
50483
|
|
50484
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes
|
50484
|
|
50485
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes
|
50485
|
|
50486
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
github.com/jiminny/app/pull/12086#pullrequestreview-4308125516
github.com/jiminny/app/pull/12086#pullrequestreview-4308125516
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Close tab
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Gemini said
Gemini said
Summary of Changes
Summary of Changes
The selected diff updates
TargetEntitiesSelectorTest
by replacing hardcoded class constants with local variables (
$mainChunkSize
and
$staleChunkSize
) to make the tests more flexible, while explicitly tightening the expected call counts on mock objects.
Detailed Modifications
Detailed Modifications
1. Test Parameterization
1. Test Parameterization
Introduced Local Variables:
Replaced references to
TargetEntitiesSelector::ES_CHUNK_SIZE
with
$mainChunkSize = 200
and
TargetEntitiesSelector::SMALL_CHUNK_SIZE
with
$staleChunkSize = 50
.
Dynamic Range and Offset Calculations:
Updated array ranges, Redis...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes
|
50486
|
|
50487
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
github.com/jiminny/app/pull/12086#pullrequestreview-4308125516
github.com/jiminny/app/pull/12086#pullrequestreview-4308125516
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Close tab
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Gemini said
Gemini said
Summary of Changes
Summary of Changes
The selected diff updates
TargetEntitiesSelectorTest
by replacing hardcoded class constants with local variables (
$mainChunkSize
and
$staleChunkSize
) to make the tests more flexible, while explicitly tightening the expected call counts on mock objects.
Detailed Modifications
Detailed Modifications
1. Test Parameterization
1. Test Parameterization
Introduced Local Variables:...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes
|
50487
|
|
50546
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Close tab
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Open Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
Skip to content
Skip to content
Open menu
Homepage (g then d)
jiminny
jiminny
app
app
Search or jump to…
Type
/
to search
Chat with Copilot
Open Copilot…
Create new...
All issues(g then i)
All pull requests
All repositories
You have no unread notifications(g then n)
Open user navigation menu
Repository navigation
Repository navigation
Code
Code
Pull requests (29)
Pull requests
(
29
)
Agents
Agents
Actions
Actions
Wiki
Wiki
Security and quality
Security and quality
Insights
Insights
Settings
Settings
Important update
Important update
On April 24 we'll start using GitHub Copilot interaction data for AI model training unless you opt out.
Review this update
Review this update
and manage your preferences in your
GitHub account settings
GitHub account settings
.
Dismiss banner
Jy 20918 remove redis switch for priority reindexing #12088 Edit title
Jy 20918 remove redis switch for priority reindexing
#
12088
Edit title
View statusView status
Loading
Loading merge status
Code
Code
Open
Vasil-Jiminny
Vasil-Jiminny
wants to merge 7 commits into
master
master
from
JY-20918-remove-redis-switch-for-priority-reindexing
JY-20918-remove-redis-switch-for-priority-reindexing
Copy head branch name to clipboard
Conversation
Conversation
Commits (7)
Commits
(
7
)
Checks
Checks
Files changed
Files changed
Conversation
Conversation
@Vasil-Jiminny
Show options
Vasil-Jiminny commented May 15, 2026 •
Vasil-Jiminny
Vasil-Jiminny
commented
May 15, 2026
May 15, 2026
•
edited
edited
JIRA: JY-20918
JIRA:
JY-20918
JY-20918
Changes:
Changes:
There is a redis key named ‘updates-with-priority-enabled' that may be used to force push all activities for priority reindexing.
The key has been rarely (if ever) used, but it injects 'magic’ into how we control the reindexing process, and may introduce serious performance penalties of the application if user incorrectly.
Here it's being removed. Indexing priority is decided explicitly at the time of scheduling an entity update.
Add or remove reactions
Vasil-Jiminny
Vasil-Jiminny
added
5
commits
May 15, 2026 17:11
May 15, 2026 17:11
@Vasil-Jiminny
Remove Redis control variable "updates-with-priority-enabled". Simpli…
Remove Redis control variable "updates-with-priority-enabled". Simpli…
Commit message body
e3dad9d
e3dad9d
@Vasil-Jiminny...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088#pullrequestrevie github.com/jiminny/app/pull/12088#pullrequestreview-4308146139...
|
50546
|
|
50564
|
iTerm2ShellEditViewSessionScriptsProfilesWindowHel iTerm2ShellEditViewSessionScriptsProfilesWindowHelpDOCKER81DEV (-zsh)11DOCKER (docker-compose)docker_lamp_11}docker_lamp_1...10sDONEdocker_lamp_1• '/usr/local/bin/php' 'artisan' mailbox:text-relay:sync > */proc/1/fd/1' 2>&1docker_lamp_12026-05-18 07:37:32 Running ['artisan' conference:pre-meeting-notification]20s DONEdocker_1amp_1l '/usr/local/bin/php' 'artisan' conference:pre-meeting-notification'/proc/1/fd/1'2>&1docker_lamp_12026-05-18 07:37:52 Running ['artisan'conference:monitor:start].. 17S DONEdocker_lamp_1fd/1'2>&1l '/usr/local/bin/php' 'artisan' conference:monitor:start › */proc/1/docker_lamp_12026-05-18 07:38:09 Running ['artisan'conference:monitor:end].... 2docker_lamp_1/1'1 '/usr/local/bin/php' 'artisan'conference:monitor:end > */proc/1/fd2>&1docker_lamp_12026-05-18 07:38:30 Running ['artisan' jiminny:fix-hubspot-tokens]2Os DONEdocker_lamp_1 | / '/usr/local/bin/php' 'artisan' jiminny:fix-hubspot-tokens › '/proc/1/fd/1' 2>&1docker_lamp_12026-05-18 07:38:51 Running ['artisan'conference:pre-meeting-reminder] in background 82.66msdocker_lamp_1l ('/usr/local/bin/php' 'artisan' conference:pre-meeting-reminder ›/proc/1/fd/1' 2>&1; '/usr/local/bin/php' 'artisan""framework/schedule-805efb160ee8d9da02e60364ace7970eb2b35f31" "$?") > '/dev/null' 2>&1 &docker_lamp_1 |2026-05-18 07:38:51 Running ['artisan' hubspot: journal-poll --start]in background33.66ms DONEdocker_lamp_1l ('/usr/local/bin/php' 'artisan' hubspot:journal-poll --start > '/proc/1/fd/1' 2>&1 ; '/usr/local/bin/php'schedule:finish "framework/schedule-e26d77f915d2c55fe91ca4148a230e32eaa1865e" "$?") > '/dev/null'docker_lamp_12026-05-18 07:38:51 Running ['artisan' crm:bullhorn:ping --heartbeat]O social account(s) to be processeddocker_lamp_1docker_1amp_1docker_lamp_1docker_lamp_1I Done!1 2 Starting HubSpot journal polling service...27S DONEdocker_lamp_1• '/usr/local/bin/php' 'artisan' crm:bullhorn:ping --heartbeat › '/proc/1/fd/1' 2>&1docker_lamp_1docker_lamp_1run_artisan_schedule: Done waiting for schedule:rundocker_lamp_1-View in Docker Desktop@ View ConfigEnable Watch> 0.Preparation for Refi…. in 4h 20 m100%8• Mon 18 May 10:40:30DOCKER (docker-compose)О ₴2APP (-zsh)screenpipe"*3PROD (ssh)Run'do-release-upgrade'to upgrade to it.*** System restart required ***Last login: Thu May 14 07:41:362026 from 212.5.153.87lukas@jiminny-prod-bastion:~$X L3 EU (-zsh)Last login: Sat May 16 18:04:33on ttys001Poetry could not find a pyproject.toml file in /Users/lukas or its parentsPoetry could not find a pyproject.tomlfile in /Users/lukas or its parents@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ I|T4STAGE (ssh)See [URL_WITH_CREDENTIALS] ~ $ IEXT (-zsh)Poetry could not find a pyproject.toml file in /Users/lukas or its parentsPoetry could not find a pyproject.tomlfile in /Users/lukas or its parentslukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ [|FRONTENDEXTENSION...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088#pullrequestrevie github.com/jiminny/app/pull/12088#pullrequestreview-4308146139...
|
50564
|
|
50566
|
rireroxEdit•••D+→ cVIewmistory bookmarksProtllesTo rireroxEdit•••D+→ cVIewmistory bookmarksProtllesToolsWindowmelp• github.com/jiminny/app/pull/12086#pullrequestreview-4308125516Platform Sprint 4 Q2 - Platform Te()JY-20891 add support for seconda[UY-20891] Sidekick SMS issue - JJY-20915) Add environment-spedUsage | Windsurf(SRD-6853) Moxso - Potential deaPipelines - jiminny/appl Feed - jiminny - SentryfJY-209061 Review of Pipedrive SP Pipedrive API Reference and Docur•pipedrive/client-php: Pipedrive APfiiminny/infrastructurel.JY-20623Pull requests - jiminny/app(JY-209121 Fallback mechanism fcS 1IY-209061 Review of Pinedrive Sf. JY 20893 chunk control per up xaail-Jim chynK Rarouer ugote t Jmet by.• Jy 20918 remove redis switch for df Jy 20846 mcp enable the ai to kno+ New TabiPreparation for Refi... in 4h 20m A 100% C4 &• Mon 18 May 10:40:3083 OperJY 20893 chunk control per update target #12086Vasil-Jiminny wants to merge 18 commits into master from JY-20893-chunk-control-per-update-target• Vasil-Jiminny requested a review from vkulov 44 minutes agoO Short the implementation of accessor methods. No functional changes, .@ O uulov approved these changes 1a minutes agoo € Merge branch 'master' into JY-20893-chunk-control-per-update-target@ Lakylak approvedl these changes 4 minutes agoX Заес79aView reviewed changesVerified • c50964fView reviewed changesThis branch has not been denlovediNo deployments|Changes approved2 annrovina reviews bv reviewers with write access.2 approvals ›8 2 pending reviews >• Some checks haven't completed yet• 1 oendina. 1 in oroaress. 1 skiooed. 1 exoected. 8 successtul checksinantintshose•0 ci/circleci: test Waiting for status to be reported — CircleCl is running your tests• @ SonarCloud Code Analvsis Expected — Waiting for status to be reported1 in nroaroce chock v• • build accept deplov Started 12 minutes aao — Workflow: build accept deplovRequired•@ Claude Code / claude (pull_request_review) Skipped 4 minutes agov ci/circleci: build-backend — Your tests passed on CircleCI!Enable auto-mergeYou can also merce this with the command line. View command line instructions.X scheduledBatches^ V V Highlight All Match Case [] Match Diacritics Whole Words 2 of 8 matches...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088#pullrequestrevie github.com/jiminny/app/pull/12088#pullrequestreview-4308146139...
|
50566
|
|
50362
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Close tab
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Gemini said
Gemini said
Summary of Changes
Summary of Changes
The selected diff updates
TargetEntitiesSelectorTest
by replacing hardcoded class constants with local variables (...
|
Firefox
|
JY 20893 chunk control per update target by Vasil- JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12086/changes#diff-aa0 github.com/jiminny/app/pull/12086/changes#diff-aa07541aafd2d4e76eb8a184054ea800458aea58f359ef08e62155c3e301a4c4...
|
50362
|
|
50363
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Close tab
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Gemini said
Gemini said
Summary of Changes
Summary of Changes
The selected diff updates
TargetEntitiesSelectorTest
by replacing hardcoded class constants with local variables (
$mainChunkSize
and
$staleChunkSize
) to make the tests more flexible, while explicitly tightening the expected call counts on mock objects.
Detailed Modifications
Detailed Modifications
1. Test Parameterization
1. Test Parameterization
Introduced Local Variables:
Replaced references to
TargetEntitiesSelector::ES_CHUNK_SIZE
with
$mainChunkSize = 200
and
TargetEntitiesSelector::SMALL_CHUNK_SIZE
with
$staleChunkSize = 50
.
Dynamic Range and Offset Calculations:
Updated array ranges, Redis
spop
arguments, and iteration offsets to derive dynamically from these local variables instead of hardcoded class constants.
2. Mock Expectation Hardening
2. Mock Expectation Hardening
getAllScheduledBatches
:
Changed expectations from
atLeastOnce()
to explicit strict counts:
exactly(5)
in
testTargetStaleChunksFirst
once()
in
testOnlyHighPriorityEntitiesToProcess
isBatchStillInProgress
:
Changed expectation from
atLeast(2)
to
exactly(14)
.
extractEntityIdsFromBatch
:
Changed expectation from
atLeast($z)
to
exactly($z + 1)
.
Good response
Bad response
Share & export
Copy
Show more options
Copy prompt
You said review PR, non test files and try to find some potential issues and bottlenecks
You said
review PR, non test files and try to find some potential issues and bottlenecks
Listen
Show thinking
Gemini said
Gemini said
I’d be happy to review the main source files for potential issues and performance bottlenecks! However, the snippet you shared previously only contained the
TargetEntitiesSelectorTest
file. I don't currently have access to the rest of the Pull Request.
Could you please paste the diff or the code for the non-test files (such as
TargetEntitiesSelector.php
) so I can take a look?
Good response
Bad response
Share & export
Copy
Show more options...
|
Firefox
|
JY 20893 chunk control per update target by Vasil- JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12086/changes#diff-aa0 github.com/jiminny/app/pull/12086/changes#diff-aa07541aafd2d4e76eb8a184054ea800458aea58f359ef08e62155c3e301a4c4...
|
50363
|
|
50364
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Close tab
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Gemini said
Gemini said
Summary of Changes
Summary of Changes
The selected diff updates
TargetEntitiesSelectorTest
by replacing hardcoded class constants with local variables (
$mainChunkSize
and
$staleChunkSize
) to make the tests more flexible, while explicitly tightening the expected call counts on mock objects.
Detailed Modifications
Detailed Modifications
1. Test Parameterization
1. Test Parameterization
Introduced Local Variables:
Replaced references to
TargetEntitiesSelector::ES_CHUNK_SIZE
with
$mainChunkSize = 200
and
TargetEntitiesSelector::SMALL_CHUNK_SIZE
with
$staleChunkSize = 50
.
Dynamic Range and Offset Calculations:
Updated array ranges, Redis
spop
arguments, and iteration offsets to derive dynamically from these local variables instead of hardcoded class constants.
2. Mock Expectation Hardening
2. Mock Expectation Hardening
getAllScheduledBatches
:
Changed expectations from
atLeastOnce()
to explicit strict counts:
exactly(5)
in
testTargetStaleChunksFirst
once()
in
testOnlyHighPriorityEntitiesToProcess
isBatchStillInProgress
:
Changed expectation from
atLeast(2)
to
exactly(14)
.
extractEntityIdsFromBatch
:
Changed expectation from
atLeast($z)
to
exactly($z + 1)
.
Good response
Bad response
Share & export
Copy
Show more options
Copy prompt
You said review PR, non test files and try to find some potential issues and bottlenecks
You said
review PR, non test files and try to find some potential issues and bottlenecks
Listen
Show thinking
Gemini said
Gemini said
I’d be happy to review the main source files for potential issues and performance bottlenecks! However, the snippet you shared previously only contained the
TargetEntitiesSelectorTest
file. I don't currently have access to the rest of the Pull Request.
Could you please paste the diff or the code for the non-test files (such as
TargetEntitiesSelector.php
) so I can take a look?
Good response
Bad response
Share & export
Copy
Show more options
Show the uploaded image in a lightbox
Copy prompt
Edit
You said Make code review
You said
Make code review
Listen
Show thinking
Gemini said
Gemini said
Based on the provided diff of the non-test files, you are refactoring the codebase to use dynamic chunk sizing driven by configuration rather than hardcoded class constants.
Here is a code review focusing on potential issues, bugs, and performance bottlenecks introduced in this PR.
1. Critical Bug: Potential Negative Limit for Redis spop
1. Critical Bug: Potential Negative Limit for Redis
spop...
|
Firefox
|
JY 20893 chunk control per update target by Vasil- JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12086/changes#diff-aa0 github.com/jiminny/app/pull/12086/changes#diff-aa07541aafd2d4e76eb8a184054ea800458aea58f359ef08e62155c3e301a4c4...
|
50364
|
|
50365
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Close tab
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Gemini said
Gemini said
Summary of Changes
Summary of Changes
The selected diff updates
TargetEntitiesSelectorTest
by replacing hardcoded class constants with local variables (
$mainChunkSize
and
$staleChunkSize
) to make the tests more flexible, while explicitly tightening the expected call counts on mock objects.
Detailed Modifications
Detailed Modifications
1. Test Parameterization
1. Test Parameterization
Introduced Local Variables:
Replaced references to
TargetEntitiesSelector::ES_CHUNK_SIZE
with
$mainChunkSize = 200
and
TargetEntitiesSelector::SMALL_CHUNK_SIZE
with
$staleChunkSize = 50
.
Dynamic Range and Offset Calculations:
Updated array ranges, Redis
spop
arguments, and iteration offsets to derive dynamically from these local variables instead of hardcoded class constants.
2. Mock Expectation Hardening
2. Mock Expectation Hardening
getAllScheduledBatches
:
Changed expectations from
atLeastOnce()
to explicit strict counts:
exactly(5)
in
testTargetStaleChunksFirst
once()
in
testOnlyHighPriorityEntitiesToProcess
isBatchStillInProgress
:
Changed expectation from
atLeast(2)
to
exactly(14)
.
extractEntityIdsFromBatch
:
Changed expectation from
atLeast($z)
to
exactly($z + 1)
.
Good response
Bad response
Share & export
Copy
Show more options
Copy prompt
You said review PR, non test files and try to find some potential issues and bottlenecks
You said
review PR, non test files and try to find some potential issues and bottlenecks
Listen
Show thinking
Gemini said
Gemini said
I’d be happy to review the main source files for potential issues and performance bottlenecks! However, the snippet you shared previously only contained the
TargetEntitiesSelectorTest
file. I don't currently have access to the rest of the Pull Request.
Could you please paste the diff or the code for the non-test files (such as
TargetEntitiesSelector.php
) so I can take a look?
Good response
Bad response
Share & export
Copy
Show more options
Show the uploaded image in a lightbox
Copy prompt
Edit
You said Make code review
You said
Make code review
Listen
Show thinking
Gemini said
Gemini said
Based on the provided diff of the non-test files, you are refactoring the codebase to use dynamic chunk sizing driven by configuration rather than hardcoded class constants.
Here is a code review focusing on potential issues, bugs, and performance bottlenecks introduced in this PR.
1. Critical Bug: Potential Negative Limit for Redis spop
1. Critical Bug: Potential Negative Limit for Redis
spop
In
TargetEntitiesSelector.php
, the calculation for the remaining chunk size is dangerous:
PHP
Download code
Copy code...
|
Firefox
|
JY 20893 chunk control per update target by Vasil- JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12086/changes#diff-aa0 github.com/jiminny/app/pull/12086/changes#diff-aa07541aafd2d4e76eb8a184054ea800458aea58f359ef08e62155c3e301a4c4...
|
50365
|
|
50366
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Close tab
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Gemini said
Gemini said
Summary of Changes
Summary of Changes
The selected diff updates
TargetEntitiesSelectorTest
by replacing hardcoded class constants with local variables (
$mainChunkSize
and
$staleChunkSize
) to make the tests more flexible, while explicitly tightening the expected call counts on mock objects.
Detailed Modifications
Detailed Modifications
1. Test Parameterization
1. Test Parameterization
Introduced Local Variables:
Replaced references to
TargetEntitiesSelector::ES_CHUNK_SIZE
with
$mainChunkSize = 200
and
TargetEntitiesSelector::SMALL_CHUNK_SIZE
with
$staleChunkSize = 50
.
Dynamic Range and Offset Calculations:
Updated array ranges, Redis
spop
arguments, and iteration offsets to derive dynamically from these local variables instead of hardcoded class constants.
2. Mock Expectation Hardening
2. Mock Expectation Hardening
getAllScheduledBatches
:
Changed expectations from
atLeastOnce()
to explicit strict counts:
exactly(5)
in
testTargetStaleChunksFirst
once()
in
testOnlyHighPriorityEntitiesToProcess
isBatchStillInProgress
:
Changed expectation from
atLeast(2)
to
exactly(14)
.
extractEntityIdsFromBatch
:
Changed expectation from
atLeast($z)
to
exactly($z + 1)
.
Good response
Bad response
Share & export
Copy
Show more options
Copy prompt
You said review PR, non test files and try to find some potential issues and bottlenecks
You said
review PR, non test files and try to find some potential issues and bottlenecks
Listen
Show thinking
Gemini said
Gemini said
I’d be happy to review the main source files for potential issues and performance bottlenecks! However, the snippet you shared previously only contained the
TargetEntitiesSelectorTest
file. I don't currently have access to the rest of the Pull Request.
Could you please paste the diff or the code for the non-test files (such as
TargetEntitiesSelector.php
) so I can take a look?
Good response
Bad response
Share & export
Copy
Show more options
Show the uploaded image in a lightbox
Copy prompt
Edit
You said Make code review
You said
Make code review
Listen
Show thinking
Gemini said
Gemini said
Based on the provided diff of the non-test files, you are refactoring the codebase to use dynamic chunk sizing driven by configuration rather than hardcoded class constants.
Here is a code review focusing on potential issues, bugs, and performance bottlenecks introduced in this PR.
1. Critical Bug: Potential Negative Limit for Redis spop
1. Critical Bug: Potential Negative Limit for Redis
spop
In
TargetEntitiesSelector.php
, the calculation for the remaining chunk size is dangerous:
PHP
Download code
Copy code
$limit
=
$mainChunkSize
- count(
$staleEntities
);
The Issue:
If multiple batches are in progress, the loop will extract
$staleChunkSize...
|
Firefox
|
JY 20893 chunk control per update target by Vasil- JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12086/changes#diff-aa0 github.com/jiminny/app/pull/12086/changes#diff-aa07541aafd2d4e76eb8a184054ea800458aea58f359ef08e62155c3e301a4c4...
|
50366
|
|
50367
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Close tab
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Gemini said
Gemini said
Summary of Changes
Summary of Changes
The selected diff updates
TargetEntitiesSelectorTest
by replacing hardcoded class constants with local variables (
$mainChunkSize
and
$staleChunkSize
) to make the tests more flexible, while explicitly tightening the expected call counts on mock objects.
Detailed Modifications
Detailed Modifications
1. Test Parameterization
1. Test Parameterization
Introduced Local Variables:
Replaced references to
TargetEntitiesSelector::ES_CHUNK_SIZE
with
$mainChunkSize = 200
and
TargetEntitiesSelector::SMALL_CHUNK_SIZE
with
$staleChunkSize = 50
.
Dynamic Range and Offset Calculations:
Updated array ranges, Redis
spop
arguments, and iteration offsets to derive dynamically from these local variables instead of hardcoded class constants.
2. Mock Expectation Hardening
2. Mock Expectation Hardening
getAllScheduledBatches
:
Changed expectations from
atLeastOnce()
to explicit strict counts:
exactly(5)
in
testTargetStaleChunksFirst
once()
in
testOnlyHighPriorityEntitiesToProcess
isBatchStillInProgress
:
Changed expectation from
atLeast(2)
to
exactly(14)
.
extractEntityIdsFromBatch
:
Changed expectation from
atLeast($z)
to
exactly($z + 1)
.
Good response
Bad response
Share & export
Copy
Show more options
Copy prompt
You said review PR, non test files and try to find some potential issues and bottlenecks
You said
review PR, non test files and try to find some potential issues and bottlenecks
Listen
Show thinking
Gemini said
Gemini said
I’d be happy to review the main source files for potential issues and performance bottlenecks! However, the snippet you shared previously only contained the
TargetEntitiesSelectorTest
file. I don't currently have access to the rest of the Pull Request.
Could you please paste the diff or the code for the non-test files (such as
TargetEntitiesSelector.php
) so I can take a look?
Good response
Bad response
Share & export
Copy
Show more options
Show the uploaded image in a lightbox
Copy prompt
Edit
You said Make code review
You said
Make code review
Listen
Show thinking
Gemini said
Gemini said
Based on the provided diff of the non-test files, you are refactoring the codebase to use dynamic chunk sizing driven by configuration rather than hardcoded class constants.
Here is a code review focusing on potential issues, bugs, and performance bottlenecks introduced in this PR.
1. Critical Bug: Potential Negative Limit for Redis spop
1. Critical Bug: Potential Negative Limit for Redis
spop
In
TargetEntitiesSelector.php
, the calculation for the remaining chunk size is dangerous:
PHP
Download code
Copy code
$limit
=
$mainChunkSize
- count(
$staleEntities
);
The Issue:
If multiple batches are in progress, the loop will extract
$staleChunkSize
(e.g., 50) from...
|
Firefox
|
JY 20893 chunk control per update target by Vasil- JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12086/changes#diff-aa0 github.com/jiminny/app/pull/12086/changes#diff-aa07541aafd2d4e76eb8a184054ea800458aea58f359ef08e62155c3e301a4c4...
|
50367
|
|
50368
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Close tab
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Gemini said
Gemini said
Summary of Changes
Summary of Changes
The selected diff updates
TargetEntitiesSelectorTest
by replacing hardcoded class constants with local variables (
$mainChunkSize
and
$staleChunkSize
) to make the tests more flexible, while explicitly tightening the expected call counts on mock objects.
Detailed Modifications
Detailed Modifications
1. Test Parameterization
1. Test Parameterization
Introduced Local Variables:
Replaced references to
TargetEntitiesSelector::ES_CHUNK_SIZE
with
$mainChunkSize = 200
and
TargetEntitiesSelector::SMALL_CHUNK_SIZE
with
$staleChunkSize = 50
.
Dynamic Range and Offset Calculations:
Updated array ranges, Redis
spop
arguments, and iteration offsets to derive dynamically from these local variables instead of hardcoded class constants.
2. Mock Expectation Hardening
2. Mock Expectation Hardening
getAllScheduledBatches
:
Changed expectations from
atLeastOnce()
to explicit strict counts:
exactly(5)
in
testTargetStaleChunksFirst
once()
in
testOnlyHighPriorityEntitiesToProcess
isBatchStillInProgress
:
Changed expectation from
atLeast(2)
to
exactly(14)
.
extractEntityIdsFromBatch
:
Changed expectation from
atLeast($z)
to
exactly($z + 1)
.
Good response
Bad response
Share & export
Copy
Show more options
Copy prompt
You said review PR, non test files and try to find some potential issues and bottlenecks
You said
review PR, non test files and try to find some potential issues and bottlenecks
Listen
Show thinking
Gemini said
Gemini said
I’d be happy to review the main source files for potential issues and performance bottlenecks! However, the snippet you shared previously only contained the
TargetEntitiesSelectorTest
file. I don't currently have access to the rest of the Pull Request.
Could you please paste the diff or the code for the non-test files (such as
TargetEntitiesSelector.php
) so I can take a look?
Good response
Bad response
Share & export
Copy
Show more options
Show the uploaded image in a lightbox
Copy prompt
Edit
You said Make code review
You said
Make code review...
|
Firefox
|
JY 20893 chunk control per update target by Vasil- JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12086/changes#diff-aa0 github.com/jiminny/app/pull/12086/changes#diff-aa07541aafd2d4e76eb8a184054ea800458aea58f359ef08e62155c3e301a4c4...
|
50368
|
|
50369
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Close tab
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Gemini said
Gemini said
Summary of Changes
Summary of Changes
The selected diff updates
TargetEntitiesSelectorTest
by replacing hardcoded class constants with local variables (
$mainChunkSize
and
$staleChunkSize
) to make the tests more flexible, while explicitly tightening the expected call counts on mock objects.
Detailed Modifications
Detailed Modifications
1. Test Parameterization
1. Test Parameterization
Introduced Local Variables:
Replaced references to
TargetEntitiesSelector::ES_CHUNK_SIZE
with
$mainChunkSize = 200
and
TargetEntitiesSelector::SMALL_CHUNK_SIZE
with
$staleChunkSize = 50
.
Dynamic Range and Offset Calculations:
Updated array ranges, Redis
spop
arguments, and iteration offsets to derive dynamically from these local variables instead of hardcoded class constants.
2. Mock Expectation Hardening
2. Mock Expectation Hardening
getAllScheduledBatches
:
Changed expectations from
atLeastOnce()
to explicit strict counts:
exactly(5)
in
testTargetStaleChunksFirst
once()
in
testOnlyHighPriorityEntitiesToProcess
isBatchStillInProgress
:
Changed expectation from
atLeast(2)
to
exactly(14)
.
extractEntityIdsFromBatch
:
Changed expectation from
atLeast($z)
to
exactly($z + 1)
.
Good response
Bad response
Share & export
Copy
Show more options
Copy prompt
You said review PR, non test files and try to find some potential issues and bottlenecks
You said
review PR, non test files and try to find some potential issues and bottlenecks
Listen
Show thinking
Gemini said
Gemini said
I’d be happy to review the main source files for potential issues and performance bottlenecks! However, the snippet you shared previously only contained the
TargetEntitiesSelectorTest
file. I don't currently have access to the rest of the Pull Request.
Could you please paste the diff or the code for the non-test files (such as
TargetEntitiesSelector.php
) so I can take a look?
Good response
Bad response
Share & export
Copy
Show more options
Show the uploaded image in a lightbox
Copy prompt
Edit
You said Make code review
You said
Make code review
Listen...
|
Firefox
|
JY 20893 chunk control per update target by Vasil- JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12086/changes#diff-aa0 github.com/jiminny/app/pull/12086/changes#diff-aa07541aafd2d4e76eb8a184054ea800458aea58f359ef08e62155c3e301a4c4...
|
50369
|
|
50370
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Close tab
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Gemini said
Gemini said
Summary of Changes
Summary of Changes
The selected diff updates
TargetEntitiesSelectorTest
by replacing hardcoded class constants with local variables (
$mainChunkSize
and
$staleChunkSize
) to make the tests more flexible, while explicitly tightening the expected call counts on mock objects.
Detailed Modifications
Detailed Modifications
1. Test Parameterization
1. Test Parameterization
Introduced Local Variables:
Replaced references to
TargetEntitiesSelector::ES_CHUNK_SIZE
with
$mainChunkSize = 200
and
TargetEntitiesSelector::SMALL_CHUNK_SIZE
with
$staleChunkSize = 50
.
Dynamic Range and Offset Calculations:
Updated array ranges, Redis
spop
arguments, and iteration offsets to derive dynamically from these local variables instead of hardcoded class constants.
2. Mock Expectation Hardening
2. Mock Expectation Hardening
getAllScheduledBatches
:
Changed expectations from
atLeastOnce()
to explicit strict counts:
exactly(5)
in
testTargetStaleChunksFirst
once()
in
testOnlyHighPriorityEntitiesToProcess
isBatchStillInProgress
:
Changed expectation from
atLeast(2)
to
exactly(14)
.
extractEntityIdsFromBatch
:
Changed expectation from
atLeast($z)
to
exactly($z + 1)
.
Good response
Bad response
Share & export
Copy
Show more options
Copy prompt
You said review PR, non test files and try to find some potential issues and bottlenecks
You said
review PR, non test files and try to find some potential issues and bottlenecks
Listen
Show thinking
Gemini said
Gemini said
I’d be happy to review the main source files for potential issues and performance bottlenecks! However, the snippet you shared previously only contained the
TargetEntitiesSelectorTest
file. I don't currently have access to the rest of the Pull Request.
Could you please paste the diff or the code for the non-test files (such as
TargetEntitiesSelector.php
) so I can take a look?
Good response
Bad response
Share & export
Copy
Show more options
Show the uploaded image in a lightbox
Copy prompt
Edit
You said Make code review
You said
Make code review
Listen
Show thinking
Gemini said
Gemini said
Based on the provided diff of the non-test files, you are refactoring the codebase to use dynamic chunk sizing driven by configuration rather than hardcoded class constants.
Here is a code review focusing on potential issues, bugs, and performance bottlenecks introduced in this PR.
1. Critical Bug: Potential Negative Limit for Redis spop
1. Critical Bug: Potential Negative Limit for Redis
spop
In
TargetEntitiesSelector.php
, the calculation for the remaining chunk size is dangerous:...
|
Firefox
|
JY 20893 chunk control per update target by Vasil- JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12086/changes#diff-aa0 github.com/jiminny/app/pull/12086/changes#diff-aa07541aafd2d4e76eb8a184054ea800458aea58f359ef08e62155c3e301a4c4...
|
50370
|
|
50371
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Close tab
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Gemini said
Gemini said
Summary of Changes
Summary of Changes
The selected diff updates
TargetEntitiesSelectorTest
by replacing hardcoded class constants with local variables (
$mainChunkSize
and
$staleChunkSize
) to make the tests more flexible, while explicitly tightening the expected call counts on mock objects.
Detailed Modifications
Detailed Modifications
1. Test Parameterization
1. Test Parameterization
Introduced Local Variables:
Replaced references to
TargetEntitiesSelector::ES_CHUNK_SIZE
with
$mainChunkSize = 200
and
TargetEntitiesSelector::SMALL_CHUNK_SIZE
with
$staleChunkSize = 50
.
Dynamic Range and Offset Calculations:
Updated array ranges, Redis
spop
arguments, and iteration offsets to derive dynamically from these local variables instead of hardcoded class constants.
2. Mock Expectation Hardening
2. Mock Expectation Hardening
getAllScheduledBatches
:
Changed expectations from
atLeastOnce()
to explicit strict counts:
exactly(5)
in
testTargetStaleChunksFirst
once()
in
testOnlyHighPriorityEntitiesToProcess
isBatchStillInProgress
:
Changed expectation from
atLeast(2)
to
exactly(14)
.
extractEntityIdsFromBatch
:
Changed expectation from
atLeast($z)
to
exactly($z + 1)
.
Good response
Bad response
Share & export
Copy
Show more options...
|
Firefox
|
JY 20893 chunk control per update target by Vasil- JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12086/changes#diff-aa0 github.com/jiminny/app/pull/12086/changes#diff-aa07541aafd2d4e76eb8a184054ea800458aea58f359ef08e62155c3e301a4c4...
|
50371
|
|
50372
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Close tab
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Gemini said
Gemini said
Summary of Changes
Summary of Changes
The selected diff updates
TargetEntitiesSelectorTest
by replacing hardcoded class constants with local variables (
$mainChunkSize
and
$staleChunkSize
) to make the tests more flexible, while explicitly tightening the expected call counts on mock objects.
Detailed Modifications
Detailed Modifications
1. Test Parameterization
1. Test Parameterization
Introduced Local Variables:
Replaced references to
TargetEntitiesSelector::ES_CHUNK_SIZE
with
$mainChunkSize = 200
and
TargetEntitiesSelector::SMALL_CHUNK_SIZE
with
$staleChunkSize = 50
.
Dynamic Range and Offset Calculations:
Updated array ranges, Redis
spop
arguments, and iteration offsets to derive dynamically from these local variables instead of hardcoded class constants.
2. Mock Expectation Hardening
2. Mock Expectation Hardening
getAllScheduledBatches
:
Changed expectations from
atLeastOnce()
to explicit strict counts:
exactly(5)
in
testTargetStaleChunksFirst
once()
in
testOnlyHighPriorityEntitiesToProcess
isBatchStillInProgress
:
Changed expectation from
atLeast(2)
to
exactly(14)
.
extractEntityIdsFromBatch
:
Changed expectation from
atLeast($z)
to
exactly($z + 1)
.
Good response
Bad response
Share & export
Copy
Show more options
Copy prompt
You said review PR, non test files and try to find some potential issues and bottlenecks
You said
review PR, non test files and try to find some potential issues and bottlenecks
Listen
Show thinking
Gemini said
Gemini said
I’d be happy to review the main source files for potential issues and performance bottlenecks! However, the snippet you shared previously only contained the
TargetEntitiesSelectorTest
file. I don't currently have access to the rest of the Pull Request.
Could you please paste the diff or the code for the non-test files (such as
TargetEntitiesSelector.php
) so I can take a look?
Good response
Bad response
Share & export
Copy
Show more options
Show the uploaded image in a lightbox
Copy prompt
Edit
You said Make code review
You said
Make code review
Listen
Show thinking
Gemini said
Gemini said
Based on the provided diff of the non-test files, you are refactoring the codebase to use dynamic chunk sizing driven by configuration rather than hardcoded class constants.
Here is a code review focusing on potential issues, bugs, and performance bottlenecks introduced in this PR.
1. Critical Bug: Potential Negative Limit for Redis spop
1. Critical Bug: Potential Negative Limit for Redis
spop
In
TargetEntitiesSelector.php
, the calculation for the remaining chunk size is dangerous:
PHP
Download code
Copy code
$limit
=
$mainChunkSize
- count(
$staleEntities...
|
Firefox
|
JY 20893 chunk control per update target by Vasil- JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12086/changes#diff-aa0 github.com/jiminny/app/pull/12086/changes#diff-aa07541aafd2d4e76eb8a184054ea800458aea58f359ef08e62155c3e301a4c4...
|
50372
|
|
50373
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Close tab
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Gemini said
Gemini said
Summary of Changes
Summary of Changes
The selected diff updates
TargetEntitiesSelectorTest
by replacing hardcoded class constants with local variables (
$mainChunkSize
and
$staleChunkSize
) to make the tests more flexible, while explicitly tightening the expected call counts on mock objects.
Detailed Modifications
Detailed Modifications
1. Test Parameterization
1. Test Parameterization
Introduced Local Variables:
Replaced references to
TargetEntitiesSelector::ES_CHUNK_SIZE
with
$mainChunkSize = 200
and
TargetEntitiesSelector::SMALL_CHUNK_SIZE
with
$staleChunkSize = 50
.
Dynamic Range and Offset Calculations:
Updated array ranges, Redis
spop
arguments, and iteration offsets to derive dynamically from these local variables instead of hardcoded class constants.
2. Mock Expectation Hardening
2. Mock Expectation Hardening
getAllScheduledBatches
:
Changed expectations from
atLeastOnce()
to explicit strict counts:
exactly(5)
in
testTargetStaleChunksFirst
once()
in
testOnlyHighPriorityEntitiesToProcess
isBatchStillInProgress
:
Changed expectation from
atLeast(2)
to
exactly(14)
.
extractEntityIdsFromBatch
:
Changed expectation from
atLeast($z)
to
exactly($z + 1)
.
Good response
Bad response
Share & export
Copy
Show more options
Copy prompt
You said review PR, non test files and try to find some potential issues and bottlenecks
You said
review PR, non test files and try to find some potential issues and bottlenecks
Listen
Show thinking
Gemini said
Gemini said
I’d be happy to review the main source files for potential issues and performance bottlenecks! However, the snippet you shared previously only contained the
TargetEntitiesSelectorTest
file. I don't currently have access to the rest of the Pull Request.
Could you please paste the diff or the code for the non-test files (such as
TargetEntitiesSelector.php
) so I can take a look?
Good response...
|
Firefox
|
JY 20893 chunk control per update target by Vasil- JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12086/changes#diff-aa0 github.com/jiminny/app/pull/12086/changes#diff-aa07541aafd2d4e76eb8a184054ea800458aea58f359ef08e62155c3e301a4c4...
|
50373
|
|
50374
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Close tab
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Gemini said
Gemini said
Summary of Changes
Summary of Changes
The selected diff updates
TargetEntitiesSelectorTest
by replacing hardcoded class constants with local variables (
$mainChunkSize
and
$staleChunkSize
) to make the tests more flexible, while explicitly tightening the expected call counts on mock objects.
Detailed Modifications
Detailed Modifications
1. Test Parameterization
1. Test Parameterization
Introduced Local Variables:
Replaced references to
TargetEntitiesSelector::ES_CHUNK_SIZE
with
$mainChunkSize = 200
and
TargetEntitiesSelector::SMALL_CHUNK_SIZE
with
$staleChunkSize = 50
.
Dynamic Range and Offset Calculations:
Updated array ranges, Redis
spop
arguments, and iteration offsets to derive dynamically from these local variables instead of hardcoded class constants.
2. Mock Expectation Hardening
2. Mock Expectation Hardening
getAllScheduledBatches
:
Changed expectations from
atLeastOnce()
to explicit strict counts:
exactly(5)
in
testTargetStaleChunksFirst
once()
in
testOnlyHighPriorityEntitiesToProcess
isBatchStillInProgress
:
Changed expectation from
atLeast(2)
to
exactly(14)
.
extractEntityIdsFromBatch
:
Changed expectation from
atLeast($z)
to
exactly($z + 1)
.
Good response
Bad response
Share & export
Copy
Show more options
Copy prompt
You said review PR, non test files and try to find some potential issues and bottlenecks
You said
review PR, non test files and try to find some potential issues and bottlenecks
Listen
Show thinking...
|
Firefox
|
JY 20893 chunk control per update target by Vasil- JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12086/changes#diff-aa0 github.com/jiminny/app/pull/12086/changes#diff-aa07541aafd2d4e76eb8a184054ea800458aea58f359ef08e62155c3e301a4c4...
|
50374
|
|
50375
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Close tab
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Gemini said
Gemini said
Summary of Changes
Summary of Changes
The selected diff updates
TargetEntitiesSelectorTest
by replacing hardcoded class constants with local variables (
$mainChunkSize
and
$staleChunkSize
) to make the tests more flexible, while explicitly tightening the expected call counts on mock objects.
Detailed Modifications
Detailed Modifications
1. Test Parameterization
1. Test Parameterization
Introduced Local Variables:
Replaced references to
TargetEntitiesSelector::ES_CHUNK_SIZE
with
$mainChunkSize = 200
and
TargetEntitiesSelector::SMALL_CHUNK_SIZE
with
$staleChunkSize = 50
.
Dynamic Range and Offset Calculations:
Updated array ranges, Redis
spop
arguments, and iteration offsets to derive dynamically from these local variables instead of hardcoded class constants.
2. Mock Expectation Hardening
2. Mock Expectation Hardening
getAllScheduledBatches
:
Changed expectations from
atLeastOnce()
to explicit strict counts:
exactly(5)
in
testTargetStaleChunksFirst
once()
in
testOnlyHighPriorityEntitiesToProcess
isBatchStillInProgress
:
Changed expectation from
atLeast(2)
to
exactly(14)
.
extractEntityIdsFromBatch
:
Changed expectation from
atLeast($z)
to
exactly($z + 1)
.
Good response
Bad response
Share & export
Copy
Show more options
Copy prompt
You said review PR, non test files and try to find some potential issues and bottlenecks
You said
review PR, non test files and try to find some potential issues and bottlenecks
Listen
Show thinking
Gemini said
Gemini said
I’d be happy to review the main source files for potential issues and performance bottlenecks! However, the snippet you shared previously only contained the
TargetEntitiesSelectorTest
file. I don't currently have access to the rest of the Pull Request.
Could you please paste the diff or the code for the non-test files (such as
TargetEntitiesSelector.php
) so I can take a look?
Good response
Bad response
Share & export
Copy
Show more options
Show the uploaded image in a lightbox
Copy prompt
Edit
You said Make code review
You said
Make code review
Listen
Show thinking
Gemini said
Gemini said
Based on the provided diff of the non-test files, you are refactoring the codebase to use dynamic chunk sizing driven by configuration rather than hardcoded class constants.
Here is a code review focusing on potential issues, bugs, and performance bottlenecks introduced in this PR.
1. Critical Bug: Potential Negative Limit for Redis spop
1. Critical Bug: Potential Negative Limit for Redis
spop
In
TargetEntitiesSelector.php
, the calculation for the remaining chunk size is dangerous:
PHP
Download code
Copy code
$limit
=
$mainChunkSize
- count(
$staleEntities
);
The Issue:
If multiple batches are in progress, the loop will extract
$staleChunkSize
(e.g., 50) from
each
batch. If there are 5 active batches,
$staleEntities
will contain 250 items. If
$mainChunkSize
is 200,
$limit
becomes
-50
. Passing a negative count to
Redis::spop()
will likely throw an exception or result in undefined behavior depending on your Redis client.
The Fix:
Bound the limit to zero, and avoid calling Redis altogether if the limit is exhausted. Furthermore, consider breaking out of the loop early if you've already hit your total main chunk limit.
PHP
Download code
Copy code
$limit
= max(
0
,
$mainChunkSize
- count(
$staleEntities
));
if
(
$limit
>
0
) {
$highPriorityRange
= Redis::spop(
'activities-for-update-priority'
,
$limit
);
// ...
}
2. Performance Bottleneck: array_merge Inside a Loop
2. Performance Bottleneck:
array_merge
Inside a Loop
In
TargetEntitiesSelector.php
, you are merging arrays iteratively:
PHP
Download code...
|
Firefox
|
JY 20893 chunk control per update target by Vasil- JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12086/changes#diff-aa0 github.com/jiminny/app/pull/12086/changes#diff-aa07541aafd2d4e76eb8a184054ea800458aea58f359ef08e62155c3e301a4c4...
|
50375
|
|
50376
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Close tab
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Gemini said
Gemini said
Summary of Changes
Summary of Changes
The selected diff updates
TargetEntitiesSelectorTest
by replacing hardcoded class constants with local variables (
$mainChunkSize
and
$staleChunkSize
) to make the tests more flexible, while explicitly tightening the expected call counts on mock objects.
Detailed Modifications
Detailed Modifications
1. Test Parameterization
1. Test Parameterization
Introduced Local Variables:
Replaced references to
TargetEntitiesSelector::ES_CHUNK_SIZE
with
$mainChunkSize = 200
and
TargetEntitiesSelector::SMALL_CHUNK_SIZE
with
$staleChunkSize = 50
.
Dynamic Range and Offset Calculations:
Updated array ranges, Redis
spop
arguments, and iteration offsets to derive dynamically from these local variables instead of hardcoded class constants.
2. Mock Expectation Hardening
2. Mock Expectation Hardening
getAllScheduledBatches
:
Changed expectations from
atLeastOnce()
to explicit strict counts:
exactly(5)
in
testTargetStaleChunksFirst
once()
in
testOnlyHighPriorityEntitiesToProcess
isBatchStillInProgress
:
Changed expectation from
atLeast(2)
to
exactly(14)
.
extractEntityIdsFromBatch
:
Changed expectation from
atLeast($z)
to
exactly($z + 1)
.
Good response
Bad response
Share & export
Copy
Show more options
Copy prompt
You said review PR, non test files and try to find some potential issues and bottlenecks
You said
review PR, non test files and try to find some potential issues and bottlenecks
Listen
Show thinking
Gemini said
Gemini said
I’d be happy to review the main source files for potential issues and performance bottlenecks! However, the snippet you shared previously only contained the
TargetEntitiesSelectorTest
file. I don't currently have access to the rest of the Pull Request.
Could you please paste the diff or the code for the non-test files (such as
TargetEntitiesSelector.php
) so I can take a look?
Good response
Bad response
Share & export
Copy
Show more options
Show the uploaded image in a lightbox
Copy prompt
Edit
You said Make code review
You said
Make code review
Listen
Show thinking
Gemini said
Gemini said
Based on the provided diff of the non-test files, you are refactoring the codebase to use dynamic chunk sizing driven by configuration rather than hardcoded class constants.
Here is a code review focusing on potential issues, bugs, and performance bottlenecks introduced in this PR.
1. Critical Bug: Potential Negative Limit for Redis spop
1. Critical Bug: Potential Negative Limit for Redis
spop
In
TargetEntitiesSelector.php
, the calculation for the remaining chunk size is dangerous:
PHP
Download code
Copy code
$limit
=
$mainChunkSize
- count(
$staleEntities
);
The Issue:
If multiple batches are in progress, the loop will extract
$staleChunkSize
(e.g., 50) from
each
batch. If there are 5 active batches,
$staleEntities
will contain 250 items. If
$mainChunkSize
is 200,
$limit
becomes
-50
. Passing a negative count to
Redis::spop()
will likely throw an exception or result in undefined behavior depending on your Redis client.
The Fix:
Bound the limit to zero, and avoid calling Redis altogether if the limit is exhausted. Furthermore, consider breaking out of the loop early if you've already hit your total main chunk limit.
PHP
Download code
Copy code
$limit
= max(
0
,
$mainChunkSize
- count(
$staleEntities
));
if
(
$limit...
|
Firefox
|
JY 20893 chunk control per update target by Vasil- JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12086/changes#diff-aa0 github.com/jiminny/app/pull/12086/changes#diff-aa07541aafd2d4e76eb8a184054ea800458aea58f359ef08e62155c3e301a4c4...
|
50376
|
|
50377
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira...
|
Firefox
|
JY 20893 chunk control per update target by Vasil- JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12086/changes#diff-aa0 github.com/jiminny/app/pull/12086/changes#diff-aa07541aafd2d4e76eb8a184054ea800458aea58f359ef08e62155c3e301a4c4...
|
50377
|
|
50378
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira...
|
Firefox
|
JY 20893 chunk control per update target by Vasil- JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12086/changes#diff-aa0 github.com/jiminny/app/pull/12086/changes#diff-aa07541aafd2d4e76eb8a184054ea800458aea58f359ef08e62155c3e301a4c4...
|
50378
|
|
50379
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Close tab
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Gemini said
Gemini said
Summary of Changes
Summary of Changes
The selected diff updates
TargetEntitiesSelectorTest
by replacing hardcoded class constants with local variables (
$mainChunkSize
and
$staleChunkSize
) to make the tests more flexible, while explicitly tightening the expected call counts on mock objects.
Detailed Modifications
Detailed Modifications
1. Test Parameterization
1. Test Parameterization
Introduced Local Variables:
Replaced references to
TargetEntitiesSelector::ES_CHUNK_SIZE
with
$mainChunkSize = 200
and
TargetEntitiesSelector::SMALL_CHUNK_SIZE
with
$staleChunkSize = 50
.
Dynamic Range and Offset Calculations:
Updated array ranges, Redis
spop
arguments, and iteration offsets to derive dynamically from these local variables instead of hardcoded class constants.
2. Mock Expectation Hardening
2. Mock Expectation Hardening
getAllScheduledBatches
:
Changed expectations from
atLeastOnce()
to explicit strict counts:
exactly(5)
in
testTargetStaleChunksFirst
once()
in
testOnlyHighPriorityEntitiesToProcess
isBatchStillInProgress
:
Changed expectation from
atLeast(2)
to
exactly(14)
.
extractEntityIdsFromBatch
:
Changed expectation from
atLeast($z)
to
exactly($z + 1)
.
Good response
Bad response
Share & export
Copy
Show more options
Copy prompt
You said review PR, non test files and try to find some potential issues and bottlenecks
You said
review PR, non test files and try to find some potential issues and bottlenecks
Listen
Show thinking
Gemini said
Gemini said
I’d be happy to review the main source files for potential issues and performance bottlenecks! However, the snippet you shared previously only contained the
TargetEntitiesSelectorTest
file. I don't currently have access to the rest of the Pull Request.
Could you please paste the diff or the code for the non-test files (such as
TargetEntitiesSelector.php
) so I can take a look?
Good response
Bad response
Share & export
Copy
Show more options
Show the uploaded image in a lightbox
Copy prompt
Edit
You said Make code review
You said
Make code review...
|
Firefox
|
JY 20893 chunk control per update target by Vasil- JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12086/changes#diff-aa0 github.com/jiminny/app/pull/12086/changes#diff-aa07541aafd2d4e76eb8a184054ea800458aea58f359ef08e62155c3e301a4c4...
|
50379
|
|
50380
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Close tab
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected....
|
Firefox
|
JY 20893 chunk control per update target by Vasil- JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12086/changes#diff-aa0 github.com/jiminny/app/pull/12086/changes#diff-aa07541aafd2d4e76eb8a184054ea800458aea58f359ef08e62155c3e301a4c4...
|
50380
|
|
50381
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Close tab
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices...
|
Firefox
|
JY 20893 chunk control per update target by Vasil- JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12086/changes#diff-aa0 github.com/jiminny/app/pull/12086/changes#diff-aa07541aafd2d4e76eb8a184054ea800458aea58f359ef08e62155c3e301a4c4...
|
50381
|
|
50382
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Close tab
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Gemini said
Gemini said
Summary of Changes
Summary of Changes
The selected diff updates
TargetEntitiesSelectorTest
by replacing hardcoded class constants with local variables (
$mainChunkSize
and
$staleChunkSize
) to make the tests more flexible, while explicitly tightening the expected call counts on mock objects.
Detailed Modifications
Detailed Modifications
1. Test Parameterization
1. Test Parameterization
Introduced Local Variables:
Replaced references to
TargetEntitiesSelector::ES_CHUNK_SIZE
with
$mainChunkSize = 200
and
TargetEntitiesSelector::SMALL_CHUNK_SIZE
with
$staleChunkSize = 50
.
Dynamic Range and Offset Calculations:
Updated array ranges, Redis
spop
arguments, and iteration offsets to derive dynamically from these local variables instead of hardcoded class constants....
|
Firefox
|
JY 20893 chunk control per update target by Vasil- JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12086/changes#diff-aa0 github.com/jiminny/app/pull/12086/changes#diff-aa07541aafd2d4e76eb8a184054ea800458aea58f359ef08e62155c3e301a4c4...
|
50382
|
|
50383
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Close tab
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Gemini said
Gemini said
Summary of Changes
Summary of Changes
The selected diff updates
TargetEntitiesSelectorTest
by replacing hardcoded class constants with local variables (
$mainChunkSize
and
$staleChunkSize
) to make the tests more flexible, while explicitly tightening the expected call counts on mock objects.
Detailed Modifications
Detailed Modifications
1. Test Parameterization
1. Test Parameterization
Introduced Local Variables:
Replaced references to
TargetEntitiesSelector::ES_CHUNK_SIZE
with
$mainChunkSize = 200
and
TargetEntitiesSelector::SMALL_CHUNK_SIZE
with
$staleChunkSize = 50
.
Dynamic Range and Offset Calculations:
Updated array ranges, Redis
spop
arguments, and iteration offsets to derive dynamically from these local variables instead of hardcoded class constants.
2. Mock Expectation Hardening
2. Mock Expectation Hardening
getAllScheduledBatches
:
Changed expectations from
atLeastOnce()
to explicit strict counts:
exactly(5)
in
testTargetStaleChunksFirst
once()
in
testOnlyHighPriorityEntitiesToProcess
isBatchStillInProgress
:
Changed expectation from
atLeast(2)
to
exactly(14)
.
extractEntityIdsFromBatch
:
Changed expectation from
atLeast($z)
to
exactly($z + 1)
.
Good response
Bad response
Share & export
Copy
Show more options
Copy prompt
You said review PR, non test files and try to find some potential issues and bottlenecks
You said
review PR, non test files and try to find some potential issues and bottlenecks
Listen
Show thinking
Gemini said
Gemini said
I’d be happy to review the main source files for potential issues and performance bottlenecks! However, the snippet you shared previously only contained the
TargetEntitiesSelectorTest
file. I don't currently have access to the rest of the Pull Request.
Could you please paste the diff or the code for the non-test files (such as
TargetEntitiesSelector.php
) so I can take a look?
Good response
Bad response
Share & export
Copy
Show more options
Show the uploaded image in a lightbox
Copy prompt
Edit...
|
Firefox
|
JY 20893 chunk control per update target by Vasil- JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12086/changes#diff-aa0 github.com/jiminny/app/pull/12086/changes#diff-aa07541aafd2d4e76eb8a184054ea800458aea58f359ef08e62155c3e301a4c4...
|
50383
|
|
50384
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Close tab
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Gemini said
Gemini said
Summary of Changes
Summary of Changes
The selected diff updates
TargetEntitiesSelectorTest
by replacing hardcoded class constants with local variables (
$mainChunkSize
and
$staleChunkSize
) to make the tests more flexible, while explicitly tightening the expected call counts on mock objects.
Detailed Modifications
Detailed Modifications
1. Test Parameterization
1. Test Parameterization
Introduced Local Variables:
Replaced references to
TargetEntitiesSelector::ES_CHUNK_SIZE
with
$mainChunkSize = 200
and
TargetEntitiesSelector::SMALL_CHUNK_SIZE...
|
Firefox
|
JY 20893 chunk control per update target by Vasil- JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12086/changes#diff-aa0 github.com/jiminny/app/pull/12086/changes#diff-aa07541aafd2d4e76eb8a184054ea800458aea58f359ef08e62155c3e301a4c4...
|
50384
|
|
50385
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Close tab
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Gemini said
Gemini said
Summary of Changes
Summary of Changes
The selected diff updates
TargetEntitiesSelectorTest
by replacing hardcoded class constants with local variables (
$mainChunkSize
and
$staleChunkSize
) to make the tests more flexible, while explicitly tightening the expected call counts on mock objects.
Detailed Modifications
Detailed Modifications
1. Test Parameterization
1. Test Parameterization
Introduced Local Variables:
Replaced references to
TargetEntitiesSelector::ES_CHUNK_SIZE
with
$mainChunkSize = 200...
|
Firefox
|
JY 20893 chunk control per update target by Vasil- JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12086/changes#diff-aa0 github.com/jiminny/app/pull/12086/changes#diff-aa07541aafd2d4e76eb8a184054ea800458aea58f359ef08e62155c3e301a4c4...
|
50385
|
|
50386
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Close tab
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Gemini said
Gemini said
Summary of Changes
Summary of Changes
The selected diff updates
TargetEntitiesSelectorTest
by replacing hardcoded class constants with local variables (
$mainChunkSize
and
$staleChunkSize
) to make the tests more flexible, while explicitly tightening the expected call counts on mock objects.
Detailed Modifications
Detailed Modifications
1. Test Parameterization
1. Test Parameterization
Introduced Local Variables:
Replaced references to
TargetEntitiesSelector::ES_CHUNK_SIZE
with
$mainChunkSize = 200
and
TargetEntitiesSelector::SMALL_CHUNK_SIZE
with
$staleChunkSize = 50
.
Dynamic Range and Offset Calculations:
Updated array ranges, Redis
spop
arguments, and iteration offsets to derive dynamically from these local variables instead of hardcoded class constants.
2. Mock Expectation Hardening
2. Mock Expectation Hardening
getAllScheduledBatches
:
Changed expectations from
atLeastOnce()
to explicit strict counts:
exactly(5)
in
testTargetStaleChunksFirst
once()
in
testOnlyHighPriorityEntitiesToProcess
isBatchStillInProgress
:
Changed expectation from
atLeast(2)
to
exactly(14)
.
extractEntityIdsFromBatch
:
Changed expectation from
atLeast($z)
to
exactly($z + 1)
.
Good response
Bad response
Share & export
Copy
Show more options
Copy prompt
You said review PR, non test files and try to find some potential issues and bottlenecks
You said
review PR, non test files and try to find some potential issues and bottlenecks
Listen
Show thinking
Gemini said
Gemini said
I’d be happy to review the main source files for potential issues and performance bottlenecks! However, the snippet you shared previously only contained the
TargetEntitiesSelectorTest
file. I don't currently have access to the rest of the Pull Request.
Could you please paste the diff or the code for the non-test files (such as
TargetEntitiesSelector.php
) so I can take a look?
Good response
Bad response
Share & export
Copy
Show more options
Show the uploaded image in a lightbox
Copy prompt
Edit
You said Make code review
You said
Make code review
Listen
Show thinking
Gemini said
Gemini said
Based on the provided diff of the non-test files, you are refactoring the codebase to use dynamic chunk sizing driven by configuration rather than hardcoded class constants.
Here is a code review focusing on potential issues, bugs, and performance bottlenecks introduced in this PR.
1. Critical Bug: Potential Negative Limit for Redis spop
1. Critical Bug: Potential Negative Limit for Redis
spop
In
TargetEntitiesSelector.php
, the calculation for the remaining chunk size is dangerous:
PHP
Download code
Copy code
$limit
=
$mainChunkSize
- count(
$staleEntities
);
The Issue:
If multiple batches are in progress, the loop will extract
$staleChunkSize
(e.g., 50) from
each
batch. If there are 5 active batches,
$staleEntities
will contain 250 items. If
$mainChunkSize
is 200,
$limit
becomes
-50
. Passing a negative count to
Redis::spop()
will likely throw an exception or result in undefined behavior depending on your Redis client.
The Fix:
Bound the limit to zero, and avoid calling Redis altogether if the limit is exhausted. Furthermore, consider breaking out of the loop early if you've already hit your total main chunk limit.
PHP
Download code
Copy code
$limit
= max(
0
,
$mainChunkSize
- count(
$staleEntities
));
if
(
$limit
>
0
) {
$highPriorityRange
= Redis::spop(
'activities-for-update-priority'
,
$limit
);
// ...
}
2. Performance Bottleneck: array_merge Inside a Loop
2. Performance Bottleneck:
array_merge
Inside a Loop
In
TargetEntitiesSelector.php
, you are merging arrays iteratively:
PHP...
|
Firefox
|
JY 20893 chunk control per update target by Vasil- JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12086/changes#diff-aa0 github.com/jiminny/app/pull/12086/changes#diff-aa07541aafd2d4e76eb8a184054ea800458aea58f359ef08e62155c3e301a4c4...
|
50386
|
|
50389
|
[JY-20906] Review of Pipedrive SDK - Jira
jiminny. [JY-20906] Review of Pipedrive SDK - Jira
jiminny.atlassian.net
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Close tab
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Close tab
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Gemini said
Gemini said
Summary of Changes
Summary of Changes
The selected diff updates
TargetEntitiesSelectorTest
by replacing hardcoded class constants with local variables (
$mainChunkSize
and
$staleChunkSize
) to make the tests more flexible, while explicitly tightening the expected call counts on mock objects.
Detailed Modifications
Detailed Modifications
1. Test Parameterization
1. Test Parameterization
Introduced Local Variables:
Replaced references to
TargetEntitiesSelector::ES_CHUNK_SIZE
with
$mainChunkSize = 200
and
TargetEntitiesSelector::SMALL_CHUNK_SIZE
with
$staleChunkSize = 50
.
Dynamic Range and Offset Calculations:
Updated array ranges, Redis
spop
arguments, and iteration offsets to derive dynamically from these local variables instead of hardcoded class constants.
2. Mock Expectation Hardening
2. Mock Expectation Hardening
getAllScheduledBatches
:
Changed expectations from
atLeastOnce()
to explicit strict counts:
exactly(5)
in
testTargetStaleChunksFirst
once()
in
testOnlyHighPriorityEntitiesToProcess
isBatchStillInProgress
:
Changed expectation from
atLeast(2)
to
exactly(14)
.
extractEntityIdsFromBatch
:
Changed expectation from
atLeast($z)
to
exactly($z + 1)
.
Good response
Bad response
Share & export
Copy
Show more options
Copy prompt
You said review PR, non test files and try to find some potential issues and bottlenecks
You said
review PR, non test files and try to find some potential issues and bottlenecks
Listen
Show thinking
Gemini said
Gemini said
I’d be happy to review the main source files for potential issues and performance bottlenecks! However, the snippet you shared previously only contained the
TargetEntitiesSelectorTest
file. I don't currently have access to the rest of the Pull Request.
Could you please paste the diff or the code for the non-test files (such as
TargetEntitiesSelector.php
) so I can take a look?
Good response
Bad response
Share & export
Copy
Show more options
Show the uploaded image in a lightbox
Copy prompt
You said Make code review
You said
Make code review
Listen
Show thinking...
|
Firefox
|
JY 20893 chunk control per update target by Vasil- JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12086/changes#diff-aa0 github.com/jiminny/app/pull/12086/changes#diff-aa07541aafd2d4e76eb8a184054ea800458aea58f359ef08e62155c3e301a4c4...
|
50389
|
|
50390
|
[JY-20906] Review of Pipedrive SDK - Jira
jiminny. [JY-20906] Review of Pipedrive SDK - Jira
jiminny.atlassian.net
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Close tab
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Close tab
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Gemini said
Gemini said
Summary of Changes
Summary of Changes
The selected diff updates
TargetEntitiesSelectorTest
by replacing hardcoded class constants with local variables (
$mainChunkSize
and
$staleChunkSize
) to make the tests more flexible, while explicitly tightening the expected call counts on mock objects.
Detailed Modifications
Detailed Modifications
1. Test Parameterization
1. Test Parameterization
Introduced Local Variables:
Replaced references to
TargetEntitiesSelector::ES_CHUNK_SIZE
with
$mainChunkSize = 200
and
TargetEntitiesSelector::SMALL_CHUNK_SIZE
with
$staleChunkSize = 50
.
Dynamic Range and Offset Calculations:
Updated array ranges, Redis
spop
arguments, and iteration offsets to derive dynamically from these local variables instead of hardcoded class constants.
2. Mock Expectation Hardening
2. Mock Expectation Hardening
getAllScheduledBatches
:
Changed expectations from
atLeastOnce()
to explicit strict counts:
exactly(5)
in
testTargetStaleChunksFirst
once()
in
testOnlyHighPriorityEntitiesToProcess
isBatchStillInProgress
:
Changed expectation from
atLeast(2)
to
exactly(14)
.
extractEntityIdsFromBatch
:
Changed expectation from
atLeast($z)
to
exactly($z + 1)
.
Good response
Bad response
Share & export
Copy
Show more options
Copy prompt
You said review PR, non test files and try to find some potential issues and bottlenecks
You said
review PR, non test files and try to find some potential issues and bottlenecks
Listen
Show thinking
Gemini said
Gemini said
I’d be happy to review the main source files for potential issues and performance bottlenecks! However, the snippet you shared previously only contained the
TargetEntitiesSelectorTest
file. I don't currently have access to the rest of the Pull Request.
Could you please paste the diff or the code for the non-test files (such as
TargetEntitiesSelector.php
) so I can take a look?
Good response
Bad response
Share & export
Copy
Show more options
Show the uploaded image in a lightbox
Copy prompt
You said Make code review
You said
Make code review
Listen...
|
Firefox
|
JY 20893 chunk control per update target by Vasil- JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12086/changes#diff-aa0 github.com/jiminny/app/pull/12086/changes#diff-aa07541aafd2d4e76eb8a184054ea800458aea58f359ef08e62155c3e301a4c4...
|
50390
|