-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
89 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Configuration for update-docs - https://github.com/behaviorbot/update-docs | ||
|
||
# Comment to be posted to on PRs that don't update documentation | ||
updateDocsComment: > | ||
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a [changelog](https://github.com/cs3org/reva/blob/master/changelog/README.md) item based on your changes. | ||
updateDocsWhiteList: | ||
- Tests-only | ||
- tests-only | ||
- Tests-Only | ||
|
||
updateDocsTargetFiles: | ||
- changelog/unreleased/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Enhancement: Enforce adding changelog in make and CI | ||
|
||
When adding a feature or fixing a bug, a changelog needs to be specified, | ||
failing which the build wouldn't pass. | ||
|
||
https://github.com/cs3org/reva/pull/965 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// Copyright 2018-2020 CERN | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
// In applying this license, CERN does not waive the privileges and immunities | ||
// granted to it by virtue of its status as an Intergovernmental Organization | ||
// or submit itself to any jurisdiction. | ||
|
||
package main | ||
|
||
import ( | ||
"errors" | ||
"flag" | ||
"log" | ||
"os/exec" | ||
"strings" | ||
) | ||
|
||
func main() { | ||
repo := flag.String("repo", "", "the remote repo against which diff-index is to be derived") | ||
flag.Parse() | ||
|
||
branch := "master" | ||
if *repo != "" { | ||
branch = *repo + "/master" | ||
} | ||
cmd := exec.Command("git", "diff-index", branch, "--", "changelog/unreleased") | ||
out, err := cmd.Output() | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
var changelog bool | ||
mods := strings.Split(string(out), "\n") | ||
|
||
for _, m := range mods { | ||
params := strings.Split(m, " ") | ||
// The fifth param in the output of diff-index is always the status followed by optional score number | ||
if len(params) >= 5 && params[4][0] == 'A' { | ||
changelog = true | ||
} | ||
} | ||
|
||
if !changelog { | ||
log.Fatal(errors.New("No changelog added. Please create a changelog item based on your changes")) | ||
} | ||
} |