Add project Windows runtime selection (#5519)

* Add project Windows runtime selection

* Fix project Windows runtime selection

Co-authored-by: Orca <help@stably.ai>

* fix: preserve WSL shell variables

---------

Co-authored-by: Jinwoo-H <jinwoo0825@gmail.com>
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Neil <neil@stably.ai>
This commit is contained in:
slashdevcorpse
2026-06-17 16:08:14 -07:00
committed by GitHub
co-authored by Orca Jinwoo-H Neil
parent 25d2053b25
commit 0ec3882cb8
333 changed files with 21039 additions and 5507 deletions
+54 -4
View File
@@ -32,12 +32,23 @@ const {
vi.mock('./gh-utils', () => ({
execFileAsync: execFileAsyncMock,
ghExecFileAsync: ghExecFileAsyncMock,
githubRepoContext: (repoPath: string, connectionId?: string | null) => ({
githubRepoContext: (
repoPath: string,
connectionId?: string | null,
localGitOptions: { wslDistro?: string } = {}
) => ({
repoPath,
connectionId: connectionId ?? null
connectionId: connectionId ?? null,
...(localGitOptions.wslDistro ? { wslDistro: localGitOptions.wslDistro } : {})
}),
ghRepoExecOptions: (context: { repoPath: string; connectionId?: string | null }) =>
context.connectionId ? {} : { cwd: context.repoPath },
ghRepoExecOptions: (context: {
repoPath: string
connectionId?: string | null
wslDistro?: string
}) =>
context.connectionId
? {}
: { cwd: context.repoPath, ...(context.wslDistro ? { wslDistro: context.wslDistro } : {}) },
getOwnerRepo: getOwnerRepoMock,
getIssueOwnerRepo: getIssueOwnerRepoMock,
getOwnerRepoForRemote: getOwnerRepoForRemoteMock,
@@ -227,6 +238,45 @@ describe('listWorkItems', () => {
])
})
it('routes local WSL work-item listing through repo resolution and gh execution options', async () => {
const localGitOptions = { wslDistro: 'Ubuntu' }
resolveIssueSourceMock.mockResolvedValue({
source: { owner: 'acme', repo: 'widgets' },
fellBack: false
})
getOwnerRepoMock.mockResolvedValue({ owner: 'acme', repo: 'widgets' })
getOwnerRepoForRemoteMock.mockResolvedValue(null)
ghExecFileAsyncMock.mockResolvedValue({ stdout: '[]' })
await listWorkItems(
'/repo-root',
5,
undefined,
undefined,
undefined,
null,
false,
localGitOptions
)
expect(resolveIssueSourceMock).toHaveBeenCalledWith(
'/repo-root',
undefined,
null,
localGitOptions
)
expect(getOwnerRepoMock).toHaveBeenCalledWith('/repo-root', null, localGitOptions)
expect(getOwnerRepoForRemoteMock).toHaveBeenCalledWith(
'/repo-root',
'upstream',
null,
localGitOptions
)
expect(ghExecFileAsyncMock.mock.calls.every((call) => call[1]?.wslDistro === 'Ubuntu')).toBe(
true
)
})
it('hydrates PR list rows with repository merge metadata', async () => {
getIssueOwnerRepoMock.mockResolvedValueOnce({ owner: 'acme', repo: 'widgets' })
getOwnerRepoMock.mockResolvedValueOnce({ owner: 'acme', repo: 'widgets' })