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

enable changelog on edge branch #2327

Merged
merged 1 commit into from
Dec 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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"))
}