Skip to content

CLI-837 Move remaining commands/_common files, reorganize core/host - #646

Merged
georgii-borovinskikh-sonarsource merged 4 commits into
masterfrom
gb/r16
Jul 30, 2026
Merged

CLI-837 Move remaining commands/_common files, reorganize core/host#646
georgii-borovinskikh-sonarsource merged 4 commits into
masterfrom
gb/r16

Conversation

@georgii-borovinskikh-sonarsource

@georgii-borovinskikh-sonarsource georgii-borovinskikh-sonarsource commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary by Gitar

  • Refactoring:
    • Moved remaining common files and reorganized core/host and core/auth modules
    • Updated import paths across commands and tests to match the new directory structure

This will update automatically on new commits.

@hashicorp-vault-sonar-prod

hashicorp-vault-sonar-prod Bot commented Jul 30, 2026

Copy link
Copy Markdown

CLI-837

Comment thread tests/unit/commands/update/update-version.test.ts
@netlify

netlify Bot commented Jul 30, 2026

Copy link
Copy Markdown

Deploy Preview for sonarqube-cli canceled.

Name Link
🔨 Latest commit 8abbdfb
🔍 Latest deploy log https://app.netlify.com/projects/sonarqube-cli/deploys/6a6b673f75515200083b0c5f

Comment thread tests/unit/commands/analyze/secrets-install.test.ts
@georgii-borovinskikh-sonarsource
georgii-borovinskikh-sonarsource merged commit 29355a4 into master Jul 30, 2026
9 of 10 checks passed
@gitar-bot

gitar-bot Bot commented Jul 30, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 3 resolved / 3 findings

Reorganizes core/host and core/auth modules and moves remaining common command files while updating all corresponding import paths, mock module paths, and documentation references.

✅ 3 resolved
Bug: Stale mock.module path breaks isWindows mocking in update test

📄 tests/unit/commands/update/update-version.test.ts:59 📄 tests/unit/commands/update/update-version.test.ts:61
The import at line 59 was updated to @/core/host/environment/platform-detector.ts, but the mock.module(...) call at line 61 still targets the old @/core/host/platform-detector.js path, which no longer exists after this PR moved the file. Because the mocked specifier no longer resolves to the module actually imported by update-check.ts, the isWindowsMock override no longer takes effect — tests that call isWindowsMock.mockReturnValue(true) to exercise the Windows branch will silently fall through to the real isWindows() (false on Linux CI), giving false confidence or failing. Update the mock.module path to @/core/host/environment/platform-detector.ts to match the import (see the correctly-updated tool-detector.test.ts).

Quality: CLAUDE.md/AGENTS.md still reference moved commands/_common paths

📄 CLAUDE.md
This PR moved sonar-command.ts out of src/commands/_common/ (into src/commands/) and agent-prompt-hint.ts into src/core/ui/components/, and CLAUDE.md was partially updated (signatures path) — but CLAUDE.md and AGENTS.md still instruct declaring commands using src/commands/_common/sonar-command.ts, and stale comments reference src/commands/_common/*. The project's documentation requirement is to update CLAUDE.md/AGENTS.md when moving files. Update these references to the new paths to avoid pointing contributors at nonexistent files.

Bug: Stale mock.module path in secrets-install.test.ts

📄 tests/unit/commands/analyze/secrets-install.test.ts:41-44
Line 41 imports the real module from the new path @/core/host/install/sonarsource-releases.ts, but line 42 still registers mock.module() against the OLD path @/core/host/sonarsource-releases.ts, which no longer exists after this move. The intent (make the module a mutable object so spyOn can patch downloadBinary/verifyBinarySignature per test) no longer applies to the module actually consumed by install/secrets.ts, so the per-test spies won't intercept the real code path (or spyOn will fail on the frozen ES namespace). Update the mock.module argument to @/core/host/install/sonarsource-releases.ts to match the import.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@sonarqubecloud

Copy link
Copy Markdown

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.

2 participants