Skip to content

fix: tests fails#139

Merged
vitonsky merged 5 commits into
masterfrom
138-tests-fails
May 8, 2026
Merged

fix: tests fails#139
vitonsky merged 5 commits into
masterfrom
138-tests-fails

Conversation

@vitonsky
Copy link
Copy Markdown
Member

@vitonsky vitonsky commented May 8, 2026

Closes #138

It seems the YandexTranslate module is unstable. It sometimes work, sometimes don't.
The captcha solving is solves a problem, but next challenge happens in few minutes.

So we move the YandexTranslate module into unstable dir.

@vitonsky vitonsky linked an issue May 8, 2026 that may be closed by this pull request
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 8, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

YandexTranslator is moved from stable to unstable exports due to test failures. Documentation and barrel exports are updated, internal import paths are corrected, tests are adjusted to exclude it, package version bumps to 3.4.0, and dev dependencies are downgraded with type safety improvements.

Changes

YandexTranslator Reclassification

Layer / File(s) Summary
Documentation & Export Reclassification
README.md, src/translators/index.ts
YandexTranslator is moved from the free translators list to unstable translators in documentation; stable export is removed from index.ts.
Import Path Corrections
src/translators/unstable/YandexTranslator/YandexSidFetcher.ts, src/translators/unstable/YandexTranslator/index.ts
Internal imports are updated to correct relative paths: Fetcher type now imports from ../../../utils/fetcher/types and BaseTranslator imports from ../../BaseTranslator.
Test Suite Updates
src/translators/__tests__/translators.test.ts, src/translators/__tests__/translators.benchmark.test.ts
YandexTranslator is removed from stable test harnesses and benchmark scorer lists.

Package & Build Updates

Layer / File(s) Summary
Version & Dependency Updates
package.json
Package version bumped to 3.4.0; @xenova/transformers downgraded from ^2.17.2 to ^2.0.1; gulp-sourcemaps downgraded from ^3.0.0 to ^2.6.5.
Benchmark Type Safety
src/translators/__tests__/benchmark.ts
ESLint disable directives suppress TypeScript safety checks; pipeline construction is type-asserted as Promise<FeatureExtractionPipeline>.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A translator found the unstable ground,
Yandex hops to where tests aren't around,
Paths realigned, the exports refined,
Version bumped up, dependencies downsized kind,
All in the warren, changes are fair!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is vague and grammatically incorrect ("tests fails"), and does not clearly convey what was actually changed in this PR (moving YandexTranslator to unstable and fixing tests). Revise the title to be more specific and descriptive, such as 'fix: move YandexTranslator to unstable and fix tests' or 'fix: address failing YandexTranslator tests by moving to unstable'.
Out of Scope Changes check ❓ Inconclusive Changes to package.json (version bump and dev dependency downgrades) appear tangential to the primary objective of moving YandexTranslator to unstable, though they may be necessary fixes. Clarify whether the package.json version bump and dependency downgrades are essential to fixing the YandexTranslator tests or if they should be in a separate PR.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR successfully addresses issue #138 by moving YandexTranslator to the unstable section, removing it from stable translator tests and exports, and updating related dependencies.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 138-tests-fails

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

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

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

⚠️ Outside diff range comments (1)
README.md (1)

87-110: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Update the Yandex example import path to unstable.

YandexTranslator is now documented as unstable, but the example still imports it from the stable barrel. That will break for users following the README.

📌 Proposed doc fix
- import { YandexTranslator } from 'anylang/translators';
+ import { YandexTranslator } from 'anylang/translators/unstable';
🤖 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 `@README.md` around lines 87 - 110, The README example imports YandexTranslator
from the stable barrel but YandexTranslator is in the unstable subdirectory;
update the import path in the example so the import uses the unstable barrel
(replace import { YandexTranslator } from 'anylang/translators' with the
unstable import path) to prevent broken examples for users trying to instantiate
YandexTranslator in the README example.
🧹 Nitpick comments (1)
src/translators/__tests__/benchmark.ts (1)

1-4: ⚡ Quick win

Consider narrowing ESLint suppressions to specific lines.

File-wide ESLint suppressions reduce type safety across the entire file. If only a few operations require these suppressions (e.g., line 35's output.data access), prefer inline // eslint-disable-next-line comments immediately above those lines instead of disabling rules for the entire file.

This improves maintainability by keeping type safety active where possible and making it clear which specific operations require the suppressions.

🤖 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/translators/__tests__/benchmark.ts` around lines 1 - 4, Current file-wide
ESLint disables at the top of src/translators/__tests__/benchmark.ts are too
broad; remove those global disable comments and instead apply targeted inline
disables only where needed (for example, the specific access to output.data in
the benchmark test and any other single
unsafe-member-access/unsafe-assignment/unsafe-argument occurrences). Locate the
test that references output.data and replace the file-level suppressions with //
eslint-disable-next-line comments immediately above the exact expressions
(referencing the output variable and its use of .data) so the rest of the file
retains normal TypeScript linting and type-safety.
🤖 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 `@package.json`:
- Line 3: The package version in package.json is currently "3.4.0" but this
change is a breaking API change (removal of YandexTranslator from the stable
export), so bump the major version to "4.0.0" by updating the "version" field in
package.json (ensure the "version" key is changed from "3.4.0" to "4.0.0"); also
update any release notes/changelog and CI/release metadata that rely on the
package version to reflect the major bump.

---

Outside diff comments:
In `@README.md`:
- Around line 87-110: The README example imports YandexTranslator from the
stable barrel but YandexTranslator is in the unstable subdirectory; update the
import path in the example so the import uses the unstable barrel (replace
import { YandexTranslator } from 'anylang/translators' with the unstable import
path) to prevent broken examples for users trying to instantiate
YandexTranslator in the README example.

---

Nitpick comments:
In `@src/translators/__tests__/benchmark.ts`:
- Around line 1-4: Current file-wide ESLint disables at the top of
src/translators/__tests__/benchmark.ts are too broad; remove those global
disable comments and instead apply targeted inline disables only where needed
(for example, the specific access to output.data in the benchmark test and any
other single unsafe-member-access/unsafe-assignment/unsafe-argument
occurrences). Locate the test that references output.data and replace the
file-level suppressions with // eslint-disable-next-line comments immediately
above the exact expressions (referencing the output variable and its use of
.data) so the rest of the file retains normal TypeScript linting and
type-safety.
🪄 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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c8e5ebff-811f-416d-9a1e-576a249bcf9d

📥 Commits

Reviewing files that changed from the base of the PR and between 0fbb42f and 23b9e86.

⛔ Files ignored due to path filters (2)
  • package-lock.json is excluded by !**/package-lock.json
  • src/translators/__tests__/__snapshots__/translators.benchmark.test.ts.snap is excluded by !**/*.snap
📒 Files selected for processing (8)
  • README.md
  • package.json
  • src/translators/__tests__/benchmark.ts
  • src/translators/__tests__/translators.benchmark.test.ts
  • src/translators/__tests__/translators.test.ts
  • src/translators/index.ts
  • src/translators/unstable/YandexTranslator/YandexSidFetcher.ts
  • src/translators/unstable/YandexTranslator/index.ts
💤 Files with no reviewable changes (3)
  • src/translators/tests/translators.test.ts
  • src/translators/index.ts
  • src/translators/tests/translators.benchmark.test.ts

Comment thread package.json
@vitonsky vitonsky merged commit 92afea9 into master May 8, 2026
9 checks passed
Sign up for free to 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.

Tests fails

1 participant