EPMRPP-89496 || Migrate client-javascript to TypeScript - #271

Merged
maria-hambardzumian merged 10 commits into
developfrom
feature/EPMRPP-89496-migrate-to-typescript
Aug 13, 2026
Merged

EPMRPP-89496 || Migrate client-javascript to TypeScript#271
maria-hambardzumian merged 10 commits into
developfrom
feature/EPMRPP-89496-migrate-to-typescript

Conversation

@maria-hambardzumian

@maria-hambardzumianmaria-hambardzumian commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features
    • Added public import paths for constants, helpers, and models.
    • Added shared statuses, launch modes, event identifiers, and typed configuration/request models.
  • Improvements
    • Enhanced proxy handling and credential redaction in debug logs.
    • Improved OAuth error handling and request logging.
  • Build & Publishing
    • Updated published artifacts, exports, and TypeScript entrypoints.
  • Testing
    • Added TypeScript test support and expanded OAuth and REST coverage.
  • Breaking Changes
    • Removed legacy public type and module entries.

@maria-hambardzumian

maria-hambardzumian commented Jul 22, 2026

Copy link
Copy Markdown
ContributorAuthor

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

StatusScan Engine Critical High Medium LowTotal (0)
Open Source Security0000 0 issues
Code Security0000 0 issues

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

@coderabbitai

coderabbitaiBot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

The pull request migrates the client from CommonJS JavaScript to typed TypeScript. It adds public models, constants, and entrypoints. It updates runtime modules, tests, compiler settings, package exports, and publishing configuration.

Changes

TypeScript migration and public contracts

Layer / File(s)Summary
Public contracts and build layout
src/lib/models/*, src/lib/constants/*, src/types/vendor.d.ts, tsconfig.json, jest.config.js, package.json, src/models.ts, src/helpers.ts, src/constants.ts
Adds typed models, constants, vendor declarations, public entrypoints, source-based build and test settings, package exports, and generated-output rules.
Configuration, helpers, authentication, and proxy runtime
src/lib/commons/*, src/lib/helpers.ts, src/lib/logger.ts, src/lib/oauth.ts, src/lib/proxyHelper.ts, src/lib/pjson.ts, src/statistics/*
Converts runtime utilities to typed modules and updates configuration, helper, logging, OAuth, proxy, metadata, client identity, and statistics handling.
Client and REST request flow
src/lib/report-portal-client.ts, src/lib/rest.ts
Types lifecycle operations, logging, multipart uploads, retries, headers, REST responses, proxy behavior, and error handling.
Reporting, statistics, tests, and delivery checks
src/lib/publicReportingAPI.ts, src/lib/constants/events.ts, src/statistics/*, __tests__/*, .github/workflows/publish.yml, .gitignore, .eslintrc
Adds typed reporting events and statistics support, updates tests to load source modules, adds OAuth and REST coverage, adjusts lint rules, ignores emitted files, and builds before publication.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

Suggested reviewers:amsterget

Poem

A rabbit typed each launch with care,
OAuth hopped through proxy air.
Tests now follow source paths bright,
Builds prepare the package right.
Carrots compile, then publish cheer!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check nameStatusExplanationResolution
Docstring Coverage⚠️ WarningDocstring coverage is 46.15% which is insufficient. The required threshold is 80.00%.Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title clearly and concisely identifies the main change: migrating the JavaScript client to TypeScript.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/EPMRPP-89496-migrate-to-typescript

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.

@coderabbitaicoderabbitaiBot 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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/lib/oauth.ts (1)

52-60: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Honor the supplied OAuth debug option.

RestClient passes debug into this constructor, but Line 60 ignores it and reads only restClientConfig.debug. Client-level OAuth diagnostics are therefore disabled unless the nested REST option is also set.

Proposed fix
- this.debug = this.restClientConfig.debug || false;+ this.debug = config.debug ?? this.restClientConfig.debug ?? false;
🤖 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 `@src/lib/oauth.ts` around lines 52 - 60, Update the OAuthInterceptor
constructor’s debug assignment to honor the supplied OAuth-level config.debug
value passed by RestClient, while preserving the existing restClientConfig.debug
fallback when the OAuth option is absent.
🧹 Nitpick comments (2)
jest.config.js (1)

3-3: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Avoid disabling TypeScript diagnostics without a required CI typecheck.

diagnostics: false lets Jest execute code with broken TypeScript contracts, weakening the migration’s validation. Keep diagnostics enabled or ensure CI runs tsc --noEmit as a required check.

🤖 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 `@jest.config.js` at line 3, Update the ts-jest configuration in the TypeScript
transform entry to remove diagnostics: false so Jest performs TypeScript
diagnostics, or alternatively add a required CI tsc --noEmit check. Preserve the
existing tsconfig.json configuration.
.eslintrc (1)

24-27: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Scope the disabled import rules instead of disabling them globally.

Turning off import/no-unresolved and import/extensions for the entire repository can hide broken imports outside the TypeScript source. Prefer configuring the TypeScript resolver or applying overrides only to the affected files.

🤖 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 @.eslintrc around lines 24 - 27, Update the ESLint configuration entries for
import/no-unresolved and import/extensions to apply only through a
TypeScript-specific resolver or targeted file overrides, rather than disabling
them repository-wide. Preserve the existing camelcase and valid-jsdoc settings,
and ensure unaffected JavaScript files continue receiving import validation.
🤖 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 `@__tests__/oauth.spec.js`:
- Around line 5-7: The axios mock’s isAxiosError implementation in the
jest.mock('axios', ...) block incorrectly identifies errors by response
presence; match real Axios by requiring error.isAxiosError === true, and update
the test’s rejected error value to include isAxiosError: true when it represents
an AxiosError.
In `@src/lib/rest.ts`:
- Around line 53-59: Export the RestClientOptions interface so the
ConstructorParameters<typeof RestClient>[0] type used by helpers.getServerResult
remains publicly nameable during declaration emit. Change only the interface’s
visibility and preserve its existing fields and types.
---
Outside diff comments:
In `@src/lib/oauth.ts`:
- Around line 52-60: Update the OAuthInterceptor constructor’s debug assignment
to honor the supplied OAuth-level config.debug value passed by RestClient, while
preserving the existing restClientConfig.debug fallback when the OAuth option is
absent.
---
Nitpick comments:
In @.eslintrc:
- Around line 24-27: Update the ESLint configuration entries for
import/no-unresolved and import/extensions to apply only through a
TypeScript-specific resolver or targeted file overrides, rather than disabling
them repository-wide. Preserve the existing camelcase and valid-jsdoc settings,
and ensure unaffected JavaScript files continue receiving import validation.
In `@jest.config.js`:
- Line 3: Update the ts-jest configuration in the TypeScript transform entry to
remove diagnostics: false so Jest performs TypeScript diagnostics, or
alternatively add a required CI tsc --noEmit check. Preserve the existing
tsconfig.json configuration.
🪄 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: fffa4a88-0e2d-4af0-a88e-987e39f808e7

📥 Commits

Reviewing files that changed from the base of the PR and between 97b9c82 and e383ed9.

📒 Files selected for processing (49)
  • .eslintrc
  • .github/workflows/publish.yml
  • .gitignore
  • __tests__/client-id.spec.js
  • __tests__/config.spec.js
  • __tests__/helpers.spec.js
  • __tests__/oauth.spec.js
  • __tests__/proxyHelper.spec.js
  • __tests__/publicReportingAPI.spec.js
  • __tests__/report-portal-client.spec.js
  • __tests__/rest.spec.js
  • __tests__/statistics.spec.js
  • index.d.ts
  • jest.config.js
  • lib/constants/events.js
  • lib/constants/statuses.js
  • lib/publicReportingAPI.js
  • package.json
  • src/constants.ts
  • src/helpers.ts
  • src/lib/commons/config.ts
  • src/lib/commons/errors.ts
  • src/lib/constants/events.ts
  • src/lib/constants/index.ts
  • src/lib/constants/launchModes.ts
  • src/lib/constants/logLevels.ts
  • src/lib/constants/outputs.ts
  • src/lib/constants/statuses.ts
  • src/lib/constants/testItemTypes.ts
  • src/lib/helpers.ts
  • src/lib/logger.ts
  • src/lib/models/common.ts
  • src/lib/models/config.ts
  • src/lib/models/index.ts
  • src/lib/models/requests.ts
  • src/lib/models/responses.ts
  • src/lib/oauth.ts
  • src/lib/pjson.ts
  • src/lib/proxyHelper.ts
  • src/lib/publicReportingAPI.ts
  • src/lib/report-portal-client.ts
  • src/lib/rest.ts
  • src/models.ts
  • src/statistics/client-id.ts
  • src/statistics/constants.ts
  • src/statistics/statistics.ts
  • src/types/vendor.d.ts
  • statistics/constants.js
  • tsconfig.json
💤 Files with no reviewable changes (5)
  • lib/publicReportingAPI.js
  • lib/constants/statuses.js
  • statistics/constants.js
  • lib/constants/events.js
  • index.d.ts

Comment thread__tests__/oauth.spec.js Outdated
Comment threadsrc/lib/rest.ts Outdated

@coderabbitaicoderabbitaiBot 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.

🧹 Nitpick comments (1)
__tests__/oauth.spec.js (1)

403-433: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Assert the proxy wiring, not only the log.

This test proves that the proxy branch is entered, but not that axios.post receives the appropriate agent and proxy: false. Capture the request config and assert those fields to protect the actual proxy contract.

Suggested assertion
 expect(consoleSpy).toHaveBeenCalledWith(
`[OAuth] Making token request to ${baseConfig.tokenEndpoint} with proxy agent`,
'',
);
+ const requestConfig = axios.post.mock.calls[0][2];+ expect(requestConfig.proxy).toBe(false);+ expect(requestConfig.httpsAgent ?? requestConfig.httpAgent).toBeDefined();
🤖 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 `@__tests__/oauth.spec.js` around lines 403 - 433, Update the test “logs the
proxied token request when debug and proxy are both enabled” to capture the
config passed to axios.post and assert that the request uses the configured
proxy agent and sets proxy to false, while preserving the existing token and log
assertions.
🤖 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.
Nitpick comments:
In `@__tests__/oauth.spec.js`:
- Around line 403-433: Update the test “logs the proxied token request when
debug and proxy are both enabled” to capture the config passed to axios.post and
assert that the request uses the configured proxy agent and sets proxy to false,
while preserving the existing token and log assertions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: fcf07188-9241-4267-a4c8-e47ac9002ea1

📥 Commits

Reviewing files that changed from the base of the PR and between e383ed9 and 8a069ec.

📒 Files selected for processing (7)
  • .eslintrc
  • __tests__/oauth.spec.js
  • __tests__/rest.spec.js
  • src/helpers.ts
  • src/lib/commons/config.ts
  • src/lib/models/config.ts
  • src/lib/rest.ts
🚧 Files skipped from review as they are similar to previous changes (6)
  • src/helpers.ts
  • tests/rest.spec.js
  • .eslintrc
  • src/lib/models/config.ts
  • src/lib/commons/config.ts
  • src/lib/rest.ts

@coderabbitaicoderabbitaiBot 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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/lib/report-portal-client.ts (1)

375-385: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Propagate REST failures instead of converting them to success.

mergeLaunches continues with launch/merge after a search failure, using an empty launch list, and both merge and file-upload catches resolve normally. This can issue invalid merge requests and make failed log uploads appear successful.

Proposed fix
- (error): Array<string | number> => {+ (error) => {
this.logDebug(`Error during launches search with UUIDs: ${launchUUIds}`, error);
console.dir(error);
- return [];+ throw error;
},
...
.catch((error) => {
this.logDebug(`Error merging launches with UUIDs: ${launchUUIds}`, error);
console.dir(error);
+ throw error;
});
...
.catch((error) => {
this.logDebug(`Error save log with file: ${fileObj.name}`, error);
console.dir(error);
+ throw error;
});

Also applies to: 393-396, 721-734

🤖 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 `@src/lib/report-portal-client.ts` around lines 375 - 385, Update mergeLaunches
and the related file-upload error handlers to rethrow or reject REST failures
after logging instead of returning successful fallback values. In the launch
UUID search catch, do not continue to getMergeLaunchesRequest or call
launch/merge with an empty list; ensure the promise remains rejected. Apply the
same failure propagation to the catches around the upload flow at the referenced
symbols.
🤖 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.
Outside diff comments:
In `@src/lib/report-portal-client.ts`:
- Around line 375-385: Update mergeLaunches and the related file-upload error
handlers to rethrow or reject REST failures after logging instead of returning
successful fallback values. In the launch UUID search catch, do not continue to
getMergeLaunchesRequest or call launch/merge with an empty list; ensure the
promise remains rejected. Apply the same failure propagation to the catches
around the upload flow at the referenced symbols.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a827787d-3d6f-46f4-8b06-1698f26f436c

📥 Commits

Reviewing files that changed from the base of the PR and between 8a069ec and af4ffe1.

📒 Files selected for processing (3)
  • __tests__/report-portal-client.spec.js
  • src/lib/models/requests.ts
  • src/lib/report-portal-client.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • tests/report-portal-client.spec.js
  • src/lib/models/requests.ts

@AmsterGetAmsterGet left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice work!
Let's polish this before merging.
General comments:

  • pay attention to pipeline warnings
  • get rid of any
  • test this PR with the agent written on plain JS (e.g. Cypress)

Comment threadsrc/lib/helpers.ts Outdated
Comment threadsrc/lib/helpers.ts Outdated
Comment threadsrc/lib/logger.ts Outdated
Comment threadsrc/lib/proxyHelper.ts Outdated
Comment threadsrc/lib/publicReportingAPI.ts
Comment threadsrc/lib/report-portal-client.ts Outdated
Comment threadsrc/constants.ts Outdated
Comment thread.gitignore Outdated
Comment threadjest.config.js
Comment threadpackage.json Outdated

@coderabbitaicoderabbitaiBot 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.

🧹 Nitpick comments (1)
.eslintrc (1)

26-26: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Keep unresolved-import validation enabled.

Disabling import/no-unresolved globally can allow broken src and package imports to pass lint. Configure the TypeScript resolver instead, or scope this disablement only to files that genuinely require it.

🤖 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 @.eslintrc at line 26, Remove the global disablement of import/no-unresolved
in the ESLint configuration. Configure the TypeScript import resolver so valid
TypeScript and package imports resolve correctly, or narrowly scope any
remaining disablement only to files that genuinely require it.
🤖 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.
Nitpick comments:
In @.eslintrc:
- Line 26: Remove the global disablement of import/no-unresolved in the ESLint
configuration. Configure the TypeScript import resolver so valid TypeScript and
package imports resolve correctly, or narrowly scope any remaining disablement
only to files that genuinely require it.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a5b89f07-d93f-49d7-bcdd-c9a2d3ae8559

📥 Commits

Reviewing files that changed from the base of the PR and between af4ffe1 and 00c2c81.

📒 Files selected for processing (16)
  • .eslintrc
  • __tests__/helpers.spec.js
  • __tests__/report-portal-client.spec.js
  • package.json
  • src/lib/commons/config.ts
  • src/lib/constants/outputs.ts
  • src/lib/helpers.ts
  • src/lib/logger.ts
  • src/lib/models/index.ts
  • src/lib/models/reporting.ts
  • src/lib/oauth.ts
  • src/lib/proxyHelper.ts
  • src/lib/publicReportingAPI.ts
  • src/lib/report-portal-client.ts
  • src/lib/rest.ts
  • src/statistics/statistics.ts
💤 Files with no reviewable changes (6)
  • src/lib/logger.ts
  • src/lib/constants/outputs.ts
  • src/lib/oauth.ts
  • src/statistics/statistics.ts
  • src/lib/commons/config.ts
  • src/lib/rest.ts
🚧 Files skipped from review as they are similar to previous changes (5)
  • src/lib/models/index.ts
  • tests/helpers.spec.js
  • src/lib/publicReportingAPI.ts
  • src/lib/proxyHelper.ts
  • src/lib/report-portal-client.ts

Comment threadsrc/lib/models/reporting.ts Outdated
Comment threadsrc/lib/publicReportingAPI.ts
Comment threadsrc/lib/report-portal-client.ts Outdated
Comment threadsrc/lib/report-portal-client.ts Outdated
Comment threadpackage.json Outdated
@maria-hambardzumian
maria-hambardzumian merged commit f88818d into developAug 13, 2026
8 checks passed
@maria-hambardzumian
maria-hambardzumian deleted the feature/EPMRPP-89496-migrate-to-typescript branch August 13, 2026 09:49
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@maria-hambardzumian@AmsterGet
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

EPMRPP-89496 || Migrate client-javascript to TypeScript - #271

Merged
maria-hambardzumian merged 10 commits into
developfrom
feature/EPMRPP-89496-migrate-to-typescript
Aug 13, 2026
Merged

EPMRPP-89496 || Migrate client-javascript to TypeScript#271
maria-hambardzumian merged 10 commits into
developfrom
feature/EPMRPP-89496-migrate-to-typescript

Conversation

@maria-hambardzumian

@maria-hambardzumianmaria-hambardzumian commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features
    • Added public import paths for constants, helpers, and models.
    • Added shared statuses, launch modes, event identifiers, and typed configuration/request models.
  • Improvements
    • Enhanced proxy handling and credential redaction in debug logs.
    • Improved OAuth error handling and request logging.
  • Build & Publishing
    • Updated published artifacts, exports, and TypeScript entrypoints.
  • Testing
    • Added TypeScript test support and expanded OAuth and REST coverage.
  • Breaking Changes
    • Removed legacy public type and module entries.

@maria-hambardzumian

maria-hambardzumian commented Jul 22, 2026

Copy link
Copy Markdown
ContributorAuthor

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

StatusScan Engine Critical High Medium LowTotal (0)
Open Source Security0000 0 issues
Code Security0000 0 issues

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

@coderabbitai

coderabbitaiBot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

The pull request migrates the client from CommonJS JavaScript to typed TypeScript. It adds public models, constants, and entrypoints. It updates runtime modules, tests, compiler settings, package exports, and publishing configuration.

Changes

TypeScript migration and public contracts

Layer / File(s)Summary
Public contracts and build layout
src/lib/models/*, src/lib/constants/*, src/types/vendor.d.ts, tsconfig.json, jest.config.js, package.json, src/models.ts, src/helpers.ts, src/constants.ts
Adds typed models, constants, vendor declarations, public entrypoints, source-based build and test settings, package exports, and generated-output rules.
Configuration, helpers, authentication, and proxy runtime
src/lib/commons/*, src/lib/helpers.ts, src/lib/logger.ts, src/lib/oauth.ts, src/lib/proxyHelper.ts, src/lib/pjson.ts, src/statistics/*
Converts runtime utilities to typed modules and updates configuration, helper, logging, OAuth, proxy, metadata, client identity, and statistics handling.
Client and REST request flow
src/lib/report-portal-client.ts, src/lib/rest.ts
Types lifecycle operations, logging, multipart uploads, retries, headers, REST responses, proxy behavior, and error handling.
Reporting, statistics, tests, and delivery checks
src/lib/publicReportingAPI.ts, src/lib/constants/events.ts, src/statistics/*, __tests__/*, .github/workflows/publish.yml, .gitignore, .eslintrc
Adds typed reporting events and statistics support, updates tests to load source modules, adds OAuth and REST coverage, adjusts lint rules, ignores emitted files, and builds before publication.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

Suggested reviewers:amsterget

Poem

A rabbit typed each launch with care,
OAuth hopped through proxy air.
Tests now follow source paths bright,
Builds prepare the package right.
Carrots compile, then publish cheer!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check nameStatusExplanationResolution
Docstring Coverage⚠️ WarningDocstring coverage is 46.15% which is insufficient. The required threshold is 80.00%.Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title clearly and concisely identifies the main change: migrating the JavaScript client to TypeScript.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/EPMRPP-89496-migrate-to-typescript

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.

@coderabbitaicoderabbitaiBot 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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/lib/oauth.ts (1)

52-60: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Honor the supplied OAuth debug option.

RestClient passes debug into this constructor, but Line 60 ignores it and reads only restClientConfig.debug. Client-level OAuth diagnostics are therefore disabled unless the nested REST option is also set.

Proposed fix
- this.debug = this.restClientConfig.debug || false;+ this.debug = config.debug ?? this.restClientConfig.debug ?? false;
🤖 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 `@src/lib/oauth.ts` around lines 52 - 60, Update the OAuthInterceptor
constructor’s debug assignment to honor the supplied OAuth-level config.debug
value passed by RestClient, while preserving the existing restClientConfig.debug
fallback when the OAuth option is absent.
🧹 Nitpick comments (2)
jest.config.js (1)

3-3: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Avoid disabling TypeScript diagnostics without a required CI typecheck.

diagnostics: false lets Jest execute code with broken TypeScript contracts, weakening the migration’s validation. Keep diagnostics enabled or ensure CI runs tsc --noEmit as a required check.

🤖 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 `@jest.config.js` at line 3, Update the ts-jest configuration in the TypeScript
transform entry to remove diagnostics: false so Jest performs TypeScript
diagnostics, or alternatively add a required CI tsc --noEmit check. Preserve the
existing tsconfig.json configuration.
.eslintrc (1)

24-27: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Scope the disabled import rules instead of disabling them globally.

Turning off import/no-unresolved and import/extensions for the entire repository can hide broken imports outside the TypeScript source. Prefer configuring the TypeScript resolver or applying overrides only to the affected files.

🤖 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 @.eslintrc around lines 24 - 27, Update the ESLint configuration entries for
import/no-unresolved and import/extensions to apply only through a
TypeScript-specific resolver or targeted file overrides, rather than disabling
them repository-wide. Preserve the existing camelcase and valid-jsdoc settings,
and ensure unaffected JavaScript files continue receiving import validation.
🤖 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 `@__tests__/oauth.spec.js`:
- Around line 5-7: The axios mock’s isAxiosError implementation in the
jest.mock('axios', ...) block incorrectly identifies errors by response
presence; match real Axios by requiring error.isAxiosError === true, and update
the test’s rejected error value to include isAxiosError: true when it represents
an AxiosError.
In `@src/lib/rest.ts`:
- Around line 53-59: Export the RestClientOptions interface so the
ConstructorParameters<typeof RestClient>[0] type used by helpers.getServerResult
remains publicly nameable during declaration emit. Change only the interface’s
visibility and preserve its existing fields and types.
---
Outside diff comments:
In `@src/lib/oauth.ts`:
- Around line 52-60: Update the OAuthInterceptor constructor’s debug assignment
to honor the supplied OAuth-level config.debug value passed by RestClient, while
preserving the existing restClientConfig.debug fallback when the OAuth option is
absent.
---
Nitpick comments:
In @.eslintrc:
- Around line 24-27: Update the ESLint configuration entries for
import/no-unresolved and import/extensions to apply only through a
TypeScript-specific resolver or targeted file overrides, rather than disabling
them repository-wide. Preserve the existing camelcase and valid-jsdoc settings,
and ensure unaffected JavaScript files continue receiving import validation.
In `@jest.config.js`:
- Line 3: Update the ts-jest configuration in the TypeScript transform entry to
remove diagnostics: false so Jest performs TypeScript diagnostics, or
alternatively add a required CI tsc --noEmit check. Preserve the existing
tsconfig.json configuration.
🪄 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: fffa4a88-0e2d-4af0-a88e-987e39f808e7

📥 Commits

Reviewing files that changed from the base of the PR and between 97b9c82 and e383ed9.

📒 Files selected for processing (49)
  • .eslintrc
  • .github/workflows/publish.yml
  • .gitignore
  • __tests__/client-id.spec.js
  • __tests__/config.spec.js
  • __tests__/helpers.spec.js
  • __tests__/oauth.spec.js
  • __tests__/proxyHelper.spec.js
  • __tests__/publicReportingAPI.spec.js
  • __tests__/report-portal-client.spec.js
  • __tests__/rest.spec.js
  • __tests__/statistics.spec.js
  • index.d.ts
  • jest.config.js
  • lib/constants/events.js
  • lib/constants/statuses.js
  • lib/publicReportingAPI.js
  • package.json
  • src/constants.ts
  • src/helpers.ts
  • src/lib/commons/config.ts
  • src/lib/commons/errors.ts
  • src/lib/constants/events.ts
  • src/lib/constants/index.ts
  • src/lib/constants/launchModes.ts
  • src/lib/constants/logLevels.ts
  • src/lib/constants/outputs.ts
  • src/lib/constants/statuses.ts
  • src/lib/constants/testItemTypes.ts
  • src/lib/helpers.ts
  • src/lib/logger.ts
  • src/lib/models/common.ts
  • src/lib/models/config.ts
  • src/lib/models/index.ts
  • src/lib/models/requests.ts
  • src/lib/models/responses.ts
  • src/lib/oauth.ts
  • src/lib/pjson.ts
  • src/lib/proxyHelper.ts
  • src/lib/publicReportingAPI.ts
  • src/lib/report-portal-client.ts
  • src/lib/rest.ts
  • src/models.ts
  • src/statistics/client-id.ts
  • src/statistics/constants.ts
  • src/statistics/statistics.ts
  • src/types/vendor.d.ts
  • statistics/constants.js
  • tsconfig.json
💤 Files with no reviewable changes (5)
  • lib/publicReportingAPI.js
  • lib/constants/statuses.js
  • statistics/constants.js
  • lib/constants/events.js
  • index.d.ts

Comment thread__tests__/oauth.spec.js Outdated
Comment threadsrc/lib/rest.ts Outdated

@coderabbitaicoderabbitaiBot 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.

🧹 Nitpick comments (1)
__tests__/oauth.spec.js (1)

403-433: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Assert the proxy wiring, not only the log.

This test proves that the proxy branch is entered, but not that axios.post receives the appropriate agent and proxy: false. Capture the request config and assert those fields to protect the actual proxy contract.

Suggested assertion
 expect(consoleSpy).toHaveBeenCalledWith(
`[OAuth] Making token request to ${baseConfig.tokenEndpoint} with proxy agent`,
'',
);
+ const requestConfig = axios.post.mock.calls[0][2];+ expect(requestConfig.proxy).toBe(false);+ expect(requestConfig.httpsAgent ?? requestConfig.httpAgent).toBeDefined();
🤖 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 `@__tests__/oauth.spec.js` around lines 403 - 433, Update the test “logs the
proxied token request when debug and proxy are both enabled” to capture the
config passed to axios.post and assert that the request uses the configured
proxy agent and sets proxy to false, while preserving the existing token and log
assertions.
🤖 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.
Nitpick comments:
In `@__tests__/oauth.spec.js`:
- Around line 403-433: Update the test “logs the proxied token request when
debug and proxy are both enabled” to capture the config passed to axios.post and
assert that the request uses the configured proxy agent and sets proxy to false,
while preserving the existing token and log assertions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: fcf07188-9241-4267-a4c8-e47ac9002ea1

📥 Commits

Reviewing files that changed from the base of the PR and between e383ed9 and 8a069ec.

📒 Files selected for processing (7)
  • .eslintrc
  • __tests__/oauth.spec.js
  • __tests__/rest.spec.js
  • src/helpers.ts
  • src/lib/commons/config.ts
  • src/lib/models/config.ts
  • src/lib/rest.ts
🚧 Files skipped from review as they are similar to previous changes (6)
  • src/helpers.ts
  • tests/rest.spec.js
  • .eslintrc
  • src/lib/models/config.ts
  • src/lib/commons/config.ts
  • src/lib/rest.ts

@coderabbitaicoderabbitaiBot 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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/lib/report-portal-client.ts (1)

375-385: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Propagate REST failures instead of converting them to success.

mergeLaunches continues with launch/merge after a search failure, using an empty launch list, and both merge and file-upload catches resolve normally. This can issue invalid merge requests and make failed log uploads appear successful.

Proposed fix
- (error): Array<string | number> => {+ (error) => {
this.logDebug(`Error during launches search with UUIDs: ${launchUUIds}`, error);
console.dir(error);
- return [];+ throw error;
},
...
.catch((error) => {
this.logDebug(`Error merging launches with UUIDs: ${launchUUIds}`, error);
console.dir(error);
+ throw error;
});
...
.catch((error) => {
this.logDebug(`Error save log with file: ${fileObj.name}`, error);
console.dir(error);
+ throw error;
});

Also applies to: 393-396, 721-734

🤖 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 `@src/lib/report-portal-client.ts` around lines 375 - 385, Update mergeLaunches
and the related file-upload error handlers to rethrow or reject REST failures
after logging instead of returning successful fallback values. In the launch
UUID search catch, do not continue to getMergeLaunchesRequest or call
launch/merge with an empty list; ensure the promise remains rejected. Apply the
same failure propagation to the catches around the upload flow at the referenced
symbols.
🤖 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.
Outside diff comments:
In `@src/lib/report-portal-client.ts`:
- Around line 375-385: Update mergeLaunches and the related file-upload error
handlers to rethrow or reject REST failures after logging instead of returning
successful fallback values. In the launch UUID search catch, do not continue to
getMergeLaunchesRequest or call launch/merge with an empty list; ensure the
promise remains rejected. Apply the same failure propagation to the catches
around the upload flow at the referenced symbols.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a827787d-3d6f-46f4-8b06-1698f26f436c

📥 Commits

Reviewing files that changed from the base of the PR and between 8a069ec and af4ffe1.

📒 Files selected for processing (3)
  • __tests__/report-portal-client.spec.js
  • src/lib/models/requests.ts
  • src/lib/report-portal-client.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • tests/report-portal-client.spec.js
  • src/lib/models/requests.ts

@AmsterGetAmsterGet left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice work!
Let's polish this before merging.
General comments:

  • pay attention to pipeline warnings
  • get rid of any
  • test this PR with the agent written on plain JS (e.g. Cypress)

Comment threadsrc/lib/helpers.ts Outdated
Comment threadsrc/lib/helpers.ts Outdated
Comment threadsrc/lib/logger.ts Outdated
Comment threadsrc/lib/proxyHelper.ts Outdated
Comment threadsrc/lib/publicReportingAPI.ts
Comment threadsrc/lib/report-portal-client.ts Outdated
Comment threadsrc/constants.ts Outdated
Comment thread.gitignore Outdated
Comment threadjest.config.js
Comment threadpackage.json Outdated

@coderabbitaicoderabbitaiBot 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.

🧹 Nitpick comments (1)
.eslintrc (1)

26-26: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Keep unresolved-import validation enabled.

Disabling import/no-unresolved globally can allow broken src and package imports to pass lint. Configure the TypeScript resolver instead, or scope this disablement only to files that genuinely require it.

🤖 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 @.eslintrc at line 26, Remove the global disablement of import/no-unresolved
in the ESLint configuration. Configure the TypeScript import resolver so valid
TypeScript and package imports resolve correctly, or narrowly scope any
remaining disablement only to files that genuinely require it.
🤖 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.
Nitpick comments:
In @.eslintrc:
- Line 26: Remove the global disablement of import/no-unresolved in the ESLint
configuration. Configure the TypeScript import resolver so valid TypeScript and
package imports resolve correctly, or narrowly scope any remaining disablement
only to files that genuinely require it.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a5b89f07-d93f-49d7-bcdd-c9a2d3ae8559

📥 Commits

Reviewing files that changed from the base of the PR and between af4ffe1 and 00c2c81.

📒 Files selected for processing (16)
  • .eslintrc
  • __tests__/helpers.spec.js
  • __tests__/report-portal-client.spec.js
  • package.json
  • src/lib/commons/config.ts
  • src/lib/constants/outputs.ts
  • src/lib/helpers.ts
  • src/lib/logger.ts
  • src/lib/models/index.ts
  • src/lib/models/reporting.ts
  • src/lib/oauth.ts
  • src/lib/proxyHelper.ts
  • src/lib/publicReportingAPI.ts
  • src/lib/report-portal-client.ts
  • src/lib/rest.ts
  • src/statistics/statistics.ts
💤 Files with no reviewable changes (6)
  • src/lib/logger.ts
  • src/lib/constants/outputs.ts
  • src/lib/oauth.ts
  • src/statistics/statistics.ts
  • src/lib/commons/config.ts
  • src/lib/rest.ts
🚧 Files skipped from review as they are similar to previous changes (5)
  • src/lib/models/index.ts
  • tests/helpers.spec.js
  • src/lib/publicReportingAPI.ts
  • src/lib/proxyHelper.ts
  • src/lib/report-portal-client.ts

Comment threadsrc/lib/models/reporting.ts Outdated
Comment threadsrc/lib/publicReportingAPI.ts
Comment threadsrc/lib/report-portal-client.ts Outdated
Comment threadsrc/lib/report-portal-client.ts Outdated
Comment threadpackage.json Outdated
@maria-hambardzumian
maria-hambardzumian merged commit f88818d into developAug 13, 2026
8 checks passed
@maria-hambardzumian
maria-hambardzumian deleted the feature/EPMRPP-89496-migrate-to-typescript branch August 13, 2026 09:49
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@maria-hambardzumian@AmsterGet
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

EPMRPP-89496 || Migrate client-javascript to TypeScript - #271

Merged
maria-hambardzumian merged 10 commits into
developfrom
feature/EPMRPP-89496-migrate-to-typescript
Aug 13, 2026
Merged

EPMRPP-89496 || Migrate client-javascript to TypeScript#271
maria-hambardzumian merged 10 commits into
developfrom
feature/EPMRPP-89496-migrate-to-typescript

Conversation

@maria-hambardzumian

@maria-hambardzumianmaria-hambardzumian commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features
    • Added public import paths for constants, helpers, and models.
    • Added shared statuses, launch modes, event identifiers, and typed configuration/request models.
  • Improvements
    • Enhanced proxy handling and credential redaction in debug logs.
    • Improved OAuth error handling and request logging.
  • Build & Publishing
    • Updated published artifacts, exports, and TypeScript entrypoints.
  • Testing
    • Added TypeScript test support and expanded OAuth and REST coverage.
  • Breaking Changes
    • Removed legacy public type and module entries.

@maria-hambardzumian

maria-hambardzumian commented Jul 22, 2026

Copy link
Copy Markdown
ContributorAuthor

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

StatusScan Engine Critical High Medium LowTotal (0)
Open Source Security0000 0 issues
Code Security0000 0 issues

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

@coderabbitai

coderabbitaiBot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

The pull request migrates the client from CommonJS JavaScript to typed TypeScript. It adds public models, constants, and entrypoints. It updates runtime modules, tests, compiler settings, package exports, and publishing configuration.

Changes

TypeScript migration and public contracts

Layer / File(s)Summary
Public contracts and build layout
src/lib/models/*, src/lib/constants/*, src/types/vendor.d.ts, tsconfig.json, jest.config.js, package.json, src/models.ts, src/helpers.ts, src/constants.ts
Adds typed models, constants, vendor declarations, public entrypoints, source-based build and test settings, package exports, and generated-output rules.
Configuration, helpers, authentication, and proxy runtime
src/lib/commons/*, src/lib/helpers.ts, src/lib/logger.ts, src/lib/oauth.ts, src/lib/proxyHelper.ts, src/lib/pjson.ts, src/statistics/*
Converts runtime utilities to typed modules and updates configuration, helper, logging, OAuth, proxy, metadata, client identity, and statistics handling.
Client and REST request flow
src/lib/report-portal-client.ts, src/lib/rest.ts
Types lifecycle operations, logging, multipart uploads, retries, headers, REST responses, proxy behavior, and error handling.
Reporting, statistics, tests, and delivery checks
src/lib/publicReportingAPI.ts, src/lib/constants/events.ts, src/statistics/*, __tests__/*, .github/workflows/publish.yml, .gitignore, .eslintrc
Adds typed reporting events and statistics support, updates tests to load source modules, adds OAuth and REST coverage, adjusts lint rules, ignores emitted files, and builds before publication.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

Suggested reviewers:amsterget

Poem

A rabbit typed each launch with care,
OAuth hopped through proxy air.
Tests now follow source paths bright,
Builds prepare the package right.
Carrots compile, then publish cheer!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check nameStatusExplanationResolution
Docstring Coverage⚠️ WarningDocstring coverage is 46.15% which is insufficient. The required threshold is 80.00%.Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title clearly and concisely identifies the main change: migrating the JavaScript client to TypeScript.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/EPMRPP-89496-migrate-to-typescript

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.

@coderabbitaicoderabbitaiBot 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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/lib/oauth.ts (1)

52-60: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Honor the supplied OAuth debug option.

RestClient passes debug into this constructor, but Line 60 ignores it and reads only restClientConfig.debug. Client-level OAuth diagnostics are therefore disabled unless the nested REST option is also set.

Proposed fix
- this.debug = this.restClientConfig.debug || false;+ this.debug = config.debug ?? this.restClientConfig.debug ?? false;
🤖 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 `@src/lib/oauth.ts` around lines 52 - 60, Update the OAuthInterceptor
constructor’s debug assignment to honor the supplied OAuth-level config.debug
value passed by RestClient, while preserving the existing restClientConfig.debug
fallback when the OAuth option is absent.
🧹 Nitpick comments (2)
jest.config.js (1)

3-3: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Avoid disabling TypeScript diagnostics without a required CI typecheck.

diagnostics: false lets Jest execute code with broken TypeScript contracts, weakening the migration’s validation. Keep diagnostics enabled or ensure CI runs tsc --noEmit as a required check.

🤖 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 `@jest.config.js` at line 3, Update the ts-jest configuration in the TypeScript
transform entry to remove diagnostics: false so Jest performs TypeScript
diagnostics, or alternatively add a required CI tsc --noEmit check. Preserve the
existing tsconfig.json configuration.
.eslintrc (1)

24-27: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Scope the disabled import rules instead of disabling them globally.

Turning off import/no-unresolved and import/extensions for the entire repository can hide broken imports outside the TypeScript source. Prefer configuring the TypeScript resolver or applying overrides only to the affected files.

🤖 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 @.eslintrc around lines 24 - 27, Update the ESLint configuration entries for
import/no-unresolved and import/extensions to apply only through a
TypeScript-specific resolver or targeted file overrides, rather than disabling
them repository-wide. Preserve the existing camelcase and valid-jsdoc settings,
and ensure unaffected JavaScript files continue receiving import validation.
🤖 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 `@__tests__/oauth.spec.js`:
- Around line 5-7: The axios mock’s isAxiosError implementation in the
jest.mock('axios', ...) block incorrectly identifies errors by response
presence; match real Axios by requiring error.isAxiosError === true, and update
the test’s rejected error value to include isAxiosError: true when it represents
an AxiosError.
In `@src/lib/rest.ts`:
- Around line 53-59: Export the RestClientOptions interface so the
ConstructorParameters<typeof RestClient>[0] type used by helpers.getServerResult
remains publicly nameable during declaration emit. Change only the interface’s
visibility and preserve its existing fields and types.
---
Outside diff comments:
In `@src/lib/oauth.ts`:
- Around line 52-60: Update the OAuthInterceptor constructor’s debug assignment
to honor the supplied OAuth-level config.debug value passed by RestClient, while
preserving the existing restClientConfig.debug fallback when the OAuth option is
absent.
---
Nitpick comments:
In @.eslintrc:
- Around line 24-27: Update the ESLint configuration entries for
import/no-unresolved and import/extensions to apply only through a
TypeScript-specific resolver or targeted file overrides, rather than disabling
them repository-wide. Preserve the existing camelcase and valid-jsdoc settings,
and ensure unaffected JavaScript files continue receiving import validation.
In `@jest.config.js`:
- Line 3: Update the ts-jest configuration in the TypeScript transform entry to
remove diagnostics: false so Jest performs TypeScript diagnostics, or
alternatively add a required CI tsc --noEmit check. Preserve the existing
tsconfig.json configuration.
🪄 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: fffa4a88-0e2d-4af0-a88e-987e39f808e7

📥 Commits

Reviewing files that changed from the base of the PR and between 97b9c82 and e383ed9.

📒 Files selected for processing (49)
  • .eslintrc
  • .github/workflows/publish.yml
  • .gitignore
  • __tests__/client-id.spec.js
  • __tests__/config.spec.js
  • __tests__/helpers.spec.js
  • __tests__/oauth.spec.js
  • __tests__/proxyHelper.spec.js
  • __tests__/publicReportingAPI.spec.js
  • __tests__/report-portal-client.spec.js
  • __tests__/rest.spec.js
  • __tests__/statistics.spec.js
  • index.d.ts
  • jest.config.js
  • lib/constants/events.js
  • lib/constants/statuses.js
  • lib/publicReportingAPI.js
  • package.json
  • src/constants.ts
  • src/helpers.ts
  • src/lib/commons/config.ts
  • src/lib/commons/errors.ts
  • src/lib/constants/events.ts
  • src/lib/constants/index.ts
  • src/lib/constants/launchModes.ts
  • src/lib/constants/logLevels.ts
  • src/lib/constants/outputs.ts
  • src/lib/constants/statuses.ts
  • src/lib/constants/testItemTypes.ts
  • src/lib/helpers.ts
  • src/lib/logger.ts
  • src/lib/models/common.ts
  • src/lib/models/config.ts
  • src/lib/models/index.ts
  • src/lib/models/requests.ts
  • src/lib/models/responses.ts
  • src/lib/oauth.ts
  • src/lib/pjson.ts
  • src/lib/proxyHelper.ts
  • src/lib/publicReportingAPI.ts
  • src/lib/report-portal-client.ts
  • src/lib/rest.ts
  • src/models.ts
  • src/statistics/client-id.ts
  • src/statistics/constants.ts
  • src/statistics/statistics.ts
  • src/types/vendor.d.ts
  • statistics/constants.js
  • tsconfig.json
💤 Files with no reviewable changes (5)
  • lib/publicReportingAPI.js
  • lib/constants/statuses.js
  • statistics/constants.js
  • lib/constants/events.js
  • index.d.ts

Comment thread__tests__/oauth.spec.js Outdated
Comment threadsrc/lib/rest.ts Outdated

@coderabbitaicoderabbitaiBot 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.

🧹 Nitpick comments (1)
__tests__/oauth.spec.js (1)

403-433: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Assert the proxy wiring, not only the log.

This test proves that the proxy branch is entered, but not that axios.post receives the appropriate agent and proxy: false. Capture the request config and assert those fields to protect the actual proxy contract.

Suggested assertion
 expect(consoleSpy).toHaveBeenCalledWith(
`[OAuth] Making token request to ${baseConfig.tokenEndpoint} with proxy agent`,
'',
);
+ const requestConfig = axios.post.mock.calls[0][2];+ expect(requestConfig.proxy).toBe(false);+ expect(requestConfig.httpsAgent ?? requestConfig.httpAgent).toBeDefined();
🤖 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 `@__tests__/oauth.spec.js` around lines 403 - 433, Update the test “logs the
proxied token request when debug and proxy are both enabled” to capture the
config passed to axios.post and assert that the request uses the configured
proxy agent and sets proxy to false, while preserving the existing token and log
assertions.
🤖 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.
Nitpick comments:
In `@__tests__/oauth.spec.js`:
- Around line 403-433: Update the test “logs the proxied token request when
debug and proxy are both enabled” to capture the config passed to axios.post and
assert that the request uses the configured proxy agent and sets proxy to false,
while preserving the existing token and log assertions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: fcf07188-9241-4267-a4c8-e47ac9002ea1

📥 Commits

Reviewing files that changed from the base of the PR and between e383ed9 and 8a069ec.

📒 Files selected for processing (7)
  • .eslintrc
  • __tests__/oauth.spec.js
  • __tests__/rest.spec.js
  • src/helpers.ts
  • src/lib/commons/config.ts
  • src/lib/models/config.ts
  • src/lib/rest.ts
🚧 Files skipped from review as they are similar to previous changes (6)
  • src/helpers.ts
  • tests/rest.spec.js
  • .eslintrc
  • src/lib/models/config.ts
  • src/lib/commons/config.ts
  • src/lib/rest.ts

@coderabbitaicoderabbitaiBot 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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/lib/report-portal-client.ts (1)

375-385: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Propagate REST failures instead of converting them to success.

mergeLaunches continues with launch/merge after a search failure, using an empty launch list, and both merge and file-upload catches resolve normally. This can issue invalid merge requests and make failed log uploads appear successful.

Proposed fix
- (error): Array<string | number> => {+ (error) => {
this.logDebug(`Error during launches search with UUIDs: ${launchUUIds}`, error);
console.dir(error);
- return [];+ throw error;
},
...
.catch((error) => {
this.logDebug(`Error merging launches with UUIDs: ${launchUUIds}`, error);
console.dir(error);
+ throw error;
});
...
.catch((error) => {
this.logDebug(`Error save log with file: ${fileObj.name}`, error);
console.dir(error);
+ throw error;
});

Also applies to: 393-396, 721-734

🤖 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 `@src/lib/report-portal-client.ts` around lines 375 - 385, Update mergeLaunches
and the related file-upload error handlers to rethrow or reject REST failures
after logging instead of returning successful fallback values. In the launch
UUID search catch, do not continue to getMergeLaunchesRequest or call
launch/merge with an empty list; ensure the promise remains rejected. Apply the
same failure propagation to the catches around the upload flow at the referenced
symbols.
🤖 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.
Outside diff comments:
In `@src/lib/report-portal-client.ts`:
- Around line 375-385: Update mergeLaunches and the related file-upload error
handlers to rethrow or reject REST failures after logging instead of returning
successful fallback values. In the launch UUID search catch, do not continue to
getMergeLaunchesRequest or call launch/merge with an empty list; ensure the
promise remains rejected. Apply the same failure propagation to the catches
around the upload flow at the referenced symbols.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a827787d-3d6f-46f4-8b06-1698f26f436c

📥 Commits

Reviewing files that changed from the base of the PR and between 8a069ec and af4ffe1.

📒 Files selected for processing (3)
  • __tests__/report-portal-client.spec.js
  • src/lib/models/requests.ts
  • src/lib/report-portal-client.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • tests/report-portal-client.spec.js
  • src/lib/models/requests.ts

@AmsterGetAmsterGet left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice work!
Let's polish this before merging.
General comments:

  • pay attention to pipeline warnings
  • get rid of any
  • test this PR with the agent written on plain JS (e.g. Cypress)

Comment threadsrc/lib/helpers.ts Outdated
Comment threadsrc/lib/helpers.ts Outdated
Comment threadsrc/lib/logger.ts Outdated
Comment threadsrc/lib/proxyHelper.ts Outdated
Comment threadsrc/lib/publicReportingAPI.ts
Comment threadsrc/lib/report-portal-client.ts Outdated
Comment threadsrc/constants.ts Outdated
Comment thread.gitignore Outdated
Comment threadjest.config.js
Comment threadpackage.json Outdated

@coderabbitaicoderabbitaiBot 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.

🧹 Nitpick comments (1)
.eslintrc (1)

26-26: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Keep unresolved-import validation enabled.

Disabling import/no-unresolved globally can allow broken src and package imports to pass lint. Configure the TypeScript resolver instead, or scope this disablement only to files that genuinely require it.

🤖 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 @.eslintrc at line 26, Remove the global disablement of import/no-unresolved
in the ESLint configuration. Configure the TypeScript import resolver so valid
TypeScript and package imports resolve correctly, or narrowly scope any
remaining disablement only to files that genuinely require it.
🤖 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.
Nitpick comments:
In @.eslintrc:
- Line 26: Remove the global disablement of import/no-unresolved in the ESLint
configuration. Configure the TypeScript import resolver so valid TypeScript and
package imports resolve correctly, or narrowly scope any remaining disablement
only to files that genuinely require it.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a5b89f07-d93f-49d7-bcdd-c9a2d3ae8559

📥 Commits

Reviewing files that changed from the base of the PR and between af4ffe1 and 00c2c81.

📒 Files selected for processing (16)
  • .eslintrc
  • __tests__/helpers.spec.js
  • __tests__/report-portal-client.spec.js
  • package.json
  • src/lib/commons/config.ts
  • src/lib/constants/outputs.ts
  • src/lib/helpers.ts
  • src/lib/logger.ts
  • src/lib/models/index.ts
  • src/lib/models/reporting.ts
  • src/lib/oauth.ts
  • src/lib/proxyHelper.ts
  • src/lib/publicReportingAPI.ts
  • src/lib/report-portal-client.ts
  • src/lib/rest.ts
  • src/statistics/statistics.ts
💤 Files with no reviewable changes (6)
  • src/lib/logger.ts
  • src/lib/constants/outputs.ts
  • src/lib/oauth.ts
  • src/statistics/statistics.ts
  • src/lib/commons/config.ts
  • src/lib/rest.ts
🚧 Files skipped from review as they are similar to previous changes (5)
  • src/lib/models/index.ts
  • tests/helpers.spec.js
  • src/lib/publicReportingAPI.ts
  • src/lib/proxyHelper.ts
  • src/lib/report-portal-client.ts

Comment threadsrc/lib/models/reporting.ts Outdated
Comment threadsrc/lib/publicReportingAPI.ts
Comment threadsrc/lib/report-portal-client.ts Outdated
Comment threadsrc/lib/report-portal-client.ts Outdated
Comment threadpackage.json Outdated
@maria-hambardzumian
maria-hambardzumian merged commit f88818d into developAug 13, 2026
8 checks passed
@maria-hambardzumian
maria-hambardzumian deleted the feature/EPMRPP-89496-migrate-to-typescript branch August 13, 2026 09:49
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@maria-hambardzumian@AmsterGet
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

EPMRPP-89496 || Migrate client-javascript to TypeScript - #271

Merged
maria-hambardzumian merged 10 commits into
developfrom
feature/EPMRPP-89496-migrate-to-typescript
Aug 13, 2026
Merged

EPMRPP-89496 || Migrate client-javascript to TypeScript#271
maria-hambardzumian merged 10 commits into
developfrom
feature/EPMRPP-89496-migrate-to-typescript

Conversation

@maria-hambardzumian

@maria-hambardzumianmaria-hambardzumian commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features
    • Added public import paths for constants, helpers, and models.
    • Added shared statuses, launch modes, event identifiers, and typed configuration/request models.
  • Improvements
    • Enhanced proxy handling and credential redaction in debug logs.
    • Improved OAuth error handling and request logging.
  • Build & Publishing
    • Updated published artifacts, exports, and TypeScript entrypoints.
  • Testing
    • Added TypeScript test support and expanded OAuth and REST coverage.
  • Breaking Changes
    • Removed legacy public type and module entries.

@maria-hambardzumian

maria-hambardzumian commented Jul 22, 2026

Copy link
Copy Markdown
ContributorAuthor

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

StatusScan Engine Critical High Medium LowTotal (0)
Open Source Security0000 0 issues
Code Security0000 0 issues

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

@coderabbitai

coderabbitaiBot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

The pull request migrates the client from CommonJS JavaScript to typed TypeScript. It adds public models, constants, and entrypoints. It updates runtime modules, tests, compiler settings, package exports, and publishing configuration.

Changes

TypeScript migration and public contracts

Layer / File(s)Summary
Public contracts and build layout
src/lib/models/*, src/lib/constants/*, src/types/vendor.d.ts, tsconfig.json, jest.config.js, package.json, src/models.ts, src/helpers.ts, src/constants.ts
Adds typed models, constants, vendor declarations, public entrypoints, source-based build and test settings, package exports, and generated-output rules.
Configuration, helpers, authentication, and proxy runtime
src/lib/commons/*, src/lib/helpers.ts, src/lib/logger.ts, src/lib/oauth.ts, src/lib/proxyHelper.ts, src/lib/pjson.ts, src/statistics/*
Converts runtime utilities to typed modules and updates configuration, helper, logging, OAuth, proxy, metadata, client identity, and statistics handling.
Client and REST request flow
src/lib/report-portal-client.ts, src/lib/rest.ts
Types lifecycle operations, logging, multipart uploads, retries, headers, REST responses, proxy behavior, and error handling.
Reporting, statistics, tests, and delivery checks
src/lib/publicReportingAPI.ts, src/lib/constants/events.ts, src/statistics/*, __tests__/*, .github/workflows/publish.yml, .gitignore, .eslintrc
Adds typed reporting events and statistics support, updates tests to load source modules, adds OAuth and REST coverage, adjusts lint rules, ignores emitted files, and builds before publication.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

Suggested reviewers:amsterget

Poem

A rabbit typed each launch with care,
OAuth hopped through proxy air.
Tests now follow source paths bright,
Builds prepare the package right.
Carrots compile, then publish cheer!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check nameStatusExplanationResolution
Docstring Coverage⚠️ WarningDocstring coverage is 46.15% which is insufficient. The required threshold is 80.00%.Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title clearly and concisely identifies the main change: migrating the JavaScript client to TypeScript.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/EPMRPP-89496-migrate-to-typescript

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.

@coderabbitaicoderabbitaiBot 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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/lib/oauth.ts (1)

52-60: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Honor the supplied OAuth debug option.

RestClient passes debug into this constructor, but Line 60 ignores it and reads only restClientConfig.debug. Client-level OAuth diagnostics are therefore disabled unless the nested REST option is also set.

Proposed fix
- this.debug = this.restClientConfig.debug || false;+ this.debug = config.debug ?? this.restClientConfig.debug ?? false;
🤖 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 `@src/lib/oauth.ts` around lines 52 - 60, Update the OAuthInterceptor
constructor’s debug assignment to honor the supplied OAuth-level config.debug
value passed by RestClient, while preserving the existing restClientConfig.debug
fallback when the OAuth option is absent.
🧹 Nitpick comments (2)
jest.config.js (1)

3-3: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Avoid disabling TypeScript diagnostics without a required CI typecheck.

diagnostics: false lets Jest execute code with broken TypeScript contracts, weakening the migration’s validation. Keep diagnostics enabled or ensure CI runs tsc --noEmit as a required check.

🤖 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 `@jest.config.js` at line 3, Update the ts-jest configuration in the TypeScript
transform entry to remove diagnostics: false so Jest performs TypeScript
diagnostics, or alternatively add a required CI tsc --noEmit check. Preserve the
existing tsconfig.json configuration.
.eslintrc (1)

24-27: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Scope the disabled import rules instead of disabling them globally.

Turning off import/no-unresolved and import/extensions for the entire repository can hide broken imports outside the TypeScript source. Prefer configuring the TypeScript resolver or applying overrides only to the affected files.

🤖 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 @.eslintrc around lines 24 - 27, Update the ESLint configuration entries for
import/no-unresolved and import/extensions to apply only through a
TypeScript-specific resolver or targeted file overrides, rather than disabling
them repository-wide. Preserve the existing camelcase and valid-jsdoc settings,
and ensure unaffected JavaScript files continue receiving import validation.
🤖 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 `@__tests__/oauth.spec.js`:
- Around line 5-7: The axios mock’s isAxiosError implementation in the
jest.mock('axios', ...) block incorrectly identifies errors by response
presence; match real Axios by requiring error.isAxiosError === true, and update
the test’s rejected error value to include isAxiosError: true when it represents
an AxiosError.
In `@src/lib/rest.ts`:
- Around line 53-59: Export the RestClientOptions interface so the
ConstructorParameters<typeof RestClient>[0] type used by helpers.getServerResult
remains publicly nameable during declaration emit. Change only the interface’s
visibility and preserve its existing fields and types.
---
Outside diff comments:
In `@src/lib/oauth.ts`:
- Around line 52-60: Update the OAuthInterceptor constructor’s debug assignment
to honor the supplied OAuth-level config.debug value passed by RestClient, while
preserving the existing restClientConfig.debug fallback when the OAuth option is
absent.
---
Nitpick comments:
In @.eslintrc:
- Around line 24-27: Update the ESLint configuration entries for
import/no-unresolved and import/extensions to apply only through a
TypeScript-specific resolver or targeted file overrides, rather than disabling
them repository-wide. Preserve the existing camelcase and valid-jsdoc settings,
and ensure unaffected JavaScript files continue receiving import validation.
In `@jest.config.js`:
- Line 3: Update the ts-jest configuration in the TypeScript transform entry to
remove diagnostics: false so Jest performs TypeScript diagnostics, or
alternatively add a required CI tsc --noEmit check. Preserve the existing
tsconfig.json configuration.
🪄 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: fffa4a88-0e2d-4af0-a88e-987e39f808e7

📥 Commits

Reviewing files that changed from the base of the PR and between 97b9c82 and e383ed9.

📒 Files selected for processing (49)
  • .eslintrc
  • .github/workflows/publish.yml
  • .gitignore
  • __tests__/client-id.spec.js
  • __tests__/config.spec.js
  • __tests__/helpers.spec.js
  • __tests__/oauth.spec.js
  • __tests__/proxyHelper.spec.js
  • __tests__/publicReportingAPI.spec.js
  • __tests__/report-portal-client.spec.js
  • __tests__/rest.spec.js
  • __tests__/statistics.spec.js
  • index.d.ts
  • jest.config.js
  • lib/constants/events.js
  • lib/constants/statuses.js
  • lib/publicReportingAPI.js
  • package.json
  • src/constants.ts
  • src/helpers.ts
  • src/lib/commons/config.ts
  • src/lib/commons/errors.ts
  • src/lib/constants/events.ts
  • src/lib/constants/index.ts
  • src/lib/constants/launchModes.ts
  • src/lib/constants/logLevels.ts
  • src/lib/constants/outputs.ts
  • src/lib/constants/statuses.ts
  • src/lib/constants/testItemTypes.ts
  • src/lib/helpers.ts
  • src/lib/logger.ts
  • src/lib/models/common.ts
  • src/lib/models/config.ts
  • src/lib/models/index.ts
  • src/lib/models/requests.ts
  • src/lib/models/responses.ts
  • src/lib/oauth.ts
  • src/lib/pjson.ts
  • src/lib/proxyHelper.ts
  • src/lib/publicReportingAPI.ts
  • src/lib/report-portal-client.ts
  • src/lib/rest.ts
  • src/models.ts
  • src/statistics/client-id.ts
  • src/statistics/constants.ts
  • src/statistics/statistics.ts
  • src/types/vendor.d.ts
  • statistics/constants.js
  • tsconfig.json
💤 Files with no reviewable changes (5)
  • lib/publicReportingAPI.js
  • lib/constants/statuses.js
  • statistics/constants.js
  • lib/constants/events.js
  • index.d.ts

Comment thread__tests__/oauth.spec.js Outdated
Comment threadsrc/lib/rest.ts Outdated

@coderabbitaicoderabbitaiBot 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.

🧹 Nitpick comments (1)
__tests__/oauth.spec.js (1)

403-433: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Assert the proxy wiring, not only the log.

This test proves that the proxy branch is entered, but not that axios.post receives the appropriate agent and proxy: false. Capture the request config and assert those fields to protect the actual proxy contract.

Suggested assertion
 expect(consoleSpy).toHaveBeenCalledWith(
`[OAuth] Making token request to ${baseConfig.tokenEndpoint} with proxy agent`,
'',
);
+ const requestConfig = axios.post.mock.calls[0][2];+ expect(requestConfig.proxy).toBe(false);+ expect(requestConfig.httpsAgent ?? requestConfig.httpAgent).toBeDefined();
🤖 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 `@__tests__/oauth.spec.js` around lines 403 - 433, Update the test “logs the
proxied token request when debug and proxy are both enabled” to capture the
config passed to axios.post and assert that the request uses the configured
proxy agent and sets proxy to false, while preserving the existing token and log
assertions.
🤖 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.
Nitpick comments:
In `@__tests__/oauth.spec.js`:
- Around line 403-433: Update the test “logs the proxied token request when
debug and proxy are both enabled” to capture the config passed to axios.post and
assert that the request uses the configured proxy agent and sets proxy to false,
while preserving the existing token and log assertions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: fcf07188-9241-4267-a4c8-e47ac9002ea1

📥 Commits

Reviewing files that changed from the base of the PR and between e383ed9 and 8a069ec.

📒 Files selected for processing (7)
  • .eslintrc
  • __tests__/oauth.spec.js
  • __tests__/rest.spec.js
  • src/helpers.ts
  • src/lib/commons/config.ts
  • src/lib/models/config.ts
  • src/lib/rest.ts
🚧 Files skipped from review as they are similar to previous changes (6)
  • src/helpers.ts
  • tests/rest.spec.js
  • .eslintrc
  • src/lib/models/config.ts
  • src/lib/commons/config.ts
  • src/lib/rest.ts

@coderabbitaicoderabbitaiBot 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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/lib/report-portal-client.ts (1)

375-385: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Propagate REST failures instead of converting them to success.

mergeLaunches continues with launch/merge after a search failure, using an empty launch list, and both merge and file-upload catches resolve normally. This can issue invalid merge requests and make failed log uploads appear successful.

Proposed fix
- (error): Array<string | number> => {+ (error) => {
this.logDebug(`Error during launches search with UUIDs: ${launchUUIds}`, error);
console.dir(error);
- return [];+ throw error;
},
...
.catch((error) => {
this.logDebug(`Error merging launches with UUIDs: ${launchUUIds}`, error);
console.dir(error);
+ throw error;
});
...
.catch((error) => {
this.logDebug(`Error save log with file: ${fileObj.name}`, error);
console.dir(error);
+ throw error;
});

Also applies to: 393-396, 721-734

🤖 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 `@src/lib/report-portal-client.ts` around lines 375 - 385, Update mergeLaunches
and the related file-upload error handlers to rethrow or reject REST failures
after logging instead of returning successful fallback values. In the launch
UUID search catch, do not continue to getMergeLaunchesRequest or call
launch/merge with an empty list; ensure the promise remains rejected. Apply the
same failure propagation to the catches around the upload flow at the referenced
symbols.
🤖 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.
Outside diff comments:
In `@src/lib/report-portal-client.ts`:
- Around line 375-385: Update mergeLaunches and the related file-upload error
handlers to rethrow or reject REST failures after logging instead of returning
successful fallback values. In the launch UUID search catch, do not continue to
getMergeLaunchesRequest or call launch/merge with an empty list; ensure the
promise remains rejected. Apply the same failure propagation to the catches
around the upload flow at the referenced symbols.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a827787d-3d6f-46f4-8b06-1698f26f436c

📥 Commits

Reviewing files that changed from the base of the PR and between 8a069ec and af4ffe1.

📒 Files selected for processing (3)
  • __tests__/report-portal-client.spec.js
  • src/lib/models/requests.ts
  • src/lib/report-portal-client.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • tests/report-portal-client.spec.js
  • src/lib/models/requests.ts

@AmsterGetAmsterGet left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice work!
Let's polish this before merging.
General comments:

  • pay attention to pipeline warnings
  • get rid of any
  • test this PR with the agent written on plain JS (e.g. Cypress)

Comment threadsrc/lib/helpers.ts Outdated
Comment threadsrc/lib/helpers.ts Outdated
Comment threadsrc/lib/logger.ts Outdated
Comment threadsrc/lib/proxyHelper.ts Outdated
Comment threadsrc/lib/publicReportingAPI.ts
Comment threadsrc/lib/report-portal-client.ts Outdated
Comment threadsrc/constants.ts Outdated
Comment thread.gitignore Outdated
Comment threadjest.config.js
Comment threadpackage.json Outdated

@coderabbitaicoderabbitaiBot 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.

🧹 Nitpick comments (1)
.eslintrc (1)

26-26: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Keep unresolved-import validation enabled.

Disabling import/no-unresolved globally can allow broken src and package imports to pass lint. Configure the TypeScript resolver instead, or scope this disablement only to files that genuinely require it.

🤖 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 @.eslintrc at line 26, Remove the global disablement of import/no-unresolved
in the ESLint configuration. Configure the TypeScript import resolver so valid
TypeScript and package imports resolve correctly, or narrowly scope any
remaining disablement only to files that genuinely require it.
🤖 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.
Nitpick comments:
In @.eslintrc:
- Line 26: Remove the global disablement of import/no-unresolved in the ESLint
configuration. Configure the TypeScript import resolver so valid TypeScript and
package imports resolve correctly, or narrowly scope any remaining disablement
only to files that genuinely require it.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a5b89f07-d93f-49d7-bcdd-c9a2d3ae8559

📥 Commits

Reviewing files that changed from the base of the PR and between af4ffe1 and 00c2c81.

📒 Files selected for processing (16)
  • .eslintrc
  • __tests__/helpers.spec.js
  • __tests__/report-portal-client.spec.js
  • package.json
  • src/lib/commons/config.ts
  • src/lib/constants/outputs.ts
  • src/lib/helpers.ts
  • src/lib/logger.ts
  • src/lib/models/index.ts
  • src/lib/models/reporting.ts
  • src/lib/oauth.ts
  • src/lib/proxyHelper.ts
  • src/lib/publicReportingAPI.ts
  • src/lib/report-portal-client.ts
  • src/lib/rest.ts
  • src/statistics/statistics.ts
💤 Files with no reviewable changes (6)
  • src/lib/logger.ts
  • src/lib/constants/outputs.ts
  • src/lib/oauth.ts
  • src/statistics/statistics.ts
  • src/lib/commons/config.ts
  • src/lib/rest.ts
🚧 Files skipped from review as they are similar to previous changes (5)
  • src/lib/models/index.ts
  • tests/helpers.spec.js
  • src/lib/publicReportingAPI.ts
  • src/lib/proxyHelper.ts
  • src/lib/report-portal-client.ts

Comment threadsrc/lib/models/reporting.ts Outdated
Comment threadsrc/lib/publicReportingAPI.ts
Comment threadsrc/lib/report-portal-client.ts Outdated
Comment threadsrc/lib/report-portal-client.ts Outdated
Comment threadpackage.json Outdated
@maria-hambardzumian
maria-hambardzumian merged commit f88818d into developAug 13, 2026
8 checks passed
@maria-hambardzumian
maria-hambardzumian deleted the feature/EPMRPP-89496-migrate-to-typescript branch August 13, 2026 09:49
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@maria-hambardzumian@AmsterGet
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

EPMRPP-89496 || Migrate client-javascript to TypeScript - #271

Merged
maria-hambardzumian merged 10 commits into
developfrom
feature/EPMRPP-89496-migrate-to-typescript
Aug 13, 2026
Merged

EPMRPP-89496 || Migrate client-javascript to TypeScript#271
maria-hambardzumian merged 10 commits into
developfrom
feature/EPMRPP-89496-migrate-to-typescript

Conversation

@maria-hambardzumian

@maria-hambardzumianmaria-hambardzumian commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features
    • Added public import paths for constants, helpers, and models.
    • Added shared statuses, launch modes, event identifiers, and typed configuration/request models.
  • Improvements
    • Enhanced proxy handling and credential redaction in debug logs.
    • Improved OAuth error handling and request logging.
  • Build & Publishing
    • Updated published artifacts, exports, and TypeScript entrypoints.
  • Testing
    • Added TypeScript test support and expanded OAuth and REST coverage.
  • Breaking Changes
    • Removed legacy public type and module entries.

@maria-hambardzumian

maria-hambardzumian commented Jul 22, 2026

Copy link
Copy Markdown
ContributorAuthor

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

StatusScan Engine Critical High Medium LowTotal (0)
Open Source Security0000 0 issues
Code Security0000 0 issues

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

@coderabbitai

coderabbitaiBot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

The pull request migrates the client from CommonJS JavaScript to typed TypeScript. It adds public models, constants, and entrypoints. It updates runtime modules, tests, compiler settings, package exports, and publishing configuration.

Changes

TypeScript migration and public contracts

Layer / File(s)Summary
Public contracts and build layout
src/lib/models/*, src/lib/constants/*, src/types/vendor.d.ts, tsconfig.json, jest.config.js, package.json, src/models.ts, src/helpers.ts, src/constants.ts
Adds typed models, constants, vendor declarations, public entrypoints, source-based build and test settings, package exports, and generated-output rules.
Configuration, helpers, authentication, and proxy runtime
src/lib/commons/*, src/lib/helpers.ts, src/lib/logger.ts, src/lib/oauth.ts, src/lib/proxyHelper.ts, src/lib/pjson.ts, src/statistics/*
Converts runtime utilities to typed modules and updates configuration, helper, logging, OAuth, proxy, metadata, client identity, and statistics handling.
Client and REST request flow
src/lib/report-portal-client.ts, src/lib/rest.ts
Types lifecycle operations, logging, multipart uploads, retries, headers, REST responses, proxy behavior, and error handling.
Reporting, statistics, tests, and delivery checks
src/lib/publicReportingAPI.ts, src/lib/constants/events.ts, src/statistics/*, __tests__/*, .github/workflows/publish.yml, .gitignore, .eslintrc
Adds typed reporting events and statistics support, updates tests to load source modules, adds OAuth and REST coverage, adjusts lint rules, ignores emitted files, and builds before publication.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

Suggested reviewers:amsterget

Poem

A rabbit typed each launch with care,
OAuth hopped through proxy air.
Tests now follow source paths bright,
Builds prepare the package right.
Carrots compile, then publish cheer!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check nameStatusExplanationResolution
Docstring Coverage⚠️ WarningDocstring coverage is 46.15% which is insufficient. The required threshold is 80.00%.Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title clearly and concisely identifies the main change: migrating the JavaScript client to TypeScript.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/EPMRPP-89496-migrate-to-typescript

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.

@coderabbitaicoderabbitaiBot 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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/lib/oauth.ts (1)

52-60: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Honor the supplied OAuth debug option.

RestClient passes debug into this constructor, but Line 60 ignores it and reads only restClientConfig.debug. Client-level OAuth diagnostics are therefore disabled unless the nested REST option is also set.

Proposed fix
- this.debug = this.restClientConfig.debug || false;+ this.debug = config.debug ?? this.restClientConfig.debug ?? false;
🤖 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 `@src/lib/oauth.ts` around lines 52 - 60, Update the OAuthInterceptor
constructor’s debug assignment to honor the supplied OAuth-level config.debug
value passed by RestClient, while preserving the existing restClientConfig.debug
fallback when the OAuth option is absent.
🧹 Nitpick comments (2)
jest.config.js (1)

3-3: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Avoid disabling TypeScript diagnostics without a required CI typecheck.

diagnostics: false lets Jest execute code with broken TypeScript contracts, weakening the migration’s validation. Keep diagnostics enabled or ensure CI runs tsc --noEmit as a required check.

🤖 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 `@jest.config.js` at line 3, Update the ts-jest configuration in the TypeScript
transform entry to remove diagnostics: false so Jest performs TypeScript
diagnostics, or alternatively add a required CI tsc --noEmit check. Preserve the
existing tsconfig.json configuration.
.eslintrc (1)

24-27: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Scope the disabled import rules instead of disabling them globally.

Turning off import/no-unresolved and import/extensions for the entire repository can hide broken imports outside the TypeScript source. Prefer configuring the TypeScript resolver or applying overrides only to the affected files.

🤖 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 @.eslintrc around lines 24 - 27, Update the ESLint configuration entries for
import/no-unresolved and import/extensions to apply only through a
TypeScript-specific resolver or targeted file overrides, rather than disabling
them repository-wide. Preserve the existing camelcase and valid-jsdoc settings,
and ensure unaffected JavaScript files continue receiving import validation.
🤖 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 `@__tests__/oauth.spec.js`:
- Around line 5-7: The axios mock’s isAxiosError implementation in the
jest.mock('axios', ...) block incorrectly identifies errors by response
presence; match real Axios by requiring error.isAxiosError === true, and update
the test’s rejected error value to include isAxiosError: true when it represents
an AxiosError.
In `@src/lib/rest.ts`:
- Around line 53-59: Export the RestClientOptions interface so the
ConstructorParameters<typeof RestClient>[0] type used by helpers.getServerResult
remains publicly nameable during declaration emit. Change only the interface’s
visibility and preserve its existing fields and types.
---
Outside diff comments:
In `@src/lib/oauth.ts`:
- Around line 52-60: Update the OAuthInterceptor constructor’s debug assignment
to honor the supplied OAuth-level config.debug value passed by RestClient, while
preserving the existing restClientConfig.debug fallback when the OAuth option is
absent.
---
Nitpick comments:
In @.eslintrc:
- Around line 24-27: Update the ESLint configuration entries for
import/no-unresolved and import/extensions to apply only through a
TypeScript-specific resolver or targeted file overrides, rather than disabling
them repository-wide. Preserve the existing camelcase and valid-jsdoc settings,
and ensure unaffected JavaScript files continue receiving import validation.
In `@jest.config.js`:
- Line 3: Update the ts-jest configuration in the TypeScript transform entry to
remove diagnostics: false so Jest performs TypeScript diagnostics, or
alternatively add a required CI tsc --noEmit check. Preserve the existing
tsconfig.json configuration.
🪄 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: fffa4a88-0e2d-4af0-a88e-987e39f808e7

📥 Commits

Reviewing files that changed from the base of the PR and between 97b9c82 and e383ed9.

📒 Files selected for processing (49)
  • .eslintrc
  • .github/workflows/publish.yml
  • .gitignore
  • __tests__/client-id.spec.js
  • __tests__/config.spec.js
  • __tests__/helpers.spec.js
  • __tests__/oauth.spec.js
  • __tests__/proxyHelper.spec.js
  • __tests__/publicReportingAPI.spec.js
  • __tests__/report-portal-client.spec.js
  • __tests__/rest.spec.js
  • __tests__/statistics.spec.js
  • index.d.ts
  • jest.config.js
  • lib/constants/events.js
  • lib/constants/statuses.js
  • lib/publicReportingAPI.js
  • package.json
  • src/constants.ts
  • src/helpers.ts
  • src/lib/commons/config.ts
  • src/lib/commons/errors.ts
  • src/lib/constants/events.ts
  • src/lib/constants/index.ts
  • src/lib/constants/launchModes.ts
  • src/lib/constants/logLevels.ts
  • src/lib/constants/outputs.ts
  • src/lib/constants/statuses.ts
  • src/lib/constants/testItemTypes.ts
  • src/lib/helpers.ts
  • src/lib/logger.ts
  • src/lib/models/common.ts
  • src/lib/models/config.ts
  • src/lib/models/index.ts
  • src/lib/models/requests.ts
  • src/lib/models/responses.ts
  • src/lib/oauth.ts
  • src/lib/pjson.ts
  • src/lib/proxyHelper.ts
  • src/lib/publicReportingAPI.ts
  • src/lib/report-portal-client.ts
  • src/lib/rest.ts
  • src/models.ts
  • src/statistics/client-id.ts
  • src/statistics/constants.ts
  • src/statistics/statistics.ts
  • src/types/vendor.d.ts
  • statistics/constants.js
  • tsconfig.json
💤 Files with no reviewable changes (5)
  • lib/publicReportingAPI.js
  • lib/constants/statuses.js
  • statistics/constants.js
  • lib/constants/events.js
  • index.d.ts

Comment thread__tests__/oauth.spec.js Outdated
Comment threadsrc/lib/rest.ts Outdated

@coderabbitaicoderabbitaiBot 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.

🧹 Nitpick comments (1)
__tests__/oauth.spec.js (1)

403-433: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Assert the proxy wiring, not only the log.

This test proves that the proxy branch is entered, but not that axios.post receives the appropriate agent and proxy: false. Capture the request config and assert those fields to protect the actual proxy contract.

Suggested assertion
 expect(consoleSpy).toHaveBeenCalledWith(
`[OAuth] Making token request to ${baseConfig.tokenEndpoint} with proxy agent`,
'',
);
+ const requestConfig = axios.post.mock.calls[0][2];+ expect(requestConfig.proxy).toBe(false);+ expect(requestConfig.httpsAgent ?? requestConfig.httpAgent).toBeDefined();
🤖 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 `@__tests__/oauth.spec.js` around lines 403 - 433, Update the test “logs the
proxied token request when debug and proxy are both enabled” to capture the
config passed to axios.post and assert that the request uses the configured
proxy agent and sets proxy to false, while preserving the existing token and log
assertions.
🤖 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.
Nitpick comments:
In `@__tests__/oauth.spec.js`:
- Around line 403-433: Update the test “logs the proxied token request when
debug and proxy are both enabled” to capture the config passed to axios.post and
assert that the request uses the configured proxy agent and sets proxy to false,
while preserving the existing token and log assertions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: fcf07188-9241-4267-a4c8-e47ac9002ea1

📥 Commits

Reviewing files that changed from the base of the PR and between e383ed9 and 8a069ec.

📒 Files selected for processing (7)
  • .eslintrc
  • __tests__/oauth.spec.js
  • __tests__/rest.spec.js
  • src/helpers.ts
  • src/lib/commons/config.ts
  • src/lib/models/config.ts
  • src/lib/rest.ts
🚧 Files skipped from review as they are similar to previous changes (6)
  • src/helpers.ts
  • tests/rest.spec.js
  • .eslintrc
  • src/lib/models/config.ts
  • src/lib/commons/config.ts
  • src/lib/rest.ts

@coderabbitaicoderabbitaiBot 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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/lib/report-portal-client.ts (1)

375-385: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Propagate REST failures instead of converting them to success.

mergeLaunches continues with launch/merge after a search failure, using an empty launch list, and both merge and file-upload catches resolve normally. This can issue invalid merge requests and make failed log uploads appear successful.

Proposed fix
- (error): Array<string | number> => {+ (error) => {
this.logDebug(`Error during launches search with UUIDs: ${launchUUIds}`, error);
console.dir(error);
- return [];+ throw error;
},
...
.catch((error) => {
this.logDebug(`Error merging launches with UUIDs: ${launchUUIds}`, error);
console.dir(error);
+ throw error;
});
...
.catch((error) => {
this.logDebug(`Error save log with file: ${fileObj.name}`, error);
console.dir(error);
+ throw error;
});

Also applies to: 393-396, 721-734

🤖 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 `@src/lib/report-portal-client.ts` around lines 375 - 385, Update mergeLaunches
and the related file-upload error handlers to rethrow or reject REST failures
after logging instead of returning successful fallback values. In the launch
UUID search catch, do not continue to getMergeLaunchesRequest or call
launch/merge with an empty list; ensure the promise remains rejected. Apply the
same failure propagation to the catches around the upload flow at the referenced
symbols.
🤖 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.
Outside diff comments:
In `@src/lib/report-portal-client.ts`:
- Around line 375-385: Update mergeLaunches and the related file-upload error
handlers to rethrow or reject REST failures after logging instead of returning
successful fallback values. In the launch UUID search catch, do not continue to
getMergeLaunchesRequest or call launch/merge with an empty list; ensure the
promise remains rejected. Apply the same failure propagation to the catches
around the upload flow at the referenced symbols.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a827787d-3d6f-46f4-8b06-1698f26f436c

📥 Commits

Reviewing files that changed from the base of the PR and between 8a069ec and af4ffe1.

📒 Files selected for processing (3)
  • __tests__/report-portal-client.spec.js
  • src/lib/models/requests.ts
  • src/lib/report-portal-client.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • tests/report-portal-client.spec.js
  • src/lib/models/requests.ts

@AmsterGetAmsterGet left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice work!
Let's polish this before merging.
General comments:

  • pay attention to pipeline warnings
  • get rid of any
  • test this PR with the agent written on plain JS (e.g. Cypress)

Comment threadsrc/lib/helpers.ts Outdated
Comment threadsrc/lib/helpers.ts Outdated
Comment threadsrc/lib/logger.ts Outdated
Comment threadsrc/lib/proxyHelper.ts Outdated
Comment threadsrc/lib/publicReportingAPI.ts
Comment threadsrc/lib/report-portal-client.ts Outdated
Comment threadsrc/constants.ts Outdated
Comment thread.gitignore Outdated
Comment threadjest.config.js
Comment threadpackage.json Outdated

@coderabbitaicoderabbitaiBot 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.

🧹 Nitpick comments (1)
.eslintrc (1)

26-26: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Keep unresolved-import validation enabled.

Disabling import/no-unresolved globally can allow broken src and package imports to pass lint. Configure the TypeScript resolver instead, or scope this disablement only to files that genuinely require it.

🤖 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 @.eslintrc at line 26, Remove the global disablement of import/no-unresolved
in the ESLint configuration. Configure the TypeScript import resolver so valid
TypeScript and package imports resolve correctly, or narrowly scope any
remaining disablement only to files that genuinely require it.
🤖 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.
Nitpick comments:
In @.eslintrc:
- Line 26: Remove the global disablement of import/no-unresolved in the ESLint
configuration. Configure the TypeScript import resolver so valid TypeScript and
package imports resolve correctly, or narrowly scope any remaining disablement
only to files that genuinely require it.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a5b89f07-d93f-49d7-bcdd-c9a2d3ae8559

📥 Commits

Reviewing files that changed from the base of the PR and between af4ffe1 and 00c2c81.

📒 Files selected for processing (16)
  • .eslintrc
  • __tests__/helpers.spec.js
  • __tests__/report-portal-client.spec.js
  • package.json
  • src/lib/commons/config.ts
  • src/lib/constants/outputs.ts
  • src/lib/helpers.ts
  • src/lib/logger.ts
  • src/lib/models/index.ts
  • src/lib/models/reporting.ts
  • src/lib/oauth.ts
  • src/lib/proxyHelper.ts
  • src/lib/publicReportingAPI.ts
  • src/lib/report-portal-client.ts
  • src/lib/rest.ts
  • src/statistics/statistics.ts
💤 Files with no reviewable changes (6)
  • src/lib/logger.ts
  • src/lib/constants/outputs.ts
  • src/lib/oauth.ts
  • src/statistics/statistics.ts
  • src/lib/commons/config.ts
  • src/lib/rest.ts
🚧 Files skipped from review as they are similar to previous changes (5)
  • src/lib/models/index.ts
  • tests/helpers.spec.js
  • src/lib/publicReportingAPI.ts
  • src/lib/proxyHelper.ts
  • src/lib/report-portal-client.ts

Comment threadsrc/lib/models/reporting.ts Outdated
Comment threadsrc/lib/publicReportingAPI.ts
Comment threadsrc/lib/report-portal-client.ts Outdated
Comment threadsrc/lib/report-portal-client.ts Outdated
Comment threadpackage.json Outdated
@maria-hambardzumian
maria-hambardzumian merged commit f88818d into developAug 13, 2026
8 checks passed
@maria-hambardzumian
maria-hambardzumian deleted the feature/EPMRPP-89496-migrate-to-typescript branch August 13, 2026 09:49
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@maria-hambardzumian@AmsterGet
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

EPMRPP-89496 || Migrate client-javascript to TypeScript - #271

Merged
maria-hambardzumian merged 10 commits into
developfrom
feature/EPMRPP-89496-migrate-to-typescript
Aug 13, 2026
Merged

EPMRPP-89496 || Migrate client-javascript to TypeScript#271
maria-hambardzumian merged 10 commits into
developfrom
feature/EPMRPP-89496-migrate-to-typescript

Conversation

@maria-hambardzumian

@maria-hambardzumianmaria-hambardzumian commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features
    • Added public import paths for constants, helpers, and models.
    • Added shared statuses, launch modes, event identifiers, and typed configuration/request models.
  • Improvements
    • Enhanced proxy handling and credential redaction in debug logs.
    • Improved OAuth error handling and request logging.
  • Build & Publishing
    • Updated published artifacts, exports, and TypeScript entrypoints.
  • Testing
    • Added TypeScript test support and expanded OAuth and REST coverage.
  • Breaking Changes
    • Removed legacy public type and module entries.

@maria-hambardzumian

maria-hambardzumian commented Jul 22, 2026

Copy link
Copy Markdown
ContributorAuthor

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

StatusScan Engine Critical High Medium LowTotal (0)
Open Source Security0000 0 issues
Code Security0000 0 issues

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

@coderabbitai

coderabbitaiBot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

The pull request migrates the client from CommonJS JavaScript to typed TypeScript. It adds public models, constants, and entrypoints. It updates runtime modules, tests, compiler settings, package exports, and publishing configuration.

Changes

TypeScript migration and public contracts

Layer / File(s)Summary
Public contracts and build layout
src/lib/models/*, src/lib/constants/*, src/types/vendor.d.ts, tsconfig.json, jest.config.js, package.json, src/models.ts, src/helpers.ts, src/constants.ts
Adds typed models, constants, vendor declarations, public entrypoints, source-based build and test settings, package exports, and generated-output rules.
Configuration, helpers, authentication, and proxy runtime
src/lib/commons/*, src/lib/helpers.ts, src/lib/logger.ts, src/lib/oauth.ts, src/lib/proxyHelper.ts, src/lib/pjson.ts, src/statistics/*
Converts runtime utilities to typed modules and updates configuration, helper, logging, OAuth, proxy, metadata, client identity, and statistics handling.
Client and REST request flow
src/lib/report-portal-client.ts, src/lib/rest.ts
Types lifecycle operations, logging, multipart uploads, retries, headers, REST responses, proxy behavior, and error handling.
Reporting, statistics, tests, and delivery checks
src/lib/publicReportingAPI.ts, src/lib/constants/events.ts, src/statistics/*, __tests__/*, .github/workflows/publish.yml, .gitignore, .eslintrc
Adds typed reporting events and statistics support, updates tests to load source modules, adds OAuth and REST coverage, adjusts lint rules, ignores emitted files, and builds before publication.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

Suggested reviewers:amsterget

Poem

A rabbit typed each launch with care,
OAuth hopped through proxy air.
Tests now follow source paths bright,
Builds prepare the package right.
Carrots compile, then publish cheer!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check nameStatusExplanationResolution
Docstring Coverage⚠️ WarningDocstring coverage is 46.15% which is insufficient. The required threshold is 80.00%.Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title clearly and concisely identifies the main change: migrating the JavaScript client to TypeScript.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/EPMRPP-89496-migrate-to-typescript

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.

@coderabbitaicoderabbitaiBot 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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/lib/oauth.ts (1)

52-60: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Honor the supplied OAuth debug option.

RestClient passes debug into this constructor, but Line 60 ignores it and reads only restClientConfig.debug. Client-level OAuth diagnostics are therefore disabled unless the nested REST option is also set.

Proposed fix
- this.debug = this.restClientConfig.debug || false;+ this.debug = config.debug ?? this.restClientConfig.debug ?? false;
🤖 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 `@src/lib/oauth.ts` around lines 52 - 60, Update the OAuthInterceptor
constructor’s debug assignment to honor the supplied OAuth-level config.debug
value passed by RestClient, while preserving the existing restClientConfig.debug
fallback when the OAuth option is absent.
🧹 Nitpick comments (2)
jest.config.js (1)

3-3: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Avoid disabling TypeScript diagnostics without a required CI typecheck.

diagnostics: false lets Jest execute code with broken TypeScript contracts, weakening the migration’s validation. Keep diagnostics enabled or ensure CI runs tsc --noEmit as a required check.

🤖 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 `@jest.config.js` at line 3, Update the ts-jest configuration in the TypeScript
transform entry to remove diagnostics: false so Jest performs TypeScript
diagnostics, or alternatively add a required CI tsc --noEmit check. Preserve the
existing tsconfig.json configuration.
.eslintrc (1)

24-27: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Scope the disabled import rules instead of disabling them globally.

Turning off import/no-unresolved and import/extensions for the entire repository can hide broken imports outside the TypeScript source. Prefer configuring the TypeScript resolver or applying overrides only to the affected files.

🤖 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 @.eslintrc around lines 24 - 27, Update the ESLint configuration entries for
import/no-unresolved and import/extensions to apply only through a
TypeScript-specific resolver or targeted file overrides, rather than disabling
them repository-wide. Preserve the existing camelcase and valid-jsdoc settings,
and ensure unaffected JavaScript files continue receiving import validation.
🤖 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 `@__tests__/oauth.spec.js`:
- Around line 5-7: The axios mock’s isAxiosError implementation in the
jest.mock('axios', ...) block incorrectly identifies errors by response
presence; match real Axios by requiring error.isAxiosError === true, and update
the test’s rejected error value to include isAxiosError: true when it represents
an AxiosError.
In `@src/lib/rest.ts`:
- Around line 53-59: Export the RestClientOptions interface so the
ConstructorParameters<typeof RestClient>[0] type used by helpers.getServerResult
remains publicly nameable during declaration emit. Change only the interface’s
visibility and preserve its existing fields and types.
---
Outside diff comments:
In `@src/lib/oauth.ts`:
- Around line 52-60: Update the OAuthInterceptor constructor’s debug assignment
to honor the supplied OAuth-level config.debug value passed by RestClient, while
preserving the existing restClientConfig.debug fallback when the OAuth option is
absent.
---
Nitpick comments:
In @.eslintrc:
- Around line 24-27: Update the ESLint configuration entries for
import/no-unresolved and import/extensions to apply only through a
TypeScript-specific resolver or targeted file overrides, rather than disabling
them repository-wide. Preserve the existing camelcase and valid-jsdoc settings,
and ensure unaffected JavaScript files continue receiving import validation.
In `@jest.config.js`:
- Line 3: Update the ts-jest configuration in the TypeScript transform entry to
remove diagnostics: false so Jest performs TypeScript diagnostics, or
alternatively add a required CI tsc --noEmit check. Preserve the existing
tsconfig.json configuration.
🪄 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: fffa4a88-0e2d-4af0-a88e-987e39f808e7

📥 Commits

Reviewing files that changed from the base of the PR and between 97b9c82 and e383ed9.

📒 Files selected for processing (49)
  • .eslintrc
  • .github/workflows/publish.yml
  • .gitignore
  • __tests__/client-id.spec.js
  • __tests__/config.spec.js
  • __tests__/helpers.spec.js
  • __tests__/oauth.spec.js
  • __tests__/proxyHelper.spec.js
  • __tests__/publicReportingAPI.spec.js
  • __tests__/report-portal-client.spec.js
  • __tests__/rest.spec.js
  • __tests__/statistics.spec.js
  • index.d.ts
  • jest.config.js
  • lib/constants/events.js
  • lib/constants/statuses.js
  • lib/publicReportingAPI.js
  • package.json
  • src/constants.ts
  • src/helpers.ts
  • src/lib/commons/config.ts
  • src/lib/commons/errors.ts
  • src/lib/constants/events.ts
  • src/lib/constants/index.ts
  • src/lib/constants/launchModes.ts
  • src/lib/constants/logLevels.ts
  • src/lib/constants/outputs.ts
  • src/lib/constants/statuses.ts
  • src/lib/constants/testItemTypes.ts
  • src/lib/helpers.ts
  • src/lib/logger.ts
  • src/lib/models/common.ts
  • src/lib/models/config.ts
  • src/lib/models/index.ts
  • src/lib/models/requests.ts
  • src/lib/models/responses.ts
  • src/lib/oauth.ts
  • src/lib/pjson.ts
  • src/lib/proxyHelper.ts
  • src/lib/publicReportingAPI.ts
  • src/lib/report-portal-client.ts
  • src/lib/rest.ts
  • src/models.ts
  • src/statistics/client-id.ts
  • src/statistics/constants.ts
  • src/statistics/statistics.ts
  • src/types/vendor.d.ts
  • statistics/constants.js
  • tsconfig.json
💤 Files with no reviewable changes (5)
  • lib/publicReportingAPI.js
  • lib/constants/statuses.js
  • statistics/constants.js
  • lib/constants/events.js
  • index.d.ts

Comment thread__tests__/oauth.spec.js Outdated
Comment threadsrc/lib/rest.ts Outdated

@coderabbitaicoderabbitaiBot 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.

🧹 Nitpick comments (1)
__tests__/oauth.spec.js (1)

403-433: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Assert the proxy wiring, not only the log.

This test proves that the proxy branch is entered, but not that axios.post receives the appropriate agent and proxy: false. Capture the request config and assert those fields to protect the actual proxy contract.

Suggested assertion
 expect(consoleSpy).toHaveBeenCalledWith(
`[OAuth] Making token request to ${baseConfig.tokenEndpoint} with proxy agent`,
'',
);
+ const requestConfig = axios.post.mock.calls[0][2];+ expect(requestConfig.proxy).toBe(false);+ expect(requestConfig.httpsAgent ?? requestConfig.httpAgent).toBeDefined();
🤖 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 `@__tests__/oauth.spec.js` around lines 403 - 433, Update the test “logs the
proxied token request when debug and proxy are both enabled” to capture the
config passed to axios.post and assert that the request uses the configured
proxy agent and sets proxy to false, while preserving the existing token and log
assertions.
🤖 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.
Nitpick comments:
In `@__tests__/oauth.spec.js`:
- Around line 403-433: Update the test “logs the proxied token request when
debug and proxy are both enabled” to capture the config passed to axios.post and
assert that the request uses the configured proxy agent and sets proxy to false,
while preserving the existing token and log assertions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: fcf07188-9241-4267-a4c8-e47ac9002ea1

📥 Commits

Reviewing files that changed from the base of the PR and between e383ed9 and 8a069ec.

📒 Files selected for processing (7)
  • .eslintrc
  • __tests__/oauth.spec.js
  • __tests__/rest.spec.js
  • src/helpers.ts
  • src/lib/commons/config.ts
  • src/lib/models/config.ts
  • src/lib/rest.ts
🚧 Files skipped from review as they are similar to previous changes (6)
  • src/helpers.ts
  • tests/rest.spec.js
  • .eslintrc
  • src/lib/models/config.ts
  • src/lib/commons/config.ts
  • src/lib/rest.ts

@coderabbitaicoderabbitaiBot 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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/lib/report-portal-client.ts (1)

375-385: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Propagate REST failures instead of converting them to success.

mergeLaunches continues with launch/merge after a search failure, using an empty launch list, and both merge and file-upload catches resolve normally. This can issue invalid merge requests and make failed log uploads appear successful.

Proposed fix
- (error): Array<string | number> => {+ (error) => {
this.logDebug(`Error during launches search with UUIDs: ${launchUUIds}`, error);
console.dir(error);
- return [];+ throw error;
},
...
.catch((error) => {
this.logDebug(`Error merging launches with UUIDs: ${launchUUIds}`, error);
console.dir(error);
+ throw error;
});
...
.catch((error) => {
this.logDebug(`Error save log with file: ${fileObj.name}`, error);
console.dir(error);
+ throw error;
});

Also applies to: 393-396, 721-734

🤖 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 `@src/lib/report-portal-client.ts` around lines 375 - 385, Update mergeLaunches
and the related file-upload error handlers to rethrow or reject REST failures
after logging instead of returning successful fallback values. In the launch
UUID search catch, do not continue to getMergeLaunchesRequest or call
launch/merge with an empty list; ensure the promise remains rejected. Apply the
same failure propagation to the catches around the upload flow at the referenced
symbols.
🤖 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.
Outside diff comments:
In `@src/lib/report-portal-client.ts`:
- Around line 375-385: Update mergeLaunches and the related file-upload error
handlers to rethrow or reject REST failures after logging instead of returning
successful fallback values. In the launch UUID search catch, do not continue to
getMergeLaunchesRequest or call launch/merge with an empty list; ensure the
promise remains rejected. Apply the same failure propagation to the catches
around the upload flow at the referenced symbols.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a827787d-3d6f-46f4-8b06-1698f26f436c

📥 Commits

Reviewing files that changed from the base of the PR and between 8a069ec and af4ffe1.

📒 Files selected for processing (3)
  • __tests__/report-portal-client.spec.js
  • src/lib/models/requests.ts
  • src/lib/report-portal-client.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • tests/report-portal-client.spec.js
  • src/lib/models/requests.ts

@AmsterGetAmsterGet left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice work!
Let's polish this before merging.
General comments:

  • pay attention to pipeline warnings
  • get rid of any
  • test this PR with the agent written on plain JS (e.g. Cypress)

Comment threadsrc/lib/helpers.ts Outdated
Comment threadsrc/lib/helpers.ts Outdated
Comment threadsrc/lib/logger.ts Outdated
Comment threadsrc/lib/proxyHelper.ts Outdated
Comment threadsrc/lib/publicReportingAPI.ts
Comment threadsrc/lib/report-portal-client.ts Outdated
Comment threadsrc/constants.ts Outdated
Comment thread.gitignore Outdated
Comment threadjest.config.js
Comment threadpackage.json Outdated

@coderabbitaicoderabbitaiBot 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.

🧹 Nitpick comments (1)
.eslintrc (1)

26-26: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Keep unresolved-import validation enabled.

Disabling import/no-unresolved globally can allow broken src and package imports to pass lint. Configure the TypeScript resolver instead, or scope this disablement only to files that genuinely require it.

🤖 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 @.eslintrc at line 26, Remove the global disablement of import/no-unresolved
in the ESLint configuration. Configure the TypeScript import resolver so valid
TypeScript and package imports resolve correctly, or narrowly scope any
remaining disablement only to files that genuinely require it.
🤖 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.
Nitpick comments:
In @.eslintrc:
- Line 26: Remove the global disablement of import/no-unresolved in the ESLint
configuration. Configure the TypeScript import resolver so valid TypeScript and
package imports resolve correctly, or narrowly scope any remaining disablement
only to files that genuinely require it.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a5b89f07-d93f-49d7-bcdd-c9a2d3ae8559

📥 Commits

Reviewing files that changed from the base of the PR and between af4ffe1 and 00c2c81.

📒 Files selected for processing (16)
  • .eslintrc
  • __tests__/helpers.spec.js
  • __tests__/report-portal-client.spec.js
  • package.json
  • src/lib/commons/config.ts
  • src/lib/constants/outputs.ts
  • src/lib/helpers.ts
  • src/lib/logger.ts
  • src/lib/models/index.ts
  • src/lib/models/reporting.ts
  • src/lib/oauth.ts
  • src/lib/proxyHelper.ts
  • src/lib/publicReportingAPI.ts
  • src/lib/report-portal-client.ts
  • src/lib/rest.ts
  • src/statistics/statistics.ts
💤 Files with no reviewable changes (6)
  • src/lib/logger.ts
  • src/lib/constants/outputs.ts
  • src/lib/oauth.ts
  • src/statistics/statistics.ts
  • src/lib/commons/config.ts
  • src/lib/rest.ts
🚧 Files skipped from review as they are similar to previous changes (5)
  • src/lib/models/index.ts
  • tests/helpers.spec.js
  • src/lib/publicReportingAPI.ts
  • src/lib/proxyHelper.ts
  • src/lib/report-portal-client.ts

Comment threadsrc/lib/models/reporting.ts Outdated
Comment threadsrc/lib/publicReportingAPI.ts
Comment threadsrc/lib/report-portal-client.ts Outdated
Comment threadsrc/lib/report-portal-client.ts Outdated
Comment threadpackage.json Outdated
@maria-hambardzumian
maria-hambardzumian merged commit f88818d into developAug 13, 2026
8 checks passed
@maria-hambardzumian
maria-hambardzumian deleted the feature/EPMRPP-89496-migrate-to-typescript branch August 13, 2026 09:49
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@maria-hambardzumian@AmsterGet
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

EPMRPP-89496 || Migrate client-javascript to TypeScript - #271

Merged
maria-hambardzumian merged 10 commits into
developfrom
feature/EPMRPP-89496-migrate-to-typescript
Aug 13, 2026
Merged

EPMRPP-89496 || Migrate client-javascript to TypeScript#271
maria-hambardzumian merged 10 commits into
developfrom
feature/EPMRPP-89496-migrate-to-typescript

Conversation

@maria-hambardzumian

@maria-hambardzumianmaria-hambardzumian commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features
    • Added public import paths for constants, helpers, and models.
    • Added shared statuses, launch modes, event identifiers, and typed configuration/request models.
  • Improvements
    • Enhanced proxy handling and credential redaction in debug logs.
    • Improved OAuth error handling and request logging.
  • Build & Publishing
    • Updated published artifacts, exports, and TypeScript entrypoints.
  • Testing
    • Added TypeScript test support and expanded OAuth and REST coverage.
  • Breaking Changes
    • Removed legacy public type and module entries.

@maria-hambardzumian

maria-hambardzumian commented Jul 22, 2026

Copy link
Copy Markdown
ContributorAuthor

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

StatusScan Engine Critical High Medium LowTotal (0)
Open Source Security0000 0 issues
Code Security0000 0 issues

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

@coderabbitai

coderabbitaiBot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

The pull request migrates the client from CommonJS JavaScript to typed TypeScript. It adds public models, constants, and entrypoints. It updates runtime modules, tests, compiler settings, package exports, and publishing configuration.

Changes

TypeScript migration and public contracts

Layer / File(s)Summary
Public contracts and build layout
src/lib/models/*, src/lib/constants/*, src/types/vendor.d.ts, tsconfig.json, jest.config.js, package.json, src/models.ts, src/helpers.ts, src/constants.ts
Adds typed models, constants, vendor declarations, public entrypoints, source-based build and test settings, package exports, and generated-output rules.
Configuration, helpers, authentication, and proxy runtime
src/lib/commons/*, src/lib/helpers.ts, src/lib/logger.ts, src/lib/oauth.ts, src/lib/proxyHelper.ts, src/lib/pjson.ts, src/statistics/*
Converts runtime utilities to typed modules and updates configuration, helper, logging, OAuth, proxy, metadata, client identity, and statistics handling.
Client and REST request flow
src/lib/report-portal-client.ts, src/lib/rest.ts
Types lifecycle operations, logging, multipart uploads, retries, headers, REST responses, proxy behavior, and error handling.
Reporting, statistics, tests, and delivery checks
src/lib/publicReportingAPI.ts, src/lib/constants/events.ts, src/statistics/*, __tests__/*, .github/workflows/publish.yml, .gitignore, .eslintrc
Adds typed reporting events and statistics support, updates tests to load source modules, adds OAuth and REST coverage, adjusts lint rules, ignores emitted files, and builds before publication.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

Suggested reviewers:amsterget

Poem

A rabbit typed each launch with care,
OAuth hopped through proxy air.
Tests now follow source paths bright,
Builds prepare the package right.
Carrots compile, then publish cheer!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check nameStatusExplanationResolution
Docstring Coverage⚠️ WarningDocstring coverage is 46.15% which is insufficient. The required threshold is 80.00%.Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title clearly and concisely identifies the main change: migrating the JavaScript client to TypeScript.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/EPMRPP-89496-migrate-to-typescript

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.

@coderabbitaicoderabbitaiBot 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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/lib/oauth.ts (1)

52-60: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Honor the supplied OAuth debug option.

RestClient passes debug into this constructor, but Line 60 ignores it and reads only restClientConfig.debug. Client-level OAuth diagnostics are therefore disabled unless the nested REST option is also set.

Proposed fix
- this.debug = this.restClientConfig.debug || false;+ this.debug = config.debug ?? this.restClientConfig.debug ?? false;
🤖 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 `@src/lib/oauth.ts` around lines 52 - 60, Update the OAuthInterceptor
constructor’s debug assignment to honor the supplied OAuth-level config.debug
value passed by RestClient, while preserving the existing restClientConfig.debug
fallback when the OAuth option is absent.
🧹 Nitpick comments (2)
jest.config.js (1)

3-3: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Avoid disabling TypeScript diagnostics without a required CI typecheck.

diagnostics: false lets Jest execute code with broken TypeScript contracts, weakening the migration’s validation. Keep diagnostics enabled or ensure CI runs tsc --noEmit as a required check.

🤖 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 `@jest.config.js` at line 3, Update the ts-jest configuration in the TypeScript
transform entry to remove diagnostics: false so Jest performs TypeScript
diagnostics, or alternatively add a required CI tsc --noEmit check. Preserve the
existing tsconfig.json configuration.
.eslintrc (1)

24-27: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Scope the disabled import rules instead of disabling them globally.

Turning off import/no-unresolved and import/extensions for the entire repository can hide broken imports outside the TypeScript source. Prefer configuring the TypeScript resolver or applying overrides only to the affected files.

🤖 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 @.eslintrc around lines 24 - 27, Update the ESLint configuration entries for
import/no-unresolved and import/extensions to apply only through a
TypeScript-specific resolver or targeted file overrides, rather than disabling
them repository-wide. Preserve the existing camelcase and valid-jsdoc settings,
and ensure unaffected JavaScript files continue receiving import validation.
🤖 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 `@__tests__/oauth.spec.js`:
- Around line 5-7: The axios mock’s isAxiosError implementation in the
jest.mock('axios', ...) block incorrectly identifies errors by response
presence; match real Axios by requiring error.isAxiosError === true, and update
the test’s rejected error value to include isAxiosError: true when it represents
an AxiosError.
In `@src/lib/rest.ts`:
- Around line 53-59: Export the RestClientOptions interface so the
ConstructorParameters<typeof RestClient>[0] type used by helpers.getServerResult
remains publicly nameable during declaration emit. Change only the interface’s
visibility and preserve its existing fields and types.
---
Outside diff comments:
In `@src/lib/oauth.ts`:
- Around line 52-60: Update the OAuthInterceptor constructor’s debug assignment
to honor the supplied OAuth-level config.debug value passed by RestClient, while
preserving the existing restClientConfig.debug fallback when the OAuth option is
absent.
---
Nitpick comments:
In @.eslintrc:
- Around line 24-27: Update the ESLint configuration entries for
import/no-unresolved and import/extensions to apply only through a
TypeScript-specific resolver or targeted file overrides, rather than disabling
them repository-wide. Preserve the existing camelcase and valid-jsdoc settings,
and ensure unaffected JavaScript files continue receiving import validation.
In `@jest.config.js`:
- Line 3: Update the ts-jest configuration in the TypeScript transform entry to
remove diagnostics: false so Jest performs TypeScript diagnostics, or
alternatively add a required CI tsc --noEmit check. Preserve the existing
tsconfig.json configuration.
🪄 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: fffa4a88-0e2d-4af0-a88e-987e39f808e7

📥 Commits

Reviewing files that changed from the base of the PR and between 97b9c82 and e383ed9.

📒 Files selected for processing (49)
  • .eslintrc
  • .github/workflows/publish.yml
  • .gitignore
  • __tests__/client-id.spec.js
  • __tests__/config.spec.js
  • __tests__/helpers.spec.js
  • __tests__/oauth.spec.js
  • __tests__/proxyHelper.spec.js
  • __tests__/publicReportingAPI.spec.js
  • __tests__/report-portal-client.spec.js
  • __tests__/rest.spec.js
  • __tests__/statistics.spec.js
  • index.d.ts
  • jest.config.js
  • lib/constants/events.js
  • lib/constants/statuses.js
  • lib/publicReportingAPI.js
  • package.json
  • src/constants.ts
  • src/helpers.ts
  • src/lib/commons/config.ts
  • src/lib/commons/errors.ts
  • src/lib/constants/events.ts
  • src/lib/constants/index.ts
  • src/lib/constants/launchModes.ts
  • src/lib/constants/logLevels.ts
  • src/lib/constants/outputs.ts
  • src/lib/constants/statuses.ts
  • src/lib/constants/testItemTypes.ts
  • src/lib/helpers.ts
  • src/lib/logger.ts
  • src/lib/models/common.ts
  • src/lib/models/config.ts
  • src/lib/models/index.ts
  • src/lib/models/requests.ts
  • src/lib/models/responses.ts
  • src/lib/oauth.ts
  • src/lib/pjson.ts
  • src/lib/proxyHelper.ts
  • src/lib/publicReportingAPI.ts
  • src/lib/report-portal-client.ts
  • src/lib/rest.ts
  • src/models.ts
  • src/statistics/client-id.ts
  • src/statistics/constants.ts
  • src/statistics/statistics.ts
  • src/types/vendor.d.ts
  • statistics/constants.js
  • tsconfig.json
💤 Files with no reviewable changes (5)
  • lib/publicReportingAPI.js
  • lib/constants/statuses.js
  • statistics/constants.js
  • lib/constants/events.js
  • index.d.ts

Comment thread__tests__/oauth.spec.js Outdated
Comment threadsrc/lib/rest.ts Outdated

@coderabbitaicoderabbitaiBot 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.

🧹 Nitpick comments (1)
__tests__/oauth.spec.js (1)

403-433: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Assert the proxy wiring, not only the log.

This test proves that the proxy branch is entered, but not that axios.post receives the appropriate agent and proxy: false. Capture the request config and assert those fields to protect the actual proxy contract.

Suggested assertion
 expect(consoleSpy).toHaveBeenCalledWith(
`[OAuth] Making token request to ${baseConfig.tokenEndpoint} with proxy agent`,
'',
);
+ const requestConfig = axios.post.mock.calls[0][2];+ expect(requestConfig.proxy).toBe(false);+ expect(requestConfig.httpsAgent ?? requestConfig.httpAgent).toBeDefined();
🤖 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 `@__tests__/oauth.spec.js` around lines 403 - 433, Update the test “logs the
proxied token request when debug and proxy are both enabled” to capture the
config passed to axios.post and assert that the request uses the configured
proxy agent and sets proxy to false, while preserving the existing token and log
assertions.
🤖 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.
Nitpick comments:
In `@__tests__/oauth.spec.js`:
- Around line 403-433: Update the test “logs the proxied token request when
debug and proxy are both enabled” to capture the config passed to axios.post and
assert that the request uses the configured proxy agent and sets proxy to false,
while preserving the existing token and log assertions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: fcf07188-9241-4267-a4c8-e47ac9002ea1

📥 Commits

Reviewing files that changed from the base of the PR and between e383ed9 and 8a069ec.

📒 Files selected for processing (7)
  • .eslintrc
  • __tests__/oauth.spec.js
  • __tests__/rest.spec.js
  • src/helpers.ts
  • src/lib/commons/config.ts
  • src/lib/models/config.ts
  • src/lib/rest.ts
🚧 Files skipped from review as they are similar to previous changes (6)
  • src/helpers.ts
  • tests/rest.spec.js
  • .eslintrc
  • src/lib/models/config.ts
  • src/lib/commons/config.ts
  • src/lib/rest.ts

@coderabbitaicoderabbitaiBot 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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/lib/report-portal-client.ts (1)

375-385: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Propagate REST failures instead of converting them to success.

mergeLaunches continues with launch/merge after a search failure, using an empty launch list, and both merge and file-upload catches resolve normally. This can issue invalid merge requests and make failed log uploads appear successful.

Proposed fix
- (error): Array<string | number> => {+ (error) => {
this.logDebug(`Error during launches search with UUIDs: ${launchUUIds}`, error);
console.dir(error);
- return [];+ throw error;
},
...
.catch((error) => {
this.logDebug(`Error merging launches with UUIDs: ${launchUUIds}`, error);
console.dir(error);
+ throw error;
});
...
.catch((error) => {
this.logDebug(`Error save log with file: ${fileObj.name}`, error);
console.dir(error);
+ throw error;
});

Also applies to: 393-396, 721-734

🤖 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 `@src/lib/report-portal-client.ts` around lines 375 - 385, Update mergeLaunches
and the related file-upload error handlers to rethrow or reject REST failures
after logging instead of returning successful fallback values. In the launch
UUID search catch, do not continue to getMergeLaunchesRequest or call
launch/merge with an empty list; ensure the promise remains rejected. Apply the
same failure propagation to the catches around the upload flow at the referenced
symbols.
🤖 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.
Outside diff comments:
In `@src/lib/report-portal-client.ts`:
- Around line 375-385: Update mergeLaunches and the related file-upload error
handlers to rethrow or reject REST failures after logging instead of returning
successful fallback values. In the launch UUID search catch, do not continue to
getMergeLaunchesRequest or call launch/merge with an empty list; ensure the
promise remains rejected. Apply the same failure propagation to the catches
around the upload flow at the referenced symbols.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a827787d-3d6f-46f4-8b06-1698f26f436c

📥 Commits

Reviewing files that changed from the base of the PR and between 8a069ec and af4ffe1.

📒 Files selected for processing (3)
  • __tests__/report-portal-client.spec.js
  • src/lib/models/requests.ts
  • src/lib/report-portal-client.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • tests/report-portal-client.spec.js
  • src/lib/models/requests.ts

@AmsterGetAmsterGet left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice work!
Let's polish this before merging.
General comments:

  • pay attention to pipeline warnings
  • get rid of any
  • test this PR with the agent written on plain JS (e.g. Cypress)

Comment threadsrc/lib/helpers.ts Outdated
Comment threadsrc/lib/helpers.ts Outdated
Comment threadsrc/lib/logger.ts Outdated
Comment threadsrc/lib/proxyHelper.ts Outdated
Comment threadsrc/lib/publicReportingAPI.ts
Comment threadsrc/lib/report-portal-client.ts Outdated
Comment threadsrc/constants.ts Outdated
Comment thread.gitignore Outdated
Comment threadjest.config.js
Comment threadpackage.json Outdated

@coderabbitaicoderabbitaiBot 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.

🧹 Nitpick comments (1)
.eslintrc (1)

26-26: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Keep unresolved-import validation enabled.

Disabling import/no-unresolved globally can allow broken src and package imports to pass lint. Configure the TypeScript resolver instead, or scope this disablement only to files that genuinely require it.

🤖 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 @.eslintrc at line 26, Remove the global disablement of import/no-unresolved
in the ESLint configuration. Configure the TypeScript import resolver so valid
TypeScript and package imports resolve correctly, or narrowly scope any
remaining disablement only to files that genuinely require it.
🤖 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.
Nitpick comments:
In @.eslintrc:
- Line 26: Remove the global disablement of import/no-unresolved in the ESLint
configuration. Configure the TypeScript import resolver so valid TypeScript and
package imports resolve correctly, or narrowly scope any remaining disablement
only to files that genuinely require it.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a5b89f07-d93f-49d7-bcdd-c9a2d3ae8559

📥 Commits

Reviewing files that changed from the base of the PR and between af4ffe1 and 00c2c81.

📒 Files selected for processing (16)
  • .eslintrc
  • __tests__/helpers.spec.js
  • __tests__/report-portal-client.spec.js
  • package.json
  • src/lib/commons/config.ts
  • src/lib/constants/outputs.ts
  • src/lib/helpers.ts
  • src/lib/logger.ts
  • src/lib/models/index.ts
  • src/lib/models/reporting.ts
  • src/lib/oauth.ts
  • src/lib/proxyHelper.ts
  • src/lib/publicReportingAPI.ts
  • src/lib/report-portal-client.ts
  • src/lib/rest.ts
  • src/statistics/statistics.ts
💤 Files with no reviewable changes (6)
  • src/lib/logger.ts
  • src/lib/constants/outputs.ts
  • src/lib/oauth.ts
  • src/statistics/statistics.ts
  • src/lib/commons/config.ts
  • src/lib/rest.ts
🚧 Files skipped from review as they are similar to previous changes (5)
  • src/lib/models/index.ts
  • tests/helpers.spec.js
  • src/lib/publicReportingAPI.ts
  • src/lib/proxyHelper.ts
  • src/lib/report-portal-client.ts

Comment threadsrc/lib/models/reporting.ts Outdated
Comment threadsrc/lib/publicReportingAPI.ts
Comment threadsrc/lib/report-portal-client.ts Outdated
Comment threadsrc/lib/report-portal-client.ts Outdated
Comment threadpackage.json Outdated
@maria-hambardzumian
maria-hambardzumian merged commit f88818d into developAug 13, 2026
8 checks passed
@maria-hambardzumian
maria-hambardzumian deleted the feature/EPMRPP-89496-migrate-to-typescript branch August 13, 2026 09:49
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@maria-hambardzumian@AmsterGet
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

EPMRPP-89496 || Migrate client-javascript to TypeScript - #271

Merged
maria-hambardzumian merged 10 commits into
developfrom
feature/EPMRPP-89496-migrate-to-typescript
Aug 13, 2026
Merged

EPMRPP-89496 || Migrate client-javascript to TypeScript#271
maria-hambardzumian merged 10 commits into
developfrom
feature/EPMRPP-89496-migrate-to-typescript

Conversation

@maria-hambardzumian

@maria-hambardzumianmaria-hambardzumian commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features
    • Added public import paths for constants, helpers, and models.
    • Added shared statuses, launch modes, event identifiers, and typed configuration/request models.
  • Improvements
    • Enhanced proxy handling and credential redaction in debug logs.
    • Improved OAuth error handling and request logging.
  • Build & Publishing
    • Updated published artifacts, exports, and TypeScript entrypoints.
  • Testing
    • Added TypeScript test support and expanded OAuth and REST coverage.
  • Breaking Changes
    • Removed legacy public type and module entries.

@maria-hambardzumian

maria-hambardzumian commented Jul 22, 2026

Copy link
Copy Markdown
ContributorAuthor

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

StatusScan Engine Critical High Medium LowTotal (0)
Open Source Security0000 0 issues
Code Security0000 0 issues

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

@coderabbitai

coderabbitaiBot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

The pull request migrates the client from CommonJS JavaScript to typed TypeScript. It adds public models, constants, and entrypoints. It updates runtime modules, tests, compiler settings, package exports, and publishing configuration.

Changes

TypeScript migration and public contracts

Layer / File(s)Summary
Public contracts and build layout
src/lib/models/*, src/lib/constants/*, src/types/vendor.d.ts, tsconfig.json, jest.config.js, package.json, src/models.ts, src/helpers.ts, src/constants.ts
Adds typed models, constants, vendor declarations, public entrypoints, source-based build and test settings, package exports, and generated-output rules.
Configuration, helpers, authentication, and proxy runtime
src/lib/commons/*, src/lib/helpers.ts, src/lib/logger.ts, src/lib/oauth.ts, src/lib/proxyHelper.ts, src/lib/pjson.ts, src/statistics/*
Converts runtime utilities to typed modules and updates configuration, helper, logging, OAuth, proxy, metadata, client identity, and statistics handling.
Client and REST request flow
src/lib/report-portal-client.ts, src/lib/rest.ts
Types lifecycle operations, logging, multipart uploads, retries, headers, REST responses, proxy behavior, and error handling.
Reporting, statistics, tests, and delivery checks
src/lib/publicReportingAPI.ts, src/lib/constants/events.ts, src/statistics/*, __tests__/*, .github/workflows/publish.yml, .gitignore, .eslintrc
Adds typed reporting events and statistics support, updates tests to load source modules, adds OAuth and REST coverage, adjusts lint rules, ignores emitted files, and builds before publication.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

Suggested reviewers:amsterget

Poem

A rabbit typed each launch with care,
OAuth hopped through proxy air.
Tests now follow source paths bright,
Builds prepare the package right.
Carrots compile, then publish cheer!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check nameStatusExplanationResolution
Docstring Coverage⚠️ WarningDocstring coverage is 46.15% which is insufficient. The required threshold is 80.00%.Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title clearly and concisely identifies the main change: migrating the JavaScript client to TypeScript.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/EPMRPP-89496-migrate-to-typescript

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.

@coderabbitaicoderabbitaiBot 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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/lib/oauth.ts (1)

52-60: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Honor the supplied OAuth debug option.

RestClient passes debug into this constructor, but Line 60 ignores it and reads only restClientConfig.debug. Client-level OAuth diagnostics are therefore disabled unless the nested REST option is also set.

Proposed fix
- this.debug = this.restClientConfig.debug || false;+ this.debug = config.debug ?? this.restClientConfig.debug ?? false;
🤖 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 `@src/lib/oauth.ts` around lines 52 - 60, Update the OAuthInterceptor
constructor’s debug assignment to honor the supplied OAuth-level config.debug
value passed by RestClient, while preserving the existing restClientConfig.debug
fallback when the OAuth option is absent.
🧹 Nitpick comments (2)
jest.config.js (1)

3-3: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Avoid disabling TypeScript diagnostics without a required CI typecheck.

diagnostics: false lets Jest execute code with broken TypeScript contracts, weakening the migration’s validation. Keep diagnostics enabled or ensure CI runs tsc --noEmit as a required check.

🤖 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 `@jest.config.js` at line 3, Update the ts-jest configuration in the TypeScript
transform entry to remove diagnostics: false so Jest performs TypeScript
diagnostics, or alternatively add a required CI tsc --noEmit check. Preserve the
existing tsconfig.json configuration.
.eslintrc (1)

24-27: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Scope the disabled import rules instead of disabling them globally.

Turning off import/no-unresolved and import/extensions for the entire repository can hide broken imports outside the TypeScript source. Prefer configuring the TypeScript resolver or applying overrides only to the affected files.

🤖 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 @.eslintrc around lines 24 - 27, Update the ESLint configuration entries for
import/no-unresolved and import/extensions to apply only through a
TypeScript-specific resolver or targeted file overrides, rather than disabling
them repository-wide. Preserve the existing camelcase and valid-jsdoc settings,
and ensure unaffected JavaScript files continue receiving import validation.
🤖 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 `@__tests__/oauth.spec.js`:
- Around line 5-7: The axios mock’s isAxiosError implementation in the
jest.mock('axios', ...) block incorrectly identifies errors by response
presence; match real Axios by requiring error.isAxiosError === true, and update
the test’s rejected error value to include isAxiosError: true when it represents
an AxiosError.
In `@src/lib/rest.ts`:
- Around line 53-59: Export the RestClientOptions interface so the
ConstructorParameters<typeof RestClient>[0] type used by helpers.getServerResult
remains publicly nameable during declaration emit. Change only the interface’s
visibility and preserve its existing fields and types.
---
Outside diff comments:
In `@src/lib/oauth.ts`:
- Around line 52-60: Update the OAuthInterceptor constructor’s debug assignment
to honor the supplied OAuth-level config.debug value passed by RestClient, while
preserving the existing restClientConfig.debug fallback when the OAuth option is
absent.
---
Nitpick comments:
In @.eslintrc:
- Around line 24-27: Update the ESLint configuration entries for
import/no-unresolved and import/extensions to apply only through a
TypeScript-specific resolver or targeted file overrides, rather than disabling
them repository-wide. Preserve the existing camelcase and valid-jsdoc settings,
and ensure unaffected JavaScript files continue receiving import validation.
In `@jest.config.js`:
- Line 3: Update the ts-jest configuration in the TypeScript transform entry to
remove diagnostics: false so Jest performs TypeScript diagnostics, or
alternatively add a required CI tsc --noEmit check. Preserve the existing
tsconfig.json configuration.
🪄 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: fffa4a88-0e2d-4af0-a88e-987e39f808e7

📥 Commits

Reviewing files that changed from the base of the PR and between 97b9c82 and e383ed9.

📒 Files selected for processing (49)
  • .eslintrc
  • .github/workflows/publish.yml
  • .gitignore
  • __tests__/client-id.spec.js
  • __tests__/config.spec.js
  • __tests__/helpers.spec.js
  • __tests__/oauth.spec.js
  • __tests__/proxyHelper.spec.js
  • __tests__/publicReportingAPI.spec.js
  • __tests__/report-portal-client.spec.js
  • __tests__/rest.spec.js
  • __tests__/statistics.spec.js
  • index.d.ts
  • jest.config.js
  • lib/constants/events.js
  • lib/constants/statuses.js
  • lib/publicReportingAPI.js
  • package.json
  • src/constants.ts
  • src/helpers.ts
  • src/lib/commons/config.ts
  • src/lib/commons/errors.ts
  • src/lib/constants/events.ts
  • src/lib/constants/index.ts
  • src/lib/constants/launchModes.ts
  • src/lib/constants/logLevels.ts
  • src/lib/constants/outputs.ts
  • src/lib/constants/statuses.ts
  • src/lib/constants/testItemTypes.ts
  • src/lib/helpers.ts
  • src/lib/logger.ts
  • src/lib/models/common.ts
  • src/lib/models/config.ts
  • src/lib/models/index.ts
  • src/lib/models/requests.ts
  • src/lib/models/responses.ts
  • src/lib/oauth.ts
  • src/lib/pjson.ts
  • src/lib/proxyHelper.ts
  • src/lib/publicReportingAPI.ts
  • src/lib/report-portal-client.ts
  • src/lib/rest.ts
  • src/models.ts
  • src/statistics/client-id.ts
  • src/statistics/constants.ts
  • src/statistics/statistics.ts
  • src/types/vendor.d.ts
  • statistics/constants.js
  • tsconfig.json
💤 Files with no reviewable changes (5)
  • lib/publicReportingAPI.js
  • lib/constants/statuses.js
  • statistics/constants.js
  • lib/constants/events.js
  • index.d.ts

Comment thread__tests__/oauth.spec.js Outdated
Comment threadsrc/lib/rest.ts Outdated

@coderabbitaicoderabbitaiBot 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.

🧹 Nitpick comments (1)
__tests__/oauth.spec.js (1)

403-433: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Assert the proxy wiring, not only the log.

This test proves that the proxy branch is entered, but not that axios.post receives the appropriate agent and proxy: false. Capture the request config and assert those fields to protect the actual proxy contract.

Suggested assertion
 expect(consoleSpy).toHaveBeenCalledWith(
`[OAuth] Making token request to ${baseConfig.tokenEndpoint} with proxy agent`,
'',
);
+ const requestConfig = axios.post.mock.calls[0][2];+ expect(requestConfig.proxy).toBe(false);+ expect(requestConfig.httpsAgent ?? requestConfig.httpAgent).toBeDefined();
🤖 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 `@__tests__/oauth.spec.js` around lines 403 - 433, Update the test “logs the
proxied token request when debug and proxy are both enabled” to capture the
config passed to axios.post and assert that the request uses the configured
proxy agent and sets proxy to false, while preserving the existing token and log
assertions.
🤖 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.
Nitpick comments:
In `@__tests__/oauth.spec.js`:
- Around line 403-433: Update the test “logs the proxied token request when
debug and proxy are both enabled” to capture the config passed to axios.post and
assert that the request uses the configured proxy agent and sets proxy to false,
while preserving the existing token and log assertions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: fcf07188-9241-4267-a4c8-e47ac9002ea1

📥 Commits

Reviewing files that changed from the base of the PR and between e383ed9 and 8a069ec.

📒 Files selected for processing (7)
  • .eslintrc
  • __tests__/oauth.spec.js
  • __tests__/rest.spec.js
  • src/helpers.ts
  • src/lib/commons/config.ts
  • src/lib/models/config.ts
  • src/lib/rest.ts
🚧 Files skipped from review as they are similar to previous changes (6)
  • src/helpers.ts
  • tests/rest.spec.js
  • .eslintrc
  • src/lib/models/config.ts
  • src/lib/commons/config.ts
  • src/lib/rest.ts

@coderabbitaicoderabbitaiBot 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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/lib/report-portal-client.ts (1)

375-385: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Propagate REST failures instead of converting them to success.

mergeLaunches continues with launch/merge after a search failure, using an empty launch list, and both merge and file-upload catches resolve normally. This can issue invalid merge requests and make failed log uploads appear successful.

Proposed fix
- (error): Array<string | number> => {+ (error) => {
this.logDebug(`Error during launches search with UUIDs: ${launchUUIds}`, error);
console.dir(error);
- return [];+ throw error;
},
...
.catch((error) => {
this.logDebug(`Error merging launches with UUIDs: ${launchUUIds}`, error);
console.dir(error);
+ throw error;
});
...
.catch((error) => {
this.logDebug(`Error save log with file: ${fileObj.name}`, error);
console.dir(error);
+ throw error;
});

Also applies to: 393-396, 721-734

🤖 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 `@src/lib/report-portal-client.ts` around lines 375 - 385, Update mergeLaunches
and the related file-upload error handlers to rethrow or reject REST failures
after logging instead of returning successful fallback values. In the launch
UUID search catch, do not continue to getMergeLaunchesRequest or call
launch/merge with an empty list; ensure the promise remains rejected. Apply the
same failure propagation to the catches around the upload flow at the referenced
symbols.
🤖 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.
Outside diff comments:
In `@src/lib/report-portal-client.ts`:
- Around line 375-385: Update mergeLaunches and the related file-upload error
handlers to rethrow or reject REST failures after logging instead of returning
successful fallback values. In the launch UUID search catch, do not continue to
getMergeLaunchesRequest or call launch/merge with an empty list; ensure the
promise remains rejected. Apply the same failure propagation to the catches
around the upload flow at the referenced symbols.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a827787d-3d6f-46f4-8b06-1698f26f436c

📥 Commits

Reviewing files that changed from the base of the PR and between 8a069ec and af4ffe1.

📒 Files selected for processing (3)
  • __tests__/report-portal-client.spec.js
  • src/lib/models/requests.ts
  • src/lib/report-portal-client.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • tests/report-portal-client.spec.js
  • src/lib/models/requests.ts

@AmsterGetAmsterGet left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice work!
Let's polish this before merging.
General comments:

  • pay attention to pipeline warnings
  • get rid of any
  • test this PR with the agent written on plain JS (e.g. Cypress)

Comment threadsrc/lib/helpers.ts Outdated
Comment threadsrc/lib/helpers.ts Outdated
Comment threadsrc/lib/logger.ts Outdated
Comment threadsrc/lib/proxyHelper.ts Outdated
Comment threadsrc/lib/publicReportingAPI.ts
Comment threadsrc/lib/report-portal-client.ts Outdated
Comment threadsrc/constants.ts Outdated
Comment thread.gitignore Outdated
Comment threadjest.config.js
Comment threadpackage.json Outdated

@coderabbitaicoderabbitaiBot 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.

🧹 Nitpick comments (1)
.eslintrc (1)

26-26: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Keep unresolved-import validation enabled.

Disabling import/no-unresolved globally can allow broken src and package imports to pass lint. Configure the TypeScript resolver instead, or scope this disablement only to files that genuinely require it.

🤖 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 @.eslintrc at line 26, Remove the global disablement of import/no-unresolved
in the ESLint configuration. Configure the TypeScript import resolver so valid
TypeScript and package imports resolve correctly, or narrowly scope any
remaining disablement only to files that genuinely require it.
🤖 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.
Nitpick comments:
In @.eslintrc:
- Line 26: Remove the global disablement of import/no-unresolved in the ESLint
configuration. Configure the TypeScript import resolver so valid TypeScript and
package imports resolve correctly, or narrowly scope any remaining disablement
only to files that genuinely require it.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a5b89f07-d93f-49d7-bcdd-c9a2d3ae8559

📥 Commits

Reviewing files that changed from the base of the PR and between af4ffe1 and 00c2c81.

📒 Files selected for processing (16)
  • .eslintrc
  • __tests__/helpers.spec.js
  • __tests__/report-portal-client.spec.js
  • package.json
  • src/lib/commons/config.ts
  • src/lib/constants/outputs.ts
  • src/lib/helpers.ts
  • src/lib/logger.ts
  • src/lib/models/index.ts
  • src/lib/models/reporting.ts
  • src/lib/oauth.ts
  • src/lib/proxyHelper.ts
  • src/lib/publicReportingAPI.ts
  • src/lib/report-portal-client.ts
  • src/lib/rest.ts
  • src/statistics/statistics.ts
💤 Files with no reviewable changes (6)
  • src/lib/logger.ts
  • src/lib/constants/outputs.ts
  • src/lib/oauth.ts
  • src/statistics/statistics.ts
  • src/lib/commons/config.ts
  • src/lib/rest.ts
🚧 Files skipped from review as they are similar to previous changes (5)
  • src/lib/models/index.ts
  • tests/helpers.spec.js
  • src/lib/publicReportingAPI.ts
  • src/lib/proxyHelper.ts
  • src/lib/report-portal-client.ts

Comment threadsrc/lib/models/reporting.ts Outdated
Comment threadsrc/lib/publicReportingAPI.ts
Comment threadsrc/lib/report-portal-client.ts Outdated
Comment threadsrc/lib/report-portal-client.ts Outdated
Comment threadpackage.json Outdated
@maria-hambardzumian
maria-hambardzumian merged commit f88818d into developAug 13, 2026
8 checks passed
@maria-hambardzumian
maria-hambardzumian deleted the feature/EPMRPP-89496-migrate-to-typescript branch August 13, 2026 09:49
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@maria-hambardzumian@AmsterGet