|
50292
|
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
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...
|
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
|
50292
|
|
50293
|
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
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
;...
|
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
|
50293
|
|
50294
|
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
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
Enter a prompt for Gemini
encrypted
Enter a prompt for Gemini
encrypted
Open upload file menu
Tools
Open mode picker
Fast
Microphone
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 20893 chunk control per update target #12086 Edit title
JY 20893 chunk control per update target
#
12086
Edit title
Preview
Preview
Checks pending
Checks pending
Code
Code
Open
Vasil-Jiminny
Vasil-Jiminny
wants to merge 17 commits into
master
master
from
JY-20893-chunk-control-per-update-target
JY-20893-chunk-control-per-update-target
Copy head branch name to clipboard
Lines changed: 158 additions & 35 deletions
Conversation (15)
Conversation
(
15
)
Commits (17)
Commits
(
17
)
Checks (2)
Checks
(
2
)
Files changed (6)
Files changed
(
6
)
Pull Request Toolbar
Pull Request Toolbar
Collapse file tree
All commits
All commits
0 of 6 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
DTOs
SelectionList.php
SelectionList.php
TargetEntitiesSelector.php
TargetEntitiesSelector.php
ChunkSize.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
|
50294
|
|
50295
|
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
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
Enter a prompt for Gemini
encrypted
Enter a prompt for Gemini
encrypted
Open upload file menu
Tools
Open mode picker
Fast
Microphone
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 20893 chunk control per update target #12086 Edit title
JY 20893 chunk control per update target
#
12086
Edit title
Preview
Preview
Checks pending
Checks pending
Code
Code
Open
Vasil-Jiminny
Vasil-Jiminny
wants to merge 17 commits into
master
master
from
JY-20893-chunk-control-per-update-target
JY-20893-chunk-control-per-update-target
Copy head branch name to clipboard
Lines changed: 158 additions & 35 deletions
Conversation (15)
Conversation
(
15
)
Commits (17)
Commits
(
17
)
Checks (2)
Checks
(
2
)
Files changed (6)
Files changed
(
6
)
Pull Request Toolbar
Pull Request Toolbar
Collapse file tree
All commits
All commits
0 of 6 files viewed
Submit review
Submit
review
Open diff view settings
Open overview panel
Open comments panel
(
0...
|
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
|
50295
|
|
50296
|
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
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
Enter a prompt for Gemini
encrypted
Enter a prompt for Gemini
encrypted
Open upload file menu
Tools
Open mode picker
Fast
Microphone
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...
|
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
|
50296
|
|
50297
|
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
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
Enter a prompt for Gemini
encrypted
Enter a prompt for Gemini
encrypted
Open upload file menu
Tools
Open mode picker
Fast
Microphone
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...
|
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
|
50297
|
|
50298
|
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
Gemini 3
Fast Answers quickly
Fast
Answers quickly
Thinking Solves complex problems
Thinking
Solves complex problems
Pro Advanced math and code with 3.1 Pro
Pro
Advanced math and code with 3.1 Pro
Get more from Gemini
Get our most capable models & features
Upgrade
Upgrade
Upgrade
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...
|
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
|
50298
|
|
50299
|
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
Gemini 3
Fast Answers quickly
Fast
Answers quickly
Thinking Solves complex problems
Thinking
Solves complex problems
Pro Advanced math and code with 3.1 Pro
Pro
Advanced math and code with 3.1 Pro
Get more from Gemini
Get our most capable models & features
Upgrade
Upgrade
Upgrade
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...
|
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
|
50299
|
|
50300
|
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
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
Enter a prompt for Gemini
encrypted
Enter a prompt for Gemini
encrypted
Open upload file menu
Tools
Open mode picker
Pro
Microphone
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 20893 chunk control per update target #12086 Edit title
JY 20893 chunk control per update target
#
12086
Edit title
Preview
Preview
Checks pending
Checks pending
Code
Code
Open
Vasil-Jiminny
Vasil-Jiminny
wants to merge 17 commits into
master
master
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
|
50300
|
|
50301
|
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
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
Enter a prompt for Gemini
encrypted
Enter a prompt for Gemini
encrypted
Open upload file menu
Tools
Open mode picker
Pro
Microphone
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...
|
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
|
50301
|
|
50302
|
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
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
Enter a prompt for Gemini
encrypted
Enter a prompt for Gemini
encrypted
Open upload file menu
Tools
Open mode picker
Pro
Microphone
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...
|
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
|
50302
|
|
50303
|
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
Ask Gemini
Google Account: [EMAIL]
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 20893 chunk control per update target #12086 Edit title
JY 20893 chunk control per update target
#
12086
Edit title
Preview
Preview
Checks pending
Checks pending
Code
Code
Open
Vasil-Jiminny
Vasil-Jiminny
wants to merge 17 commits into
master
master
from
JY-20893-chunk-control-per-update-target
JY-20893-chunk-control-per-update-target
Copy head branch name to clipboard
Lines changed: 158 additions & 35 deletions
Conversation (15)
Conversation
(
15
)
Commits (17)
Commits
(
17
)
Checks (2)
Checks
(
2
)
Files changed (6)
Files changed
(
6
)
Pull Request Toolbar
Pull Request Toolbar
Collapse file tree
All commits
All commits
0 of 6 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
DTOs
SelectionList.php
SelectionList.php
TargetEntitiesSelector.php
TargetEntitiesSelector.php
ChunkSize.php
ChunkSize.php
tests/Unit/Component/ES
Collapse file
app/Component/ES/Processor/DTOs/SelectionList.php
app/Component/ES/Processor/DTOs/SelectionList.php
app/Component/ES/Processor/DTOs/SelectionList.php
Copy file name to clipboard
Expand all lines: app/Component/ES/Processor/DTOs/SelectionList.php
Lines changed: 1 addition & 3 deletions
Not Viewed
Viewed
Comment on this file
More options
Original file line number
Original file line
Diff line number
Diff line change
@@ -4,8 +4,6 @@
4
4
5...
|
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
|
50303
|
|
50304
|
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
Ask Gemini
Google Account: [EMAIL]
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 20893 chunk control per update target #12086 Edit title
JY 20893 chunk control per update target
#
12086
Edit title
Preview
Preview
Checks pending
Checks pending
Code
Code
Open
Vasil-Jiminny
Vasil-Jiminny
wants to merge 17 commits into
master
master
from
JY-20893-chunk-control-per-update-target
JY-20893-chunk-control-per-update-target
Copy head branch name to clipboard
Lines changed: 158 additions & 35 deletions
Conversation (15)
Conversation
(
15
)
Commits (17)
Commits
(
17
)
Checks (2)
Checks
(
2
)
Files changed (6)
Files changed
(
6
)
Pull Request Toolbar
Pull Request Toolbar
Collapse file tree
All commits
All commits
0 of 6 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
DTOs
SelectionList.php
SelectionList.php
TargetEntitiesSelector.php
TargetEntitiesSelector.php
ChunkSize.php
ChunkSize.php
tests/Unit/Component/ES
Collapse file
app/Component/ES/Processor/DTOs/SelectionList.php
app/Component/ES/Processor/DTOs/SelectionList.php
app/Component/ES/Processor/DTOs/SelectionList.php
Copy file name to clipboard
Expand all lines: app/Component/ES/Processor/DTOs/SelectionList.php
Lines changed: 1 addition & 3 deletions...
|
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
|
50304
|
|
50305
|
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...
|
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
|
50305
|
|
50306
|
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
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
Edit
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
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
:
Enter a prompt for Gemini
encrypted
Enter a prompt for Gemini
encrypted
Open upload file menu
Tools
Open mode picker
Pro
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 20893 chunk control per update target #12086 Edit title
JY 20893 chunk control per update target
#
12086
Edit title
Preview
Preview
Checks pending
Checks pending
Code
Code
Open
Vasil-Jiminny
Vasil-Jiminny
wants to merge 17 commits into
master
master
from
JY-20893-chunk-control-per-update-target
JY-20893-chunk-control-per-update-target
Copy head branch name to clipboard
Lines changed: 158 additions & 35 deletions
Conversation (15)
Conversation
(
15
)
Commits (17)
Commits
(
17
)
Checks (2)
Checks
(
2
)
Files changed (6)
Files changed
(
6
)
Pull Request Toolbar
Pull Request Toolbar
Collapse file tree
All commits
All commits
0 of 6 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
DTOs
SelectionList.php
SelectionList.php
TargetEntitiesSelector.php
TargetEntitiesSelector.php
ChunkSize.php
ChunkSize.php
tests/Unit/Component/ES...
|
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
|
50306
|
|
50307
|
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
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
Edit
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
Redo
Share & export
Copy
Show more options
Enter a prompt for Gemini
encrypted
Enter a prompt for Gemini
encrypted
Open upload file menu
Tools
Open mode picker
Pro
Microphone
Send message
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 20893 chunk control per update target #12086 Edit title
JY 20893 chunk control per update target
#
12086
Edit title
Preview
Preview
Checks pending
Checks pending
Code
Code
Open
Vasil-Jiminny
Vasil-Jiminny
wants to merge 17 commits into
master
master
from
JY-20893-chunk-control-per-update-target
JY-20893-chunk-control-per-update-target
Copy head branch name to clipboard
Lines changed: 158 additions & 35 deletions
Conversation (15)
Conversation
(
15
)
Commits (17)
Commits
(
17
)...
|
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
|
50307
|
|
50308
|
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
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
Edit
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...
|
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
|
50308
|
|
50309
|
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
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
Edit
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...
|
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
|
50309
|
|
50310
|
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...
|
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
|
50310
|
|
50311
|
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...
|
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
|
50311
|
|
50312
|
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
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
Edit
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
Redo
Share & export
Copy
Show more options
review PR
review PR
Open upload file menu
Tools
Open mode picker
Pro
Send message
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 20893 chunk control per update target #12086 Edit title
JY 20893 chunk control per update target
#
12086
Edit title
Preview
Preview
Checks pending
Checks pending
Code
Code
Open
Vasil-Jiminny
Vasil-Jiminny
wants to merge 17 commits into
master
master
from
JY-20893-chunk-control-per-update-target
JY-20893-chunk-control-per-update-target
Copy head branch name to clipboard
Lines changed: 158 additions & 35 deletions
Conversation (15)
Conversation
(
15
)
Commits (17)
Commits
(
17
)
Checks (2)
Checks
(
2
)
Files changed (6)
Files changed
(
6
)
Pull Request Toolbar
Pull Request Toolbar
Collapse file tree
All commits
All commits...
|
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
|
50312
|
|
50313
|
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
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
Edit
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
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.
Enter a prompt for Gemini
encrypted
Enter a prompt for Gemini
encrypted
Open upload file menu
Tools
Open mode picker
Pro
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...
|
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
|
50313
|
|
50320
|
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
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
Edit
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
Redo
Share & export
Copy
Show more options
Enter a prompt for Gemini
encrypted
Enter a prompt for Gemini
encrypted
Open upload file menu
Tools
Open mode picker
Pro
Microphone
Send message
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...
|
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
|
50320
|
|
50321
|
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
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
Edit
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
Redo
Share & export
Copy
Show more options
Enter a prompt for Gemini
encrypted
Enter a prompt for Gemini
encrypted
Open upload file menu
Tools
Open mode picker
Pro
Microphone
Send message
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…...
|
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
|
50321
|
|
50322
|
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
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
Edit
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
Redo
Share & export
Copy
Show more options
Enter a prompt for Gemini
encrypted...
|
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
|
50322
|
|
50336
|
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...
|
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
|
50336
|
|
50337
|
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
rirero••0|Platform Sprint 4 Q2 - Platform Te()JY-20891 add support for seconda4 [JY-20891] Sidekick SMS issue - JJY-20915) Add environment-spew Usage | Windsurf(SRD-6853] Moxso - Potential deiPipelines - jiminny/appa Feed - jiminny - SentrfJY-209061 Review of Pipedrive SP Pioedrive API Reference and Docul•pipedrive/client-php: Pipedrive APwfiiminny/infrastructurel.JY-20623( Pull requests • jiminny/app(JY-209121 Fallback mechanism fcS 1IY-209061 Review of Pinedrive S0 JY 20893 chunk control per up X@ Jy 20918 remove redis switch for dJy 20846 mcp enable the ai to kn• github.com/• Goodle geminireview PR, non test filesand trv to tind somepotential issues andnotrienecksShow thinking vI'd be happy to review the main source files forpotential issues and performance bottlenecks!However, the snippet you shared previouslyonly contained theTargetEntitiesSelectorTest file. Idon'tcurrently have access to the rest of the PullReqliestCould vou please paste the diff or the code forthe non-test files (such asTargetEntitiesSelector.oho so l can take alook?Enter a prompt for GeminiAl lt can make mistakes so double check it Your orivacv &. GSummarize pageJY 20893 chunk control oer uodate target #12086Vasil-Jiminny wants to merge 18 commits into master from JY-20893-chunk-control-per-update-targetapp/Component/ES/ChunkSize.php [• Filter files...• • app/Component/ES|• • Processorv / DOsI₴ SelectionList.php* TargetEntitiesSelector.phpChunkSize.ohp› tests/Unit/Component/EStests/Unit/Component/ES/Processor/DT0s/SelectionListTest.php [aa -5,7 +5,6 aalnamesnace Tests\llnit\Comnonent\FS\Proceçsor\DT0s:|use liminnv\Comnonent\ FS\Proceçsor\DTOs\Selectionl ist.- use Jiminny\Component\ES\Processor\TargetEntitiesSelector:#Preparation for Refi... in 4h 33 m100% • Mon 10 May 10-2/.39C Refresh 0 / 6 viewed• Checks pending÷54 ₫0000|Viewed•••WEEEWRHTU* The most common reason tor stale records 1s 00M.* Smaller chunks allow processing the same data without hitting 00M again.private const array CHUNK_SIZES =UpdateTaraet::ACTIVITY =>self::MAIN_CHUNK_KEY => 200,self::STALE CHUNK KEY => 50.UpdateTaraet::OPPORTUNITY =>self::MAIN_CHUNK_KEY => 500,self::STALE CHUNK KEY => 100,public static function getMainChunkSize(strina UpdateTargetEnum SupdateTarget: intreturn self::normalizeTargetGroup(SupdateTaraet)lself::MAIN CHUNK KEY…:public static function getStaleChunkSize(string|UpdateTargetEnum $updateTarget): intreturn self::normalizeTargetGroup($updateTarget) [self::STALE_CHUNK_KEY];private static tunction normalizelaraetgroup(strina Updatelargetznum Supdatelarget: arravsstrinalaraet = Suodatelaraet instanceot Updatelaraetznum Supdatelarget->value : Supdatelaraet:if (! array key exists(SstringTarget. self::CHUNK SIZES)) {|throw new TnvalidAraumentFycention(|sprintf('Invalid undate target "gs" selected'. SstringTarget)return self::CHunk_SIzES SstringTaraetl;+20 -7 maua Viewednamespace Tests\Unit\Component\ES\Processor\DT0s;use liminnv\Comnonent\ FS\Processor\DTOs\Selectionl ist....
|
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
|
50337
|
|
50338
|
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
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
Edit
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
Redo
Share & export
Copy
Show more options
Remove file CleanShot 2026-05-18 at [EMAIL]
Enter a prompt for Gemini
encrypted
Enter a prompt for Gemini
encrypted
Open upload file menu...
|
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
|
50338
|
|
50339
|
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
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
Edit
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...
|
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
|
50339
|
|
50340
|
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]...
|
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
|
50340
|
|
50341
|
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
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
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
|
50341
|
|
50342
|
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
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...
|
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
|
50342
|
|
50343
|
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
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
|
50343
|
|
50344
|
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
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
|
50344
|
|
50345
|
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
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
|
50345
|
|
50346
|
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
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...
|
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
|
50346
|
|
50347
|
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
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
|
50347
|
|
50348
|
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
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
:...
|
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
|
50348
|
|
50349
|
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
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...
|
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
|
50349
|
|
50350
|
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
Open menu for conversation actions....
|
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
|
50350
|
|
50351
|
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
Open menu for conversation actions....
|
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
|
50351
|
|
50352
|
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...
|
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
|
50352
|
|
50353
|
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...
|
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
|
50353
|
|
50354
|
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
|
50354
|
|
50355
|
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
|
50355
|
|
50356
|
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
|
50356
|
|
50357
|
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...
|
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
|
50357
|
|
50358
|
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
|
50358
|
|
50359
|
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...
|
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
|
50359
|
|
50360
|
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...
|
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
|
50360
|