Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Docker Machine
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SmartDataLab
public
applications
Docker Machine
Commits
fb8ed650
Unverified
Commit
fb8ed650
authored
May 20, 2022
by
Tomasz Maczukin
Browse files
Options
Downloads
Patches
Plain Diff
Remove DCO validation
parent
8246c2c5
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
CONTRIBUTING.md
+2
-3
2 additions, 3 deletions
CONTRIBUTING.md
mk/main.mk
+3
-3
3 additions, 3 deletions
mk/main.mk
mk/validate.mk
+0
-10
0 additions, 10 deletions
mk/validate.mk
script/validate-dco
+0
-56
0 additions, 56 deletions
script/validate-dco
with
5 additions
and
72 deletions
CONTRIBUTING.md
+
2
−
3
View file @
fb8ed650
...
@@ -75,11 +75,11 @@ to clean-up build results.
...
@@ -75,11 +75,11 @@ to clean-up build results.
We use the usual
`go`
tools for this, to run those commands you need at least the linter which you can
We use the usual
`go`
tools for this, to run those commands you need at least the linter which you can
install with
`go get -u golang.org/x/lint/golint`
install with
`go get -u golang.org/x/lint/golint`
To run basic validation (
dco, fm
t), and the project unit tests, call:
To run basic validation (
fmt, test-short, lint, ve
t), and the project unit tests, call:
$ make test
$ make test
If you want
more indepth validation (vet, lint), and
all tests with race detection, call:
If you want all tests with race detection, call:
$ make validate
$ make validate
...
@@ -150,7 +150,6 @@ Scrub build results:
...
@@ -150,7 +150,6 @@ Scrub build results:
make fmt
make fmt
make vet
make vet
make lint
make lint
make dco
### Managing dependencies
### Managing dependencies
...
...
This diff is collapsed.
Click to expand it.
mk/main.mk
+
3
−
3
View file @
fb8ed650
...
@@ -41,7 +41,7 @@ include mk/validate.mk
...
@@ -41,7 +41,7 @@ include mk/validate.mk
.all_coverage
:
coverage-generate coverage-html coverage-send coverage-serve coverage-clean
.all_coverage
:
coverage-generate coverage-html coverage-send coverage-serve coverage-clean
.all_release
:
release-checksum release
.all_release
:
release-checksum release
.all_test
:
test-short test-long test-integration
.all_test
:
test-short test-long test-integration
.all_validate
:
dco
fmt vet lint
.all_validate
:
fmt vet lint
default
:
build
default
:
build
...
@@ -49,7 +49,7 @@ install:
...
@@ -49,7 +49,7 @@ install:
cp
$(
PREFIX
)
/bin/
$(
PKG_NAME
)
/usr/local/bin
cp
$(
PREFIX
)
/bin/
$(
PKG_NAME
)
/usr/local/bin
clean
:
coverage-clean build-clean
clean
:
coverage-clean build-clean
test
:
dco
fmt test-short lint vet
test
:
fmt test-short lint vet
validate
:
dco
fmt lint vet test-long
validate
:
fmt lint vet test-long
.PHONY
:
.all_build .all_coverage .all_release .all_test .all_validate test build validate clean
.PHONY
:
.all_build .all_coverage .all_release .all_test .all_validate test build validate clean
This diff is collapsed.
Click to expand it.
mk/validate.mk
+
0
−
10
View file @
fb8ed650
# Validate DCO on all history
mkfile_path
:=
$(
abspath
$(
lastword
$(
MAKEFILE_LIST
)))
current_dir
:=
$(
notdir
$(
patsubst %/,%,
$(
dir
$(
mkfile_path
))))
# XXX vendorized script miss exec bit, hence the gymnastic
# plus the path resolution...
# TODO migrate away from the shell script and have a make equivalent instead
dco
:
@
echo
`
bash
$(
current_dir
)
/../script/validate-dco
`
fmt
:
fmt
:
@
test
-z
"
$$(
gofmt -s -l . 2>&1 | grep -v vendor/ | tee /dev/stderr
)
"
@
test
-z
"
$$(
gofmt -s -l . 2>&1 | grep -v vendor/ | tee /dev/stderr
)
"
...
...
This diff is collapsed.
Click to expand it.
script/validate-dco
deleted
100755 → 0
+
0
−
56
View file @
8246c2c5
#!/bin/bash
source
"
$(
dirname
"
$BASH_SOURCE
"
)
/.validate"
adds
=
$(
validate_diff
--numstat
|
awk
'{ s += $1 } END { print s }'
)
dels
=
$(
validate_diff
--numstat
|
awk
'{ s += $2 } END { print s }'
)
notDocs
=
"
$(
validate_diff
--numstat
|
awk
'$3 !~ /^docs\// { print $3 }'
)
"
:
${
adds
:
=0
}
:
${
dels
:
=0
}
# "Username may only contain alphanumeric characters or dashes and cannot begin with a dash"
githubUsernameRegex
=
'[a-zA-Z0-9][a-zA-Z0-9-]+'
# https://github.com/docker/docker/blob/master/CONTRIBUTING.md#sign-your-work
dcoPrefix
=
'Signed-off-by:'
dcoRegex
=
"^(Docker-DCO-1.1-)?
$dcoPrefix
([^<]+) <([^<>@]+@[^<>]+)>(
\\
(github: (
$githubUsernameRegex
)
\\
))?$"
check_dco
()
{
grep
-qE
"
$dcoRegex
"
}
if
[
$adds
-eq
0
-a
$dels
-eq
0
]
;
then
echo
'0 adds, 0 deletions; nothing to validate! :)'
elif
[
-z
"
$notDocs
"
-a
$adds
-le
1
-a
$dels
-le
1
]
;
then
echo
'Congratulations! DCO small-patch-exception material!'
else
commits
=(
$(
validate_log
--format
=
'format:%H%n'
)
)
badCommits
=()
for
commit
in
"
${
commits
[@]
}
"
;
do
if
[
-z
"
$(
git log
-1
--format
=
'format:'
--name-status
"
$commit
"
)
"
]
;
then
# no content (ie, Merge commit, etc)
continue
fi
if
!
git log
-1
--format
=
'format:%B'
"
$commit
"
| check_dco
;
then
badCommits+
=(
"
$commit
"
)
fi
done
if
[
${#
badCommits
[@]
}
-eq
0
]
;
then
echo
"Congratulations! All commits are properly signed with the DCO!"
else
{
echo
"These commits do not have a proper '
$dcoPrefix
' marker:"
for
commit
in
"
${
badCommits
[@]
}
"
;
do
echo
" -
$commit
"
done
echo
echo
'Please amend each commit to include a properly formatted DCO marker.'
echo
echo
'Visit the following URL for information about the Docker DCO:'
echo
' https://github.com/docker/docker/blob/master/CONTRIBUTING.md#sign-your-work'
echo
}
>
&2
false
fi
fi
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment