Skip to content

Commit a4e752f

Browse files
chore(docs): document release process (#9543)
**Description** This PR adds a release process guide
1 parent f48a893 commit a4e752f

5 files changed

Lines changed: 120 additions & 17 deletions

File tree

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# CODEOWNERS info: https://help.github.com/en/articles/about-code-owners
22
# Owners are automatically requested for review for PRs that changes code
33
# that they own.
4-
* @dgraph-io/database
4+
* @dgraph-io/maintainers

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,25 @@ Please explain the changes you made here.
44

55
**Checklist**
66

7-
- [ ] Code compiles correctly and linting passes locally
8-
- [ ] For all _code_ changes, an entry added to the `CHANGELOG.md` file describing and linking to
9-
this PR
7+
- [ ] The PR title follows the
8+
[Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) syntax, leading
9+
with `fix:`, `feat:`, `chore:`, `ci:`, etc.
10+
- [ ] Code compiles correctly and linting (via trunk) passes locally
1011
- [ ] Tests added for new functionality, or regression tests for bug fixes added as applicable
11-
- [ ] For public APIs, new features, etc., PR on [docs repo](https://github.com/dgraph-io/docs)
12-
staged and linked here
12+
- [ ] For public APIs, new features, etc., a PR on the
13+
[docs repo](https://github.com/dgraph-io/dgraph-docs) staged and linked here. This process can
14+
be simplified by going to the [public docs site](https://docs.dgraph.io/) and clicking the
15+
"Edit this page" button at the bottom of page(s) relevant to your changes. Ensure that you
16+
indicate in the PR that this is an **unreleased** feature so that it does not get merged into
17+
the main docs prematurely.
1318

1419
**Instructions**
1520

16-
- The PR title should follow the [Conventional Commits](https://www.conventionalcommits.org/)
17-
syntax, leading with `fix:`, `feat:`, `chore:`, `ci:`, etc.
21+
- The PR title should follow the
22+
[Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) syntax, leading
23+
with `fix:`, `feat:`, `chore:`, `ci:`, etc. Ensure any breaking changes are appropriately marked
24+
with a `!`. For instance, `feat(dql)!: Remove the foobar func` would indicate that this is a
25+
breaking change to the DQL syntax.
1826
- The description should briefly explain what the PR is about. In the case of a bugfix, describe or
1927
link to the bug.
2028
- In the checklist section, check the boxes in that are applicable, using `[x]` syntax.

.github/workflows/cd-dgraph.yml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ on:
1717
description: if checked, images will be pushed to dgraph-custom repo in Dockerhub
1818

1919
permissions:
20-
contents: read
20+
contents: write
2121

2222
jobs:
2323
dgraph-build-amd64:
@@ -260,6 +260,20 @@ jobs:
260260
with:
261261
name: dgraph-docker-arm64
262262

263+
# Download Dgraph Linux AMD64 Binary Artifacts
264+
- name: Download Dgraph Linux AMD64 Binary Artifacts
265+
uses: actions/download-artifact@v5
266+
with:
267+
name: dgraph-amd-release-artifacts
268+
path: dgraph-amd-release-artifacts
269+
270+
# Download Dgraph Linux ARM64 Binary Artifacts
271+
- name: Download Dgraph Linux ARM64 Binary Artifacts
272+
uses: actions/download-artifact@v5
273+
with:
274+
name: dgraph-arm-release-artifacts
275+
path: dgraph-arm-release-artifacts
276+
263277
# Load Dgraph AMD64 Image
264278
- name: Load AMD64 Docker Image
265279
run: |
@@ -325,3 +339,18 @@ jobs:
325339
docker manifest push dgraph/dgraph:latest
326340
fi
327341
fi
342+
343+
- name: Upload Assets to Release
344+
if: github.event.inputs.custom-build == 'false'
345+
uses: softprops/action-gh-release@v2
346+
with:
347+
tag_name: ${{ github.event.inputs.releasetag }}
348+
files: |
349+
dgraph-amd-release-artifacts/dgraph/dgraph-linux-amd64.tar.gz
350+
dgraph-amd-release-artifacts/dgraph/dgraph-checksum-linux-amd64.sha256
351+
dgraph-amd-release-artifacts/badger/badger-linux-amd64.tar.gz
352+
dgraph-amd-release-artifacts/badger/badger-checksum-linux-amd64.sha256
353+
dgraph-arm-release-artifacts/dgraph/dgraph-linux-arm64.tar.gz
354+
dgraph-arm-release-artifacts/dgraph/dgraph-checksum-linux-arm64.sha256
355+
dgraph-arm-release-artifacts/badger/badger-linux-arm64.tar.gz
356+
dgraph-arm-release-artifacts/badger/badger-checksum-linux-arm64.sha256

CONTRIBUTING.md

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
- [Setting Up the Development Environment](#setting-up-the-development-environment)
55
- [Prerequisites](#prerequisites)
66
- [Setup Dgraph from source repo](#setup-dgraph-from-source-repo)
7-
- [Setup Badger from source repo](#setup-badger-from-source-repo)
7+
- [Setup Badger from source repo](#setup-badger-from-source-repo-optional)
88
- [Protocol buffers](#protocol-buffers)
99
- [Build Dgraph](#build-dgraph)
1010
- [Build Docker Image](#build-docker-image)
@@ -30,7 +30,10 @@
3030
available through your OS package manager)
3131
- Install [Docker](https://docs.docker.com/install/) and
3232
[Docker Compose](https://docs.docker.com/compose/install/).
33-
- [Install Go 1.22.12 or above](https://golang.org/doc/install).
33+
- [Install Go 1.24.3 or above](https://golang.org/doc/install).
34+
- Install
35+
[trunk](https://docs.trunk.io/code-quality/overview/getting-started/install#install-the-launcher).
36+
Our CI uses trunk to lint and check code, having it installed locally will save you time.
3437

3538
### Setup Dgraph from source repo
3639

@@ -43,7 +46,7 @@ make install
4346
This will put the source code in a Git repo under `$GOPATH/src/github.com/dgraph-io/dgraph` and
4447
compile the binaries to `$GOPATH/bin`.
4548

46-
### Setup Badger from source repo
49+
### Setup Badger from source repo (optional)
4750

4851
Dgraph source repo vendors its own version of Badger. If you are just working on Dgraph, you do not
4952
necessarily need to check out Badger from its own repo. However, if you want to contribute to Badger
@@ -58,7 +61,7 @@ This will put the source code in a Git repo under `$GOPATH/src/github.com/dgraph
5861
### Protocol buffers
5962

6063
We use [protocol buffers](https://developers.google.com/protocol-buffers/) to serialize data between
61-
our server and the Go client and also for inter-worker communication. If you make any changes to the
64+
our server and our clients and also for inter-worker communication. If you make any changes to the
6265
`.proto` files, you would have to recompile them.
6366

6467
Install the `protoc` compiler which is required for compiling proto files used for gRPC
@@ -117,6 +120,11 @@ Licensed variously under the Apache Public License 2.0 and Dgraph Community Lice
117120
© Istari Digital, Inc.
118121
```
119122

123+
#### Building Dgraph on non-Linux machines
124+
125+
See the [README](t/README.md) in the [_t_](t) folder for instructions on building Dgraph on
126+
non-Linux machines.
127+
120128
### Build Docker Image
121129

122130
```sh
@@ -140,8 +148,8 @@ For dependencies, runner flags and instructions for running tests on non-Linux m
140148
[README](t/README.md) in the [_t_](t) folder.
141149

142150
Other integration tests do not use the testing framework located in the `t` folder. Consult the
143-
[github actions definitions](.github) folder to discover the tests we run as part of our continuous
144-
delivery process.
151+
[github workflow definitions](.github/workflows) folder to discover the tests we run as part of our
152+
continuous integration process.
145153

146154
Non-integration unit tests exist for many core packages that can be exercised without invoking the
147155
testing framework. For instance, to unit test the core DQL parsing package:
@@ -157,7 +165,9 @@ coding, or could be achieved by rewriting an entire module, that you may have pa
157165
yesterday.
158166

159167
- **Pull requests are welcome**, as long as you're willing to put in the effort to meet the
160-
guidelines. After you fork dgraph, create your pull request against our `main` branch
168+
guidelines. After you fork Dgraph, create your pull request against our `main` branch. Please
169+
follow the instructions in the PR template carefully.
170+
- Be prepared to document your additions/changes in our public documentation (if applicable)
161171
- Aim for clear, well written, maintainable code
162172
- Simple and minimal approach to features, like Go
163173
- New features must include passing unit tests, and integration tests when appropriate
@@ -172,7 +182,8 @@ yesterday.
172182
### Code style
173183

174184
- We're following [Go Code Review](https://github.com/golang/go/wiki/CodeReviewComments)
175-
- Use `go fmt` to format your code before committing
185+
- At a minimum, use `go fmt` to format your code before committing. Ideally you should use `trunk`
186+
as our CI will run `trunk` on your code
176187
- If you see _any code_ which clearly violates the style guide, please fix it and send a pull
177188
request. No need to ask for permission
178189
- Avoid unnecessary vertical spaces. Use your judgment or follow the code review comments

contrib/RELEASE.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Dgraph Release Process
2+
3+
This document outlines the steps needed to build and push a new release of Dgraph.
4+
5+
1. Have a team member "at-the-ready" with github `writer` access (you'll need them to approve PRs).
6+
1. Create a new branch (prepare-for-release-vXX.X.X, for instance).
7+
1. Update dependencies in `go.mod` for Badger, Ristretto and Dgo, if required.
8+
1. If you didn't update `go.mod`, decide if you need to run the weekly upgrade CI workflow,
9+
[ci-dgraph-weekly-upgrade-tests](https://github.com/dgraph-io/dgraph/actions/workflows/ci-dgraph-weekly-upgrade-tests.yml),
10+
it takes about 60-70 minutes… Note that you only need to do this if there are changes on the main
11+
branch after the last run (it runs weekly on Sunday nights).
12+
1. Update the CHANGELOG.md. Sonnet 4.5 does a great job of doing this. Example prompt:
13+
`I'm releasing vXX.X.X off the main branch, add a new entry for this release. Conform to the "Keep a Changelog" format, use past entries as a formatting guide. Run the trunk linter on your changes.`.
14+
1. Validate the version does not have storage incompatibilities with the previous version. If so, add a warning to the CHANGELOG.md
15+
that export/import of data will need to be run as part of the upgrade process.
16+
1. Commit and push your changes. Create a PR and have a team member approve it. If you've only
17+
modified markdown content, the code-based CI steps will be skipped.
18+
1. Using the updated CHANGELOG.md as a guide, ensure that user-facing additions or changes have appropriate PRs in
19+
the Dgraph [docs repo](https://github.com/dgraph-io/dgraph-docs/).
20+
1. Once your "prepare for release branch" is merged into main, on the github
21+
[releases](https://github.com/dgraph-io/dgraph/releases) page, create a new draft release (this step
22+
will create the tag, in this example we're releasing _v25.1.0-preview1_):
23+
<img width="1491" height="745" alt="image" src="https://github.com/user-attachments/assets/18a2af83-9345-48fc-95cf-368ea4f0a70e" />
24+
Note: check the toggle to create a Annoucement in our Discussions forum (time saver).
25+
1. Start the deployment workflow from
26+
[here](https://github.com/dgraph-io/dgraph/actions/workflows/cd-dgraph.yml):
27+
<img width="1491" height="745" alt="image" src="https://github.com/user-attachments/assets/9f3801d1-56dd-4bfe-acdb-9f1518b0bf13" />
28+
Note: only select the "if checked, images will be pushed to dgraph-custom" if this release is an
29+
unreleased patch.
30+
31+
The CD workflow handles the building, tagging and copying of release artifacts to dockerhub and
32+
the releases area.
33+
34+
1. Verify the push
35+
1. Ensure the image tags are pushed to
36+
[https://hub.docker.com/r/dgraph/dgraph/tags](https://hub.docker.com/r/dgraph/dgraph/tags)
37+
1. Run this command to verify the version: `docker run dgraph/dgraph:vXX.X.X dgraph version`
38+
1. The new CD workflow _should_ copy all artifacts to the release (there should be 10 artifacts
39+
with the release). If not, at the end of the CD workflow, you'll find the created artifacts
40+
that you'll need to download and then re-upload to the release, sigh... (click on the 'edit'
41+
button of the release--use artifact names from prior release as a guide)
42+
1. For all releases (non-previews and non-patches), create a release branch. In order to easily
43+
backport fixes to the release branch, create a release branch from the tag head. For instance, if
44+
we're releasing v25.1.0, create a branch called `release/v25.1` from the tag head (ensure you're
45+
on the main branch from which you created the tag)
46+
```sh
47+
git checkout main
48+
git pull origin main
49+
git checkout -b release/v25.1
50+
git push origin release/v25.1
51+
```
52+
1. Check the [Discussions](https://github.com/orgs/dgraph-io/discussions) forum for the announcement
53+
of the release (create one if you forgot that step above which autocreates one).
54+
1. If the release has documentation changes, alert the docs team to merge the doc changes in the
55+
[dgraph-docs](https://github.com/dgraph-io/dgraph-docs/) repo.

0 commit comments

Comments
 (0)