diff --git a/.github/config.yml b/.github/config.yml deleted file mode 100644 index 7b0a1d51f98..00000000000 --- a/.github/config.yml +++ /dev/null @@ -1,17 +0,0 @@ -# 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 - - Build-deps - - docs-only - - Docs-only - - Docs-Only - -updateDocsTargetFiles: - - changelog/unreleased/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e985ce90431..efbfd16f9bd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -103,10 +103,10 @@ down to the following steps: automatically added to the pull request. 7. If your pull request changes anything that users should be aware of (a - bugfix, a new feature, ...) please add an entry to the file - [CHANGELOG.md](CHANGELOG.md). It will be used in the announcement of the - next stable release. While writing, ask yourself: If I were the user, what - would I need to be aware of with this change. + bugfix, a new feature, ...) make sure it ends up in the changelog by giving + the PR a clear title and the right `Type:*` label. See the + [Changelog](#changelog) section below — there is no need to edit + `CHANGELOG.md` by hand. 8. Once your code looks good and passes all the tests, we'll merge it. Thanks a lot for your contribution! @@ -122,6 +122,35 @@ We won't merge any code that doesn't pass the tests. If you need help to make th pass don't hesitate to call for help! Having a PR with failing tests is nothing to be ashamed of, in the other hand, that happens regularly for all of us. +Changelog +========= + +The changelog (`CHANGELOG.md`) is generated automatically during the release +process by [ready-release-go](https://github.com/woodpecker-plugins/ready-release-go) +(see `.woodpecker/release.yaml` and `release-config.ts`). + +To get your change into the changelog: + + 1. Give your pull request a clear, descriptive title — it becomes the changelog + line verbatim. + 2. Add the appropriate `Type:*` label so the change lands in the right section. + +The mapping between labels and changelog sections lives in `release-config.ts`. +The relevant `Type:*` labels are: + +| Label | Section | Version bump | +| ---------------------- | --------------------- | ------------ | +| `Type:Breaking-Change` | 💥 Breaking changes | major | +| `Type:Security` | 🔒 Security | patch | +| `Type:Feature` | ✨ Features | minor | +| `Type:Enhancement` | 📈 Enhancement | minor | +| `Type:Bug` | 🐛 Bug Fixes | patch | +| `Type:Documentation` | 📚 Documentation | patch | +| `Type:Dependencies` | 📦️ Dependencies | patch | + +The next version number is derived from the highest bump among the PRs included +in the release. + Git Commits ----------- diff --git a/Makefile b/Makefile index 6f883c102b4..507c1525446 100644 --- a/Makefile +++ b/Makefile @@ -16,10 +16,9 @@ TESTS="basic http copymove props" TOOLCHAIN ?= $(CURDIR)/toolchain GOLANGCI_LINT ?= $(TOOLCHAIN)/golangci-lint -CALENS ?= $(TOOLCHAIN)/calens .PHONY: toolchain -toolchain: $(GOLANGCI_LINT) $(CALENS) +toolchain: $(GOLANGCI_LINT) .PHONY: toolchain-clean toolchain-clean: @@ -29,7 +28,7 @@ $(GOLANGCI_LINT): @mkdir -p $(@D) curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | BINDIR=$(@D) sh -s v2.10.1 -.PHONY: check-changelog +.PHONY: lint lint: $(GOLANGCI_LINT) $(GOLANGCI_LINT) run --timeout 450s @@ -38,22 +37,6 @@ lint-fix: $(GOLANGCI_LINT) gofmt -w . $(GOLANGCI_LINT) run --fix -CALENS_DIR := $(shell mktemp -d) -$(CALENS): - @mkdir -p $(@D) - git clone --depth 1 --branch v0.2.0 -c advice.detachedHead=false https://github.com/restic/calens.git $(CALENS_DIR) - cd $(CALENS_DIR) && GOBIN=$(@D) go install - rm -rf $(CALENS_DIR) - -.PHONY: check-changelog -check-changelog: $(CALENS) -ifndef PR - $(error PR is not defined) -else - $(CALENS) | sed -n '/^Changelog for reva unreleased (UNRELEASED)/,/^Details/p' | \ - grep -E '^\* [[:alpha:]]{3} #$(PR): ' -endif - .PHONY: off off: GOPROXY=off diff --git a/changelog/CHANGELOG.tmpl b/changelog/CHANGELOG.tmpl deleted file mode 100644 index 9614d992784..00000000000 --- a/changelog/CHANGELOG.tmpl +++ /dev/null @@ -1,32 +0,0 @@ -{{- range $changes := . }}{{ with $changes -}} -Changelog for reva {{ .Version }} ({{ .Date }}) -======================================= - -The following sections list the changes in reva {{ .Version }} relevant to -reva users. The changes are ordered by importance. - -Summary -------- -{{ range $entry := .Entries }}{{ with $entry }} -* {{ .TypeShort }} #{{ .PrimaryID }}: {{ .Title }} -{{- end }}{{ end }} - -Details -------- -{{ range $entry := .Entries }}{{ with $entry }} -* {{ .Type }} #{{ .PrimaryID }}: {{ .Title }} -{{ range $par := .Paragraphs }} - {{ wrapIndent $par 80 3 }} -{{ end -}} -{{ range $url := .IssueURLs }} - {{ $url -}} -{{ end -}} -{{ range $url := .PRURLs }} - {{ $url -}} -{{ end -}} -{{ range $url := .OtherURLs }} - {{ $url -}} -{{ end }} -{{ end }}{{ end }} -{{ end }}{{ end -}} - diff --git a/changelog/NOTE.md b/changelog/NOTE.md deleted file mode 100644 index d44cb5524fb..00000000000 --- a/changelog/NOTE.md +++ /dev/null @@ -1,20 +0,0 @@ -Changelog for reva 2.27.2 (2025-01-17) -======================================= - -The following sections list the changes in reva 2.27.2 relevant to -reva users. The changes are ordered by importance. - -Summary -------- - -* Fix #5043: Fix SpaceMembershipExpired unmarshal - -Details -------- - -* Bugfix #5043: Fix SpaceMembershipExpired unmarshal - - SpaceMembershipExpired events can now be unmarshalled correctly - - https://github.com/cs3org/reva/pull/5043 - diff --git a/changelog/README.md b/changelog/README.md index 295b8ad3386..44904d52329 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -1,12 +1,10 @@ # Changelog -We are using [calens](https://github.com/restic/calens) to properly generate a -changelog before we are tagging a new release. +This directory only contains the **historic, per-release changelog archives** +(the `_/` folders) from when Reva generated its changelog with +[calens](https://github.com/restic/calens). It is kept for reference only. -## Create Changelog items -Create a file according to the [template](TEMPLATE) for each -changelog in the [unreleased](./unreleased) folder. The following change types are possible: `Bugfix, Change, Enhancement, Security`. - -## Generate the Changelog -- execute `go run tools/prepare-release/main.go -version 10.0.0 -commit -tag` -in the root folder of the project. \ No newline at end of file +Reva no longer uses calens or `changelog/unreleased/` fragments. The changelog +(`CHANGELOG.md`) is now generated automatically at release time from merged pull +request titles and their `Type:*` labels. See the +[Changelog section in CONTRIBUTING.md](../CONTRIBUTING.md#changelog) for details. diff --git a/changelog/TEMPLATE b/changelog/TEMPLATE deleted file mode 100644 index 12c0b439b77..00000000000 --- a/changelog/TEMPLATE +++ /dev/null @@ -1,14 +0,0 @@ -Bugfix: Fix behavior for foobar (in present tense) - -We've fixed the behavior for foobar, a long-standing annoyance for Reva -users. - -The text in the paragraphs is written in past tense. The last section is a list -of issue URLs, PR URLs and other URLs. The first issue ID (or the first PR ID, -in case there aren't any issue links) is used as the primary ID. - -https://github.com/cs3org/reva/issues/292 -https://github.com/cs3org/reva/pull/323 - -Note: you can use Bugfix or Enhancement as the first keyword to denote -either a bufix or an improvement. diff --git a/changelog/changelog-github.tmpl b/changelog/changelog-github.tmpl deleted file mode 100644 index a326ceb811b..00000000000 --- a/changelog/changelog-github.tmpl +++ /dev/null @@ -1,31 +0,0 @@ -{{- range $changes := . }}{{ with $changes -}} -Changelog for Reva {{ .Version }} ({{ .Date }}) -======================================= - -The following sections list the changes in Reva {{ .Version }} relevant to Reva users. The changes are ordered by importance. - -Summary -------- -{{ range $entry := .Entries }}{{ with $entry }} - * {{ .TypeShort }} [#{{ .PrimaryID }}]({{ .PrimaryURL }}): {{ .Title }} -{{- end }}{{ end }} - -Details -------- -{{ range $entry := .Entries }}{{ with $entry }} - * {{ .Type }} #{{ .PrimaryID }}: {{ .Title }} -{{ range $par := .Paragraphs }} - {{ $par }} -{{ end }} - {{ range $id := .Issues -}} -{{ ` ` }}[#{{ $id }}](https://github.com/cs3org/reva/issues/{{ $id -}}) -{{- end -}} -{{ range $id := .PRs -}} -{{ ` ` }}[#{{ $id }}](https://github.com/cs3org/reva/pull/{{ $id -}}) -{{- end -}} -{{ ` ` }}{{ range $url := .OtherURLs -}} -{{ $url -}} -{{- end }} -{{ end }}{{ end }} - -{{ end }}{{ end -}} diff --git a/changelog/unreleased/add-ocm-wayf.md b/changelog/unreleased/add-ocm-wayf.md deleted file mode 100644 index 37d176d39be..00000000000 --- a/changelog/unreleased/add-ocm-wayf.md +++ /dev/null @@ -1,7 +0,0 @@ -Enhancement: Add OCM Where Are You From capability - -Implements WAYF specific discovery endpoints for the ScienceMesh package, -enabling dynamic OCM provider discovery and federation management. -The implementation follows the OCM Discovery 1.2 specification. - -https://github.com/opencloud-eu/reva/pull/393 diff --git a/changelog/unreleased/fix-inotifywait-logging.md b/changelog/unreleased/fix-inotifywait-logging.md deleted file mode 100644 index d342ac716cd..00000000000 --- a/changelog/unreleased/fix-inotifywait-logging.md +++ /dev/null @@ -1,5 +0,0 @@ -Bugfix: Module inotifywait does not longer log to stdout - -Pass a proper logger to the inotifywait module to log into - -https://github.com/opencloud-eu/reva/pull/416 diff --git a/changelog/unreleased/fix-ocm-webdav.md b/changelog/unreleased/fix-ocm-webdav.md deleted file mode 100644 index ddaad678929..00000000000 --- a/changelog/unreleased/fix-ocm-webdav.md +++ /dev/null @@ -1,5 +0,0 @@ -Bugfix: Fix the OCM WebDAV protocol entity mismatch - -Fixed the OCM WebDAV protocol entity mismatch - -https://github.com/opencloud-eu/reva/pull/382 diff --git a/tools/prepare-release/main.go b/tools/prepare-release/main.go deleted file mode 100644 index 24cb2b50901..00000000000 --- a/tools/prepare-release/main.go +++ /dev/null @@ -1,203 +0,0 @@ -// Copyright 2018-2022 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 ( - "bytes" - "flag" - "fmt" - "io" - "os" - "os/exec" - "path" - "strings" - "time" -) - -var ( - version = flag.String("version", "", "version to release: 0.0.1") - commit = flag.Bool("commit", false, "creates a commit") - tag = flag.Bool("tag", false, "creates a tag") -) - -func init() { - flag.Parse() - - if *version == "" { - fmt.Fprintf(os.Stderr, "missing version: use -version flag\n") - os.Exit(1) - } -} - -func main() { - // check if repo is dirty - if isRepoDirty() { - fmt.Fprintf(os.Stderr, "the repo is dirty, to generate a new release all changes need to be committed\n") - os.Exit(1) - return - } - - // also the build is okay - cmd := exec.Command("make", "gen-doc") - run(cmd) - - fmt.Printf("Generating new release: version=%s\n", *version) - - dt := time.Now() - date := dt.Format("2006-01-02") - newChangelog := fmt.Sprintf("changelog/%s_%s", *version, date) - - if info, _ := os.Stat("changelog/unreleased"); info == nil { - fmt.Fprintf(os.Stderr, "no changelog/unreleased folder, to create a new version you need to fill it") - os.Exit(1) - } - - cmd = exec.Command("mv", "changelog/unreleased", newChangelog) - run(cmd) - - // install release-deps: calens - cmd = exec.Command("make", "toolchain") - run(cmd) - - // create new changelog - cmd = exec.Command("toolchain/calens", "-o", "CHANGELOG.md") - run(cmd) - - // add new VERSION and BUILD_DATE - if err := os.WriteFile("VERSION", []byte(*version), 0644); err != nil { - fmt.Fprintf(os.Stderr, "error writing to VERSION file: %s", err) - os.Exit(1) - } - - // add new VERSION and RELEASE_DATE - if err := os.WriteFile("RELEASE_DATE", []byte(date), 0644); err != nil { - fmt.Fprintf(os.Stderr, "error writing to RELEASE_DATE file: %s", err) - os.Exit(1) - } - - tmp, err := os.MkdirTemp("", "reva-changelog") - if err != nil { - fmt.Fprintf(os.Stderr, "error creating tmp directory to store changelog: %s", err) - os.Exit(1) - } - - if err := os.MkdirAll(path.Join(tmp, "changelog"), 0755); err != nil { - fmt.Fprintf(os.Stderr, "error creating changelog in temporary directory: %s", tmp) - os.RemoveAll(tmp) - os.Exit(1) - } - - dir := path.Join(tmp, fmt.Sprintf("changelog/%s_%s", *version, date)) - cmd = exec.Command("cp", "-a", fmt.Sprintf("changelog/%s_%s", *version, date), dir) - run(cmd) - - // create new changelog - cmd = exec.Command("toolchain/calens", "-o", "changelog/NOTE.md", "-i", path.Join(tmp, "changelog")) - run(cmd) - - add(fmt.Sprintf("v%s", *version), - "changelog", - "CHANGELOG.md", - "VERSION", - "RELEASE_DATE", - ) - - if *commit { - createCommit(fmt.Sprintf("v%s", *version)) - fmt.Println("Commit created, check with git log") - } - - if *tag { - createTag(*version) - fmt.Println("Tag created, check with git tag") - } - - if *tag && *commit { - fmt.Println("RELEASE READY: you only need to\n$ git push --follow-tags") - os.Exit(0) - } else { - fmt.Println("Was a dry run, run with -commit and -tag to create release") - os.Exit(1) - } -} - -func isRepoDirty() bool { - repo := "." - cmd := exec.Command("git", "status", "-s") - cmd.Dir = repo - changes := runAndGet(cmd) - if changes != "" { - fmt.Println("repo is dirty") - fmt.Println(changes) - } - return changes != "" -} - -func add(msg string, files ...string) { - for _, f := range files { - cmd := exec.Command("git", "add", "--all", f) - cmd.Dir = "." - run(cmd) - } -} - -func createCommit(msg string) { - cmd := exec.Command("git", "commit", "-m", msg) - cmd.Dir = "." // always run from the root of the repo - run(cmd) -} - -func createTag(version string) { - // check if repo is dirty - if isRepoDirty() { - fmt.Fprintf(os.Stderr, "repo is dirty when creating a new tag for version %s", version) - os.Exit(1) - } - - cmd := exec.Command("git", "tag", "-a", "v"+version, "-m", "v"+version) - run(cmd) -} - -func run(cmd *exec.Cmd) { - var b bytes.Buffer - mw := io.MultiWriter(os.Stdout, &b) - cmd.Stdout = mw - cmd.Stderr = mw - err := cmd.Run() - fmt.Println(cmd.Dir, cmd.Args) - fmt.Println(b.String()) - if err != nil { - fmt.Println("ERROR: ", err.Error()) - os.Exit(1) - } -} - -func runAndGet(cmd *exec.Cmd) string { - var b bytes.Buffer - mw := io.MultiWriter(os.Stdout, &b) - cmd.Stderr = mw - out, err := cmd.Output() - fmt.Println(cmd.Dir, cmd.Args) - fmt.Println(b.String()) - if err != nil { - fmt.Println("ERROR: ", err.Error()) - os.Exit(1) - } - return strings.TrimSpace(string(out)) -}