EPMRPP-113709 || Introduce the retry_of property for JS agents#267
EPMRPP-113709 || Introduce the retry_of property for JS agents#267maria-hambardzumian wants to merge 1 commit into
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
WalkthroughThe PR implements automatic ChangesAutomatic retry_of tracking in test item lifecycle
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@lib/report-portal-client.js`:
- Around line 663-667: The code sets finishTestItemData.retry_of using
this.previousItemUuidMap.get(itemTempId) before ensuring the referenced item's
realId is populated; move or re-compute the retry_of assignment until after the
start-resolution step (i.e., after the start chain / when the previous item's
realId is available) so you never send an empty/incorrect retry_of. Concretely,
in the finish flow that builds finishTestItemData (where previousItemUuidMap,
map and finishTestItemData are used), check that this.map[previousItemTempId] &&
this.map[previousItemTempId].realId is truthy and only then set
finishTestItemData.retry_of = this.map[previousItemTempId].realId; otherwise
omit retry_of (or defer assignment until the start completion promise resolves).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 6f1f64c0-6036-4b60-ab28-bbf4845b0213
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (3)
CHANGELOG.md__tests__/report-portal-client.spec.jslib/report-portal-client.js
| // Add retry_of property if this item is a retry | ||
| const previousItemTempId = this.previousItemUuidMap.get(itemTempId); | ||
| if (previousItemTempId && this.map[previousItemTempId]) { | ||
| finishTestItemData.retry_of = this.map[previousItemTempId].realId; | ||
| } |
There was a problem hiding this comment.
Compute retry_of after start resolution to avoid invalid linkage.
On Line 664, retry_of is derived before the start-chain guarantees previousItem.realId is populated. If finishTestItem is called immediately after starting a retry, this can send an empty/incorrect retry_of and break retry linkage in the finish payload.
Proposed fix
@@
- // Add retry_of property if this item is a retry
- const previousItemTempId = this.previousItemUuidMap.get(itemTempId);
- if (previousItemTempId && this.map[previousItemTempId]) {
- finishTestItemData.retry_of = this.map[previousItemTempId].realId;
- }
@@
finishTestItemPromiseStart(itemObj, itemTempId, finishTestItemData) {
itemObj.promiseStart.then(
() => {
+ const previousItemTempId = this.previousItemUuidMap.get(itemTempId);
+ const previousItemObj = previousItemTempId && this.map[previousItemTempId];
+ if (previousItemObj && previousItemObj.realId) {
+ finishTestItemData.retry_of = previousItemObj.realId;
+ }
+
const url = ['item', itemObj.realId].join('/');
this.logDebug(`Finish test item with tempId ${itemTempId}`, itemObj);
this.restClient🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@lib/report-portal-client.js` around lines 663 - 667, The code sets
finishTestItemData.retry_of using this.previousItemUuidMap.get(itemTempId)
before ensuring the referenced item's realId is populated; move or re-compute
the retry_of assignment until after the start-resolution step (i.e., after the
start chain / when the previous item's realId is available) so you never send an
empty/incorrect retry_of. Concretely, in the finish flow that builds
finishTestItemData (where previousItemUuidMap, map and finishTestItemData are
used), check that this.map[previousItemTempId] &&
this.map[previousItemTempId].realId is truthy and only then set
finishTestItemData.retry_of = this.map[previousItemTempId].realId; otherwise
omit retry_of (or defer assignment until the start completion promise resolves).
EPMRPP-113709 — Introduce the retry_of property for JS agents
Verdict: PASS
Branch:
feat/EPMRPP-113709→developAuto-generated by ai-workflow pipeline.
Summary by CodeRabbit
New Features
retry_ofproperty in finish requests when retried, containing the UUID of the previous retry item in the chain.Tests
Documentation
retry_ofproperty behavior for retried test items.