Skip to content

Commit

Permalink
enable changelog on edge branch (#2327)
Browse files Browse the repository at this point in the history
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
  • Loading branch information
butonic authored Dec 6, 2021
1 parent f784cb2 commit 255730c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ gen-doc:

check-changelog: release-deps
`go env GOPATH`/bin/calens > /dev/null
go run tools/check-changelog/main.go
go run tools/check-changelog/main.go -branch edge

check-changelog-drone:
go run tools/check-changelog/main.go -repo origin -pr "$(PR)"
go run tools/check-changelog/main.go -repo origin -branch edge -pr "$(PR)"

# to be run in CI platform
ci: build-ci test lint-ci
Expand Down
5 changes: 5 additions & 0 deletions changelog/unreleased/enable-edge-changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: enable changelog on edge branch

We added a `branch` flag to the `tools/check-changelog/main.go` to fix changelog checks on the edge branch.

https://github.com/cs3org/reva/pull/2327
11 changes: 6 additions & 5 deletions tools/check-changelog/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,20 @@ func skipPR(prID int) bool {

func main() {
repo := flag.String("repo", "", "the remote repo against which diff-index is to be derived")
branch := flag.String("branch", "master", "the branch against which diff-index is to be derived")
prID := flag.Int("pr", 0, "the ID of the PR")
flag.Parse()

if *prID > 0 && skipPR(*prID) {
return
}

branch := "master"
if *repo != "" {
branch = *repo + "/master"
s := *repo + "/" + *branch
branch = &s
}

cmd := exec.Command("git", "diff-index", branch, "--", ".")
cmd := exec.Command("git", "diff-index", *branch, "--", ".")
out, err := cmd.Output()
if err != nil {
log.Fatal(err)
Expand All @@ -81,7 +82,7 @@ func main() {
return
}

cmd = exec.Command("git", "diff-index", branch, "--", "changelog/unreleased")
cmd = exec.Command("git", "diff-index", *branch, "--", "changelog/unreleased")
out, err = cmd.Output()
if err != nil {
log.Fatal(err)
Expand All @@ -96,5 +97,5 @@ func main() {
}
}

log.Fatal(errors.New("No changelog added. Please create a changelog item based on your changes"))
log.Fatal(errors.New("no changelog added. Please create a changelog item based on your changes"))
}

0 comments on commit 255730c

Please sign in to comment.