Skip to content

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

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

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

Conversation

@maria-hambardzumian

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

Copy link
Copy Markdown
Contributor

EPMRPP-113709 — Introduce the retry_of property for JS agents

Verdict: PASS_WITH_NOTES
Branch: feat/EPMRPP-113709develop

Auto-generated by ai-workflow pipeline.

Summary by CodeRabbit

  • New Features

    • Added retry and retryOf options to test item configuration, enabling server-side linking of test retry attempts.
  • Tests

    • Added comprehensive test coverage for retry linking behavior.

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

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The PR adds retry linking to the ReportPortal JavaScript client. Test items can now be marked as retries with retry: true, and the client automatically links them to the previous attempt via a retryOf UUID field, ensuring the retry request waits for the previous attempt to complete.

Changes

Retry Item Linking

Layer / File(s) Summary
Retry linking API contract
index.d.ts
StartTestItemOptions gains optional retry?: boolean and retryOf?: string fields with JSDoc documenting retry linking behavior.
Retry linking implementation
lib/report-portal-client.js
startTestItem extracts previousRetryEntry from itemRetriesChainMap, waits for its promiseStart, includes retryOf with the previous item's realId if available, and updates the chain map to store structured {promiseStart, tempId} entries.
Retry linking test suite
__tests__/report-portal-client-retry-of.spec.js
Comprehensive test coverage validates the new chain map data shape, retryOf inclusion/omission logic, promise sequencing guarantees, non-retry cases, and cleanup behavior.
Changelog entry
CHANGELOG.md
Documents the new retryOf field for linking retry attempts to their previous counterparts.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 A client so clever, retry by retry,
Tracks promises waiting, no orphans left high,
With retryOf linking, the chain stays complete,
Each attempt knows its past—now that's neat! 🎯

🚥 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 identifies the main feature being introduced: the retry_of property for JavaScript agents, matching the core changes across CHANGELOG, type definitions, tests, and implementation.
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

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

index.d.ts

Parsing error: ESLint was configured to run on <tsconfigRootDir>/index.d.ts using parserOptions.project: /tsconfig.eslint.json
However, that TSConfig does not include this file. Either:


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.

@maria-hambardzumian

maria-hambardzumian commented Jun 4, 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 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: 2

🤖 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 `@index.d.ts`:
- Around line 203-207: StartTestItemOptions is missing the optional uniqueId
property required for retry chaining; add an optional uniqueId: string field to
the StartTestItemOptions type declaration in index.d.ts and document it (JSDoc)
as the discriminator used for retry chaining so TypeScript callers can pass the
same uniqueId that lib/report-portal-client.js reads via testItemDataRQ.uniqueId
(used in the retry-chain key).

In `@lib/report-portal-client.js`:
- Around line 574-579: The current branch unconditionally overwrites
StartTestItemOptions.retryOf using previousRetryEntry->previousItem->realId,
breaking callers that explicitly set retryOf; change the logic around
previousRetryEntry (the block that assigns testItemData.retryOf) to only set
testItemData.retryOf = previousRealId when testItemData.retryOf is not already
provided (e.g., undefined/null/empty), preserving any caller-supplied
StartTestItemOptions.retryOf while still falling back to previousItem.realId
when absent.
🪄 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: de1f676b-08b7-4db7-bc89-1db563ad1e5f

📥 Commits

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

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

Comment thread index.d.ts
Comment on lines +203 to +207
/**
* Marks the test item as a retry of a previous attempt with the same
* `name`/`uniqueId` under the same parent. The client uses this flag to
* link the new attempt to the previous one via the `retryOf` field.
*/

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

Expose uniqueId if retry chaining depends on it.

The new JSDoc says retries are matched by name/uniqueId, and lib/report-portal-client.js Line 554-559 already uses testItemDataRQ.uniqueId in the retry-chain key. StartTestItemOptions still doesn't declare that field, so TS consumers can't pass the discriminator the implementation relies on without escaping the type system.

🤖 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 `@index.d.ts` around lines 203 - 207, StartTestItemOptions is missing the
optional uniqueId property required for retry chaining; add an optional
uniqueId: string field to the StartTestItemOptions type declaration in
index.d.ts and document it (JSDoc) as the discriminator used for retry chaining
so TypeScript callers can pass the same uniqueId that
lib/report-portal-client.js reads via testItemDataRQ.uniqueId (used in the
retry-chain key).

Comment on lines +574 to +579
if (previousRetryEntry) {
const previousItem = this.map[previousRetryEntry.tempId];
const previousRealId = previousItem && previousItem.realId;
if (previousRealId) {
testItemData.retryOf = previousRealId;
}

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

Preserve an explicit retryOf.

StartTestItemOptions.retryOf is public now, but this branch overwrites any caller-supplied value whenever a previous retry entry exists. That breaks the new API contract for agents that already know the previous UUID and need to send it even when local retry state is stale or reconstructed.

Proposed fix
-          if (previousRetryEntry) {
+          if (!testItemData.retryOf && previousRetryEntry) {
             const previousItem = this.map[previousRetryEntry.tempId];
             const previousRealId = previousItem && previousItem.realId;
             if (previousRealId) {
               testItemData.retryOf = previousRealId;
             }
           }
🤖 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 574 - 579, The current branch
unconditionally overwrites StartTestItemOptions.retryOf using
previousRetryEntry->previousItem->realId, breaking callers that explicitly set
retryOf; change the logic around previousRetryEntry (the block that assigns
testItemData.retryOf) to only set testItemData.retryOf = previousRealId when
testItemData.retryOf is not already provided (e.g., undefined/null/empty),
preserving any caller-supplied StartTestItemOptions.retryOf while still falling
back to previousItem.realId when absent.

@AmsterGet AmsterGet closed this Jun 9, 2026
@AmsterGet AmsterGet deleted the feat/EPMRPP-113709 branch June 9, 2026 15:58
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.

2 participants