Skip to content

fix: add all found executables to PATH - #22

Merged
alkoleft merged 1 commit into
mainfrom
fix/add-all-executables-to-path
Oct 28, 2026
Merged

alkoleft merged 1 commit into
mainfrom
fix/add-all-executables-to-path

Conversation

@alkoleft

@alkoleft alkoleft commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Описание

После рефакторинга #20 (ad7affb) PathManager.addExecutablesToPath добавляет в PATH только первый найденный исполняемый файл: break при переносе кода из updatePath() оказался во внешнем цикле по списку executables вместо внутреннего цикла по результатам glob.

До рефакторинга break завершал только обход результатов glob для одного имени файла, и в PATH попадали все исполняемые файлы из списка getRunFileNames().

Последствия бага

Для EDT список такой: ['ring', '1cedtcli.sh'] (Linux). В PATH добавляется только каталог ring, а каталог 1cedtcli.sh — нет. Все последующие шаги, вызывающие 1cedtcli.sh (например, alkoleft/onec-edtcli-command-action), падают:

Error: Unable to locate executable file: 1cedtcli.sh.
Please verify either the file path exists or the file can be found
within a directory specified by the PATH environment variable.

Пример упавшего workflow: https://github.com/bia-technologies/yaxunit/actions/runs/40744254070/job/123013706550 (шаг «Установка 1C:EDT» успешен, в логе только add to PATH .../ring, следующий шаг не находит 1cedtcli.sh).

Все прогоны yaxunit с шагом конвертации EDT падают с 05.02.2026 — с момента, когда @main подтянул e1cd593.

Изменения

  • Убран break в src/tools/pathManager.ts — в PATH добавляются все найденные исполняемые файлы (возвращена семантика до рефакторинга).
  • Пересобран dist/ (pnpm run package), diff диста содержит ровно то же удаление break.

Проверено

  • pnpm run format:check — ok
  • pnpm run lint — 0 ошибок (12 warnings — ранее существующие, не из этого PR)
  • pnpm run package — собран, diff dist/ соответствует изменению src
  • Тестов на pathManager в проекте нет (ci-test пустой)

Summary by CodeRabbit

  • Bug Fixes
    • PATH now includes the directories of all matching executables, rather than only the first one found. This helps ensure each available executable can be accessed through PATH.

Рефакторинг #20 случайно изменил семантику addExecutablesToPath:
break вышел из внешнего цикла по списку исполняемых файлов, поэтому
в PATH добавлялся только первый найденный (ring), а 1cedtcli.sh
перестал находиться последующими шагами workflow.

Убрал break: в PATH добавляются все найденные исполнаемые файлы,
как было до рефакторинга.
@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a492e3c5-b8ef-43d0-9daa-9d63e3fbf8a4
Commits

Reviewing files that changed from the base of the PR and between e1cd593 and e95ce6b.

Files ignored due to path filters: 2
  • dist/index.js is excluded by !**/dist/**
  • dist/index.js.map is excluded by !**/dist/**, !**/*.map
Files selected for processing: 1
  • src/tools/pathManager.ts
Files with no reviewable changes: 1
  • src/tools/pathManager.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

PathManager.addExecutablesToPath now continues checking executable names after it finds a match. It adds each matching executable’s directory to PATH.

Changes: PATH executable discovery

Layer / File(s) Summary
Check all executable names
src/tools/pathManager.ts
The loop continues after adding a matching executable’s directory to PATH.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix

Merge Risk: Minimal · up to e95ce

No merge-blocking issue is identified; normal checks remain appropriate before merging.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: adding all found executable directories to PATH.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files.

Finishing Touches: 💡 1
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@alkoleft

Copy link
Copy Markdown
Member Author

Красный чек TypeScript Tests — pre-existing, не связан с правкой: на чистом main локально падают те же 8 тестов (ongetjs/downloader — «Do not set login or/and password»), им нужны переменные .env/секреты, отсутствующие в CI. В этом PR поведение тестов не менялось.

Существенные проверки: Check dist/ — pass, GitHub Actions Test (реальный прогон action) — pass.

@alkoleft
alkoleft merged commit 9f2e543 into main Oct 28, 2026
6 of 8 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.

1 participant