Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
d88f617
Fix to respect special bit specified in the mode of copier
musaprg Sep 25, 2023
0db3c1f
Add tests
musaprg Sep 25, 2023
03de04d
Add support for always overwriting existing paths
sipsma Nov 6, 2023
bea810c
Migrate off of gogo/protobuf
kzys Nov 16, 2023
d22c3fa
Merge pull request #171 from kzys/bye-gogo
tonistiigi Nov 21, 2023
797bd68
Merge pull request #169 from sipsma/allow-replace
tonistiigi Nov 22, 2023
8bcf9db
Fix to use internal representation for setting special bits
musaprg Jan 6, 2024
9ff8718
Fix cross-device copy failing on macOS
slonopotamus Nov 12, 2023
b3997ab
followlinks: sanitize root path
crazy-max Jan 24, 2024
b6cfc0f
chore: fix typos in NewFilterFS docstring
jedevc Jan 24, 2024
9f6e333
Merge pull request #175 from jedevc/filter-fs-typos
crazy-max Jan 25, 2024
c402261
Merge pull request #174 from crazy-max/toslash
tonistiigi Jan 26, 2024
6ec7d91
Revert "Migrate off of gogo/protobuf"
crazy-max Jan 29, 2024
424e516
Merge pull request #176 from crazy-max/revert-rm-gogo
tonistiigi Jan 29, 2024
d9b0ef8
Merge pull request #170 from slonopotamus/darwin-cross-device-copy
tonistiigi Jan 29, 2024
1e7f306
Merge pull request #168 from musaprg/fix-to-respect-special-bits
tonistiigi Feb 7, 2024
9193209
chore: run once on vagrant init
crazy-max Jan 5, 2024
152fee1
ci: increase vm boot time to 15m
crazy-max Jan 5, 2024
c586cb2
ci: switch to macos-13 runner for freebsd job
crazy-max Jan 5, 2024
30180b0
ci: retry logic for freebsd test step
crazy-max Jan 5, 2024
a7e6995
Merge pull request #172 from crazy-max/ci-fix-freebsd
tonistiigi Feb 7, 2024
330b1ff
ci: add windows to test matrix
crazy-max Feb 7, 2024
b843da9
diskwriter: fix test scope
crazy-max Jan 24, 2024
3d01fa5
fix file path separator
crazy-max Jan 29, 2024
3e13e95
test with coverage and send to codecov
crazy-max Feb 7, 2024
e5c2801
ci: align events
crazy-max Jan 29, 2024
5bc2346
readme badges
crazy-max Jan 29, 2024
d68510a
Merge pull request #173 from crazy-max/ci-windows
tonistiigi Feb 8, 2024
6f63746
Merge pull request #177 from crazy-max/test-coverage
tonistiigi Feb 8, 2024
bf5b720
ci: fix test step for windows
crazy-max Feb 8, 2024
2865225
Merge pull request #178 from crazy-max/ci-fix-windows
tonistiigi Feb 8, 2024
fb90e5f
ci: bump actions to latest stable
crazy-max Feb 12, 2024
7f115c2
chore: dependabot to keep gha up to date
crazy-max Feb 12, 2024
cb7e6e6
update to go 1.21
crazy-max Feb 12, 2024
59183f0
update golangci-lint to 1.54.2
crazy-max Feb 12, 2024
ca0190e
dockerfile: update xx to 1.4.0
crazy-max Feb 12, 2024
35e1166
Merge pull request #180 from crazy-max/go121
tonistiigi Feb 13, 2024
ab7803b
filter: allow SkipDir return with lazy parents
jedevc Feb 19, 2024
d9cfebb
filter: ensure MapResult is followed for parent directories
jedevc Feb 19, 2024
b98da8a
chore: codecov config
crazy-max Feb 20, 2024
34ca0de
ci: set codecov token
crazy-max Feb 20, 2024
b847aa4
Merge pull request #183 from jedevc/fix-parent-interactions
tonistiigi Feb 21, 2024
7579271
ci: set workflow_dispatch event
crazy-max Feb 23, 2024
3092598
send: ensure file path to unix form when sending files
crazy-max Feb 23, 2024
a340b4b
Merge pull request #187 from crazy-max/send-unix-path
tonistiigi Feb 23, 2024
6773e0e
Merge pull request #181 from crazy-max/bump-gha
tonistiigi Feb 23, 2024
4631d49
Merge pull request #184 from crazy-max/codecov-token
tonistiigi Feb 23, 2024
7a889f5
Merge pull request #185 from crazy-max/ci-dispatch
tonistiigi Feb 23, 2024
216a08f
fix data race in progressCb
Jul 10, 2023
7525a1a
Merge pull request #164 from alexcb/acb/progressCurrent-race
crazy-max Mar 1, 2024
78f10b4
receive: ensure callback errors are propagated
jedevc Apr 3, 2024
e719253
receive: translate unix-paths off the wire to native
jedevc Apr 15, 2024
86c9caf
chore: remove old windows todo comments
jedevc Apr 15, 2024
9c5337f
Merge pull request #195 from jedevc/fix-disk-writer-ephemeral-err
tonistiigi Apr 15, 2024
423880f
chore: add fsutil protocol description
jedevc Apr 16, 2024
d38951d
Merge pull request #196 from jedevc/fix-unclean-windows-paths
jedevc Apr 18, 2024
0c628a7
recv: translate linkname to wire format
jedevc Apr 18, 2024
497d33b
Merge pull request #197 from jedevc/translate-linkname-to-wire-format
tonistiigi Apr 18, 2024
16fccd4
fix hardlink filter regression
tonistiigi Apr 19, 2024
91a3fc4
Merge pull request #198 from tonistiigi/tonistiigi/fix-hardlink-filter
jedevc Apr 24, 2024
890baae
Merge commit '91a3fc46842c' into chore-merge-v0.14.1
janishorsts Oct 2, 2026
235d76c
ci: make the workflow run again (pinning, Docker Hub auth, FreeBSD ru…
kmannislands Oct 10, 2026
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
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "github-actions"
open-pull-requests-limit: 10
directory: "/"
schedule:
interval: "daily"
labels:
- "dependencies"
- "bot"
160 changes: 125 additions & 35 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,20 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
DESTDIR: ./bin

on:
workflow_dispatch:
schedule:
- cron: '0 8 */6 * *' # every 6 days
push:
branches:
- earthly-main
- gh_test_ci
# No branch filter, so PRs stacked on other PR branches
# (not just PRs into earthly-main) get CI too.
pull_request:
branches:
- earthly-main

jobs:
validate:
Expand All @@ -27,13 +31,22 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
-
name: Login to Docker Hub
# Authenticated pulls avoid Docker Hub's anonymous rate limit (429).
# Secrets are unavailable to fork PRs, so skip the login there.
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
-
name: Run
uses: docker/bake-action@v3
uses: docker/bake-action@4a9a8d494466d37134e2bfca2d3a8de8fb2681ad # v5.13.0
with:
targets: ${{ matrix.target }}

Expand All @@ -47,80 +60,157 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
-
name: Login to Docker Hub
# Authenticated pulls avoid Docker Hub's anonymous rate limit (429).
# Secrets are unavailable to fork PRs, so skip the login there.
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
-
name: Run
uses: docker/bake-action@v3
uses: docker/bake-action@4a9a8d494466d37134e2bfca2d3a8de8fb2681ad # v5.13.0
with:
targets: ${{ matrix.target }}

test:
runs-on: ubuntu-latest
strategy:
matrix:
go_version:
- "1.19"
go:
- "1.21"
- "1.20"
mode:
- "root"
- "noroot"
env:
GO_VERSION: ${{ matrix.go_version }}
GO_VERSION: ${{ matrix.go }}
steps:
-
name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
-
name: Login to Docker Hub
# Authenticated pulls avoid Docker Hub's anonymous rate limit (429).
# Secrets are unavailable to fork PRs, so skip the login there.
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
-
name: Test
uses: docker/bake-action@v3
uses: docker/bake-action@4a9a8d494466d37134e2bfca2d3a8de8fb2681ad # v5.13.0
with:
targets: test
targets: test-${{ matrix.mode }}
-
name: Upload coverage
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
with:
directory: ${{ env.DESTDIR }}/coverage
flags: unit,${{ matrix.mode }},go-${{ matrix.go }}
token: ${{ secrets.CODECOV_TOKEN }}

test-macos:
runs-on: macos-latest
test-os:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- windows-latest
go:
- "1.19"
- "1.21"
- "1.20"
exclude:
# Go 1.21 test binaries abort on current macOS runner images
# ("dyld: missing LC_UUID load command"); Go 1.20 still covers macOS.
- os: macos-latest
go: "1.21"
steps:
-
name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
-
name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
with:
go-version: ${{ matrix.go }}
-
name: Test
shell: bash
run: |
go test ./...
go test -coverprofile="coverage.txt" -covermode="atomic" ./...
go tool cover -func="coverage.txt"
-
name: Upload coverage
if: always()
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
with:
file: ./coverage.txt
env_vars: RUNNER_OS
flags: unit,go-${{ matrix.go }}
token: ${{ secrets.CODECOV_TOKEN }}

test-freebsd-amd64:
runs-on: macos-latest
timeout-minutes: 60
# macos-13 (and Vagrant/VirtualBox on it) is retired; run FreeBSD in a VM
# on Linux the way upstream tonistiigi/fsutil does.
runs-on: ubuntu-latest
env:
VAGRANT_VAGRANTFILE: hack/Vagrantfile.freebsd13
GO_VERSION: "1.21"
steps:
-
name: Prepare
shell: bash
run: |
goVersion=$(curl --fail --silent --show-error "https://go.dev/dl/?mode=json&include=all" | jq -er --arg version "go${GO_VERSION}." '[.[] | select(.stable and (.version | startswith($version)))][0].version')
echo "GO_VERSION=${goVersion#go}" >> "$GITHUB_ENV"
-
name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
-
name: Cache Vagrant boxes
uses: actions/cache@v3
name: Set up FreeBSD
uses: vmactions/freebsd-vm@c46abacb49f09938ca4e1702d15d836285d694cc # v1.5.9
with:
path: ~/.vagrant.d/boxes
key: ${{ runner.os }}-vagrant-${{ hashFiles('hack/Vagrantfile.freebsd13') }}
restore-keys: |
${{ runner.os }}-vagrant-
-
name: Set up vagrant
run: vagrant up
release: "14.5"
envs: GO_VERSION
custom-shell-name: bsd
prepare: |
set -ex
mkdir -p /var/tmp
chmod 1777 /var/tmp
archive="go${GO_VERSION}.freebsd-amd64.tar.gz"
fetch -o "/var/tmp/$archive" "https://go.dev/dl/$archive"
tar -C /var/tmp -xzf "/var/tmp/$archive"
pw useradd -n fsutil -m -s /bin/sh
-
name: Test
run: vagrant ssh -- "cd /vagrant; go test -buildvcs=false ./..."
run: |
bsd /dev/stdin <<'EOF'
set -ex
chown -R fsutil "$GITHUB_WORKSPACE"
su - fsutil -c '
set -ex
cd "$1"
export TMPDIR=/var/tmp
export PATH="/var/tmp/go/bin:$PATH"
go test -buildvcs=false -coverprofile=coverage.txt -covermode=atomic ./...
' sh "$GITHUB_WORKSPACE"
EOF
-
name: Upload coverage
if: always()
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
with:
file: ./coverage.txt
flags: unit,freebsd
token: ${{ secrets.CODECOV_TOKEN }}
6 changes: 1 addition & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# if you want to ignore files created by your editor/tools, consider using a
# global .gitignore or .git/info/exclude see https://help.github.com/articles/ignoring-files
.*
!.github
!.gitignore
!.travis.yml
*.prof
bin/
# support running go modules in vendor mode for local development
vendor/
14 changes: 14 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,17 @@ linters:
- staticcheck
- typecheck
disable-all: true

linters-settings:
depguard:
rules:
main:
deny:
# The io/ioutil package has been deprecated.
# https://go.dev/doc/go1.16#ioutil
- pkg: "io/ioutil"
desc: The io/ioutil package has been deprecated.

# show all
max-issues-per-linter: 0
max-same-issues: 0
18 changes: 13 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#syntax=docker/dockerfile:1
ARG GO_VERSION=1.20
# syntax=docker/dockerfile:1

FROM --platform=$BUILDPLATFORM tonistiigi/xx:1.1.0 AS xx
ARG GO_VERSION=1.21
ARG XX_VERSION=1.4.0

FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx

FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-alpine AS base
RUN apk add --no-cache git
Expand All @@ -18,13 +20,19 @@ FROM base AS test
ARG TESTFLAGS
RUN --mount=target=. --mount=target=/go/pkg/mod,type=cache \
--mount=target=/root/.cache,type=cache \
CGO_ENABLED=0 xx-go test -test.v ${TESTFLAGS} ./...
CGO_ENABLED=0 xx-go test -v -coverprofile=/tmp/coverage.txt -covermode=atomic ${TESTFLAGS} ./...

FROM base AS test-noroot
RUN mkdir /go/pkg && chmod 0777 /go/pkg
USER 1000:1000
RUN --mount=target=. \
--mount=target=/tmp/.cache,type=cache \
CGO_ENABLED=0 GOCACHE=/tmp/gocache xx-go test -test.v ./...
CGO_ENABLED=0 GOCACHE=/tmp/gocache xx-go test -v -coverprofile=/tmp/coverage.txt -covermode=atomic ./...

FROM scratch AS test-coverage
COPY --from=test /tmp/coverage.txt /coverage-root.txt

FROM scratch AS test-noroot-coverage
COPY --from=test-noroot /tmp/coverage.txt /coverage-noroot.txt

FROM build
2 changes: 1 addition & 1 deletion bench/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/tonistiigi/fsutil/bench

go 1.19
go 1.20

require (
github.com/containerd/continuity v0.4.1
Expand Down
12 changes: 12 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
comment: false

coverage:
status:
project: # settings affecting project coverage
default:
target: auto # auto % coverage target
threshold: 1% # allow for 1% reduction of coverage without failing
patch: off

github_checks:
annotations: false
Loading
Loading