Skip to content

Commit b2c183a

Browse files
committed
Update signed-off-by instructions
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
1 parent ede7834 commit b2c183a

File tree

4 files changed

+41
-11
lines changed

4 files changed

+41
-11
lines changed

derek.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,23 @@ provider:
33
gateway: http://127.0.0.1:8080
44

55
functions:
6-
derek-0913:
6+
derek-0110:
77
handler: ./
8-
image: alexellis/derek:0.9.13
8+
image: ghcr.io/alexellis/derek:0.11.0
99
lang: dockerfile
1010
environment:
1111
debug: true
1212
customers_url: https://raw.githubusercontent.com/alexellis/derek/master/.CUSTOMERS
1313
validate_hmac: true
14-
validate_customers: false
14+
validate_customers: true
1515
secret_path: /var/openfaas/secrets/ # use /run/secrets/ for older OpenFaaS versions
1616
write_debug: true
17-
read_timeout: 10s
18-
write_timeout: 10s
19-
combine_output: false
17+
read_timeout: 15s
18+
write_timeout: 15s
19+
combine_output: true
2020
environment_file:
2121
- secrets.yml
2222
# See secrets.example.yml
2323
secrets:
2424
- derek-secret-key
2525
- derek-private-key
26-

handler/comment_handler_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
package handler
55

66
import (
7+
"log"
78
"os"
89
"strings"
910
"testing"
@@ -12,6 +13,10 @@ import (
1213
"github.com/google/go-github/github"
1314
)
1415

16+
func Test_fixCommitsMessage(t *testing.T) {
17+
log.Println(fixCommits)
18+
}
19+
1520
func Test_getCommandTrigger(t *testing.T) {
1621

1722
triggers := getCommandTriggers()

handler/pullrequest_handler.go

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,39 @@ func VerifyPullRequestDescription(req types.PullRequestOuter, contributingURL st
187187
}
188188
}
189189

190+
const fixCommits = `### :bulb: Shall we fix this?
191+
192+
This will only take a few moments.
193+
194+
First, clone your fork and checkout this branch using the git CLI.
195+
196+
Next, set up your real name and email address:
197+
198+
` + "`" + `git config --global user.name "Your Full Name"` + "`" + `
199+
` + "`" + `git config --global user.email "you@domain.com"` + "`" + `
200+
201+
Finally, run one of these commands to add the "Signed-off-by" line to your commits.
202+
203+
If you only have one commit so far then run: ` + "`" + `git commit --amend --signoff` + "`" + ` and then ` + "`" + `git push --force` + "`." + `
204+
If you have multiple commits, watch [this video](https://www.youtube.com/watch?v=8j0H6urZ-bU).
205+
206+
Check that the message has been added properly by running "git log".
207+
`
208+
190209
func anonymousCommitComment(contributingURL string) string {
191-
return `Thank you for your contribution. It seems that one or more of your commits have an anonymous email address. Please consider signing your commits with a valid email address. Please see our [contributing guide](` + contributingURL + `).`
210+
return `Thank you for your contribution. It seems that one or more of your commits have a "Signed-off-by" statement with an anonymous email address. The [Developer Certificate of Origin (DCO)](https://en.wikipedia.org/wiki/Developer_Certificate_of_Origin) requires all commits to be signed off by genuine, contactable individuals. Please see our [contributing guide](` + contributingURL + `).
211+
212+
` + fixCommits
192213
}
193214

194215
func unsignedCommitComment(contributingURL string) string {
195-
return `Thank you for your contribution. I've just checked and your commit doesn't appear to be signed-off. That's something we need before your Pull Request can be merged. Please see our [contributing guide](` + contributingURL + `).
196-
Tip: if you only have one commit so far then run: ` + "`" + `git commit --amend --signoff` + "`" + ` and then ` + "`" + `git push --force` + "`."
216+
217+
return `Thank you for your contribution. unfortunately, one or more of your commits are missing the required "Signed-off-by:" statement. Signing off is part of the [Developer Certificate of Origin (DCO)](https://en.wikipedia.org/wiki/Developer_Certificate_of_Origin) which is used by this project.
218+
219+
Read the DCO and [project contributing guide](` + contributingURL + `) carefully, and amend your commits using the git CLI. Note that this does not require any cryptography, keys or special steps to be taken.
220+
221+
` + fixCommits
222+
197223
}
198224

199225
func emptyDescriptionComment(contributingURL string) string {
@@ -442,6 +468,7 @@ func updateUnsuccessfulDCOCheck(checks *github.ListCheckRunsResults) github.Upda
442468
now := github.Timestamp{time.Now()}
443469
text := `Thank you for your contribution. I've just checked and your commit doesn't appear to be signed-off.
444470
That's something we need before your Pull Request can be merged.`
471+
445472
title := "Unsigned commits"
446473
summary := "One or more of the commits in this Pull Request are not signed-off."
447474

secrets.example.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
environment:
2-
secret_key: com.openfaas.www
32
application_id: 1234

0 commit comments

Comments
 (0)