Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate github.com/docker/docker/pkg/fileutils and remove docker dependency from main go.mod #105

Closed
wants to merge 47 commits into from

Conversation

thaJeztah
Copy link
Collaborator

depends on moby/moby#42492
relates to moby/buildkit#2150 (comment)

See individual commits for details

git clone https://github.com/thaJeztah/docker.git ~/Projects/temp_docker_fsutils
cd ~/Projects/temp_docker_fsutils
git remote set-url --push origin no_pushing
git fetch origin -v
git checkout remove_fsutil_debug_log

# remove all code, except for the files we need, and rename the files
git filter-repo \
    --force \
    --path-match pkg/fileutils/fileutils.go \
    --path-match pkg/fileutils/fileutils_test.go \
    --path-rename pkg/fileutils/fileutils.go:filematch/patternmatcher.go \
    --path-rename pkg/fileutils/fileutils_test.go:filematch/patternmatcher_test.go


# integrate the files in the docs repository
cd ~/projects/fsutil
git checkout -b migrate_fileutil
git remote add temp_docker_fsutils ~/projects/temp_docker_fsutils
git fetch temp_docker_fsutils

git merge --allow-unrelated-histories --signoff -S temp_docker_fsutils/remove_fsutil_debug_log

rafecolton and others added 30 commits September 29, 2014 23:21
This is the second of two steps to break the archive package's
dependence on utils so that archive may be moved into pkg. `Matches()`
is also a good candidate pkg in that it is small, concise, and not
specific to docker internals

Signed-off-by: Rafe Colton <rafael.colton@gmail.com>
Fixed #8761

Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Signed-off-by: Dave Goodchild <buddhamagnet@gmail.com>
Should fix #11598

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Change CLI error msg because it was too specific and didn't make sense
when there were errors not related to inaccessible files.

Removed some log.Error() calls since they're not really errors we should
log. Returning the error will be enough.

Closes: #13417

Signed-off-by: Doug Davis <dug@us.ibm.com>
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Signed-off-by: John Howard <jhoward@microsoft.com>
Windows: Fix error in daemon log on info
Closes #13113

Signed-off-by: Doug Davis <dug@us.ibm.com>
Signed-off-by: Justas Brazauskas <brazauskasjustas@gmail.com>
Signed-off-by: John Howard <jhoward@microsoft.com>
Signed-off-by: John Howard <jhoward@microsoft.com>
Signed-off-by: allencloud <allen.sun@daocloud.io>
Signed-off-by: allencloud <allen.sun@daocloud.io>
Signed-off-by: Elena Morozova <lelenanam@gmail.com>
.dockerignore pattern of **/.foo incorrectly matched **/bar.foo
because **/.foo was getting converted into a .*\.foo regex
instead of (.*/)*\.foo

Closes #29014

Signed-off-by: Doug Davis <dug@us.ibm.com>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Fixes case sensitivity issue

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
Signed-off-by: Daniel Nephin <dnephin@docker.com>
dnephin and others added 17 commits February 5, 2018 16:51
Signed-off-by: Daniel Nephin <dnephin@docker.com>
gty-migrate-from-testify --ignore-build-tags

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Signed-off-by: chenyuzhu <chenyuzhi@oschina.cn>
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Signed-off-by: mooncake <xcoder@tenxcloud.com>
```
builder/remotecontext/remote.go:48:        G107: Potential HTTP request made with variable url (gosec)
builder/remotecontext/git/gitutils.go:145: G107: Potential HTTP request made with variable url (gosec)
builder/remotecontext/git/gitutils.go:147: G107: Potential HTTP request made with variable url (gosec)
pkg/fileutils/fileutils_test.go:185:       G303: File creation in shared tmp directory without using ioutil.Tempfile (gosec)
pkg/tarsum/tarsum_test.go:7:               G501: Blacklisted import `crypto/md5`: weak cryptographic primitive (gosec)
pkg/tarsum/tarsum_test.go:9:               G505: Blacklisted import `crypto/sha1`: weak cryptographic primitive (gosec)
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Replace gometalinter with golangci-lint
full diff: gotestyourself/gotest.tools@v2.3.0...v3.0.1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
These tests were no longer valid on Go 1.16; related to https://tip.golang.org/doc/go1.16#path/filepath

> The Match and Glob functions now return an error if the unmatched part of
> the pattern has a syntax error. Previously, the functions returned early on
> a failed match, and thus did not report any later syntax error in the pattern.

Causing the test to fail:

    === RUN   TestMatches
        fileutils_test.go:388: assertion failed: error is not nil: syntax error in pattern: pattern="a\\" text="a"
    --- FAIL: TestMatches (0.00s)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Trying to avoid logging code in "libraries" used elsewhere.
If this debug log is important, it should be easy to add in code
that's calling it.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This package only contains testing / benchmarking code,
so dependencies needed for this package should not be in
the main go.mod.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
It was only used for very minimal checks, so removing it
to not have this as a dependency.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@aledbf
Copy link

aledbf commented Mar 18, 2022

@thaJeztah any chance to get this change merged? Thanks!

@estroz
Copy link

estroz commented Apr 14, 2022

The dependency on docker here currently pins docker in any consumer of docker/buildx, so it would be nice to see this PR merged. I can help if needed!

@estroz
Copy link

estroz commented Apr 14, 2022

cc @tonistiigi

@thaJeztah
Copy link
Collaborator Author

I opened #136 to replace this one; that migrates to a separate module

@thaJeztah thaJeztah deleted the migrate_fileutil branch September 30, 2022 23:00
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.