Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2026 Han Li and contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

.git
.gitignore
.idea
Expand Down
14 changes: 14 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
# Copyright 2026 Han Li and contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

* text=auto eol=lf
14 changes: 14 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2026 Han Li and contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: E2E

on:
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/license.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2026 Han Li and contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: License

on:
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2026 Han Li and contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Lint

on:
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2026 Han Li and contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Plugin

on:
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2026 Han Li and contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Test Plugin

on:
Expand Down
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
# Copyright 2026 Han Li and contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

.idea
19 changes: 9 additions & 10 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# License header check (Apache SkyWalking Eyes): Go and Lua are both covered.
# License header check (Apache SkyWalking Eyes): Go, Lua, YAML, TOML,
# Dockerfiles, ignore files and similar text formats are covered.
# Some headers stay hand-written because `header fix` cannot place them:
# go.mod and .gitattributes have no comment style upstream, the Windows
# Dockerfiles must keep `# escape=` on line 1 (their headers sit right
# below it), and the fixer only recognises the exact name `Dockerfile`,
# not Dockerfile-runner. The checker still verifies them all.
# PowerShell is check-only here (no `<# ... #>` fix support upstream):
# tests/e2e/windows/*.ps1 is fixed and checked with addlicense instead (see
# the addlicense step in .github/workflows/license.yml and docs/e2e.md).
Expand All @@ -38,18 +44,11 @@ header:
limitations under the License.

paths-ignore:
# Documentation and data files carry no license header.
# Files without the header by design; go.sum cannot take one at all (the
# go tool parses every non-empty line as a hash record).
- '**/*.md'
- '**/*.yaml'
- '**/*.yml'
- '**/*.json'
- '**/*.toml'
- '**/go.mod'
- '**/go.sum'
- '**/Dockerfile*'
- '.gitignore'
- '.gitattributes'
- '.dockerignore'
- '.tool-versions'
- 'LICENSE'
# Plain-text template for addlicense (no comment markers in it; keep its
Expand Down
7 changes: 7 additions & 0 deletions docs/e2e.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ needs an ARM64 host (a Copilot+ PC or the `windows-11-arm` CI runner).
The `windows-11-arm` runner has no Windows Hypervisor Platform feature,
so Hyper-V isolation is unavailable; process isolation needs only the Containers feature.

The `main` combos run with `VFOX_HOME` pointing inside a path containing a
space (`C:\Users\John Doe\.vfox`), mirroring
[issue #33](https://github.com/version-fox/vfox-flutter/issues/33). Only vfox
`main` carries the fix for such paths
([vfox#712](https://github.com/version-fox/vfox/pull/712)), so `latest`
combinations still run with an unspaced home.

### x64

1. Execute in Windows PowerShell 5.1,
Expand Down
9 changes: 9 additions & 0 deletions lib/git.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,17 @@ local GH_BASE = "https://github.com/"

local M = {}

-- Quote a path for the platform shell. On Windows the shell is cmd.exe:
-- vfox main passes the command line through verbatim (the fix for
-- version-fox/vfox#712), so a path containing spaces (C:\Users\John
-- Doe\.vfox) is safe in double quotes. Paths that need no quoting stay
-- bare: released vfox builds re-quote the command line themselves and
-- mangle embedded double quotes, and they never supported spaces anyway.
local function quote(value)
if RUNTIME.osType == "windows" then
if value:find("%s") then
return '"' .. value .. '"'
end
return value
end
return "'" .. value:gsub("'", "'\\''") .. "'"
Expand Down
15 changes: 9 additions & 6 deletions lib/manifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,17 @@ local function joinPath(a, b)
return a .. sep() .. b
end

-- vfox feeds command strings to cmd.exe /c on Windows. Go has to re-quote the
-- whole command line, which turns a double quote into \" so cmd.exe reads a
-- quoted path back as the volume-relative path \path\ and rejects it with
-- "The filename, directory name, or volume label syntax is incorrect." Match
-- lib/git.lua and pass paths unquoted there; a path with a space then simply
-- skips the drift check instead of breaking vfox use.
-- Quote a path for the platform shell. On Windows the shell is cmd.exe:
-- vfox main passes the command line through verbatim (the fix for
-- version-fox/vfox#712), so a path containing spaces (C:\Users\John
-- Doe\.vfox) is safe in double quotes. Paths that need no quoting stay
-- bare: released vfox builds re-quote the command line themselves and
-- mangle embedded double quotes, and they never supported spaces anyway.
local function quote(value)
if RUNTIME.osType == "windows" then
if value:find("%s") then
return '"' .. value .. '"'
end
return value
end
return "'" .. value:gsub("'", "'\\''") .. "'"
Expand Down
14 changes: 14 additions & 0 deletions stylua.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2026 Han Li and contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

column_width = 120
line_endings = "Unix"
indent_type = "Spaces"
Expand Down
14 changes: 14 additions & 0 deletions tests/e2e/go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2026 Han Li and contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

module github.com/version-fox/vfox-flutter/tests/e2e

go 1.25.0
Expand Down
14 changes: 14 additions & 0 deletions tests/e2e/linux/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2026 Han Li and contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

FROM ubuntu:26.04

ENV DEBIAN_FRONTEND=noninteractive
Expand Down
14 changes: 14 additions & 0 deletions tests/e2e/linux/compose.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2026 Han Li and contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Host-side runner for the Linux container E2E suite (see docs/e2e.md).
#
# docker compose -f tests/e2e/linux/compose.yaml run --rm e2e
Expand Down
13 changes: 13 additions & 0 deletions tests/e2e/windows/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
# escape=`
# Copyright 2026 Han Li and contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
ARG BASE_IMAGE=mcr.microsoft.com/windows/servercore:ltsc2025-KB5122871-amd64
FROM ${BASE_IMAGE}

Expand Down
14 changes: 14 additions & 0 deletions tests/e2e/windows/Dockerfile-runner
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
# escape=`
# Copyright 2026 Han Li and contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Runner image for the Windows container E2E suite: stock servercore plus the
# pinned Go toolchain, so no host Go is needed on any arch. (There is no
# stock golang Windows image for arm64, hence this file instead of pinning
Expand Down
14 changes: 14 additions & 0 deletions tests/e2e/windows/compose.amd64.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2026 Han Li and contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Host-side runner for the Windows container E2E suite on amd64 hosts
# (see docs/e2e.md).
#
Expand Down
14 changes: 14 additions & 0 deletions tests/e2e/windows/compose.arm64.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2026 Han Li and contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Host-side runner for the Windows container E2E suite on arm64 hosts
# (see docs/e2e.md).
#
Expand Down
5 changes: 3 additions & 2 deletions tests/e2e/windows/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ func buildImage(t *testing.T, ctx context.Context, repoRoot, image, platform, ba
// runOne starts one long-lived container per combo and drives the whole
// E2E flow (setup -> preflight -> install -> verify) through pwsh exec
// calls, asserting in Go. A combo passes when every phase exits 0 and the
// outputs carry the expected markers.
// outputs carry the expected markers. vfox main combos run against a
// VFOX_HOME containing a space (see vfoxHome).
func runOne(t *testing.T, ctx context.Context, image, platform string, c common.Combo) {
t.Helper()
prefix := c.Prefix(platform)
Expand Down Expand Up @@ -185,7 +186,7 @@ func runOne(t *testing.T, ctx context.Context, image, platform string, c common.
procArch := procArchOfContainer(ctx, t, ctr)
t.Logf("=== vfox %s, flutter %s, %s, mirror %s, %s ===", c.Vfox, version, flavor, mirror, procArch)

box := setupSlotEnv(ctx, t, ctr, c.Slug())
box := setupSlotEnv(ctx, t, ctr, c.Slug(), c.Vfox)
checkMirrorReachable(ctx, t, ctr, flavor, mirror)
setupVfox(ctx, t, ctr, box, c.Vfox)
checkBogusMirrorRejected(ctx, t, ctr, box, flavor, version)
Expand Down
Loading
Loading