Skip to content

EPMRPP-113709 || Introduce the retry_of property for JS agents#267

Open
maria-hambardzumian wants to merge 1 commit into
developfrom
feat/EPMRPP-113709
Open

EPMRPP-113709 || Introduce the retry_of property for JS agents#267
maria-hambardzumian wants to merge 1 commit into
developfrom
feat/EPMRPP-113709

Conversation

@maria-hambardzumian

@maria-hambardzumian maria-hambardzumian commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

EPMRPP-113709 — Introduce the retry_of property for JS agents

Verdict: PASS
Branch: feat/EPMRPP-113709develop

Auto-generated by ai-workflow pipeline.

Summary by CodeRabbit

  • New Features

    • Test items now automatically include a retry_of property in finish requests when retried, containing the UUID of the previous retry item in the chain.
  • Tests

    • Added comprehensive test coverage for retry chain cleanup, retry tracking during item start, and retry metadata propagation during item finish operations.
  • Documentation

    • Updated changelog documenting the new automatic retry_of property behavior for retried test items.

@maria-hambardzumian maria-hambardzumian added the ai-workflow Generated by ai-workflow pipeline label Jun 10, 2026
@maria-hambardzumian

maria-hambardzumian commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The PR implements automatic retry_of tracking for retried test items by introducing internal state maps in the client constructor, recording previous-item relationships during startTestItem, and injecting the prior item's UUID into finish requests, with full test coverage and changelog documentation.

Changes

Automatic retry_of tracking in test item lifecycle

Layer / File(s) Summary
Retry state initialization and cleanup
lib/report-portal-client.js, __tests__/report-portal-client.spec.js
Constructor introduces itemRetriesChainLatestTempIdMap and previousItemUuidMap to track retry relationships; cleanItemRetriesChain extends to remove previous-item mappings; tests verify state is correctly initialized and cleaned.
Retry tracking during startTestItem
lib/report-portal-client.js, __tests__/report-portal-client.spec.js
startTestItem records previous item temp IDs when retry: true and updates the latest temp ID per chain key; tests validate bookkeeping for retry vs. non-retry items and chain-key updates.
Retry_of injection during finishTestItem
lib/report-portal-client.js, __tests__/report-portal-client.spec.js
finishTestItem looks up previous item UUID from stored mappings and conditionally includes retry_of in the request payload; JSDoc updated; tests verify injection for single and multi-retry chains and handle missing previous items.
Release notes
CHANGELOG.md
Version 5.5.12 entry documents automatic retry_of property in retried test item finish requests.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Poem

🐰 A retry chain so neat and tidy,
Maps track each item, far and nidy,
Start records, finish injects with care,
Cleanup clears each map's affair,
Tests assure the bounce is true!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly references the main change: introducing the retry_of property for JS agents, which matches the core functionality added across all modified files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/EPMRPP-113709

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between f14c46d and cbf1746.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (3)
  • CHANGELOG.md
  • __tests__/report-portal-client.spec.js
  • lib/report-portal-client.js

Comment on lines +663 to +667
// 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;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-workflow Generated by ai-workflow pipeline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant