You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
K8SPG-744 Updated Contributing guide with the steps to build and deploy the Operator (#1208)
* K8SPG-744 Updated Contributing guide with the steps to build and deploy the Operator
* Updated after the review
* Removed stuff that should not be part pf the PR
* Update CONTRIBUTING.md
Co-authored-by: George Kechagias <geo.kechagias@gmail.com>
---------
Co-authored-by: George Kechagias <geo.kechagias@gmail.com>
Co-authored-by: Viacheslav Sarzhan <slava.sarzhan@percona.com>
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+73-9Lines changed: 73 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,10 @@
1
1
# Contributing to Percona Operator for PostgreSQL
2
2
3
+
We welcome contributions to the Percona Operator for PostgreSQL project and we're glad that you would like to become a Percona community member and participate in keeping open source open. For you to help us improve the Operator, please follow the guidelines below.
4
+
3
5
## Prerequisites
4
6
5
-
Before submitting code contributions, you should first complete the following prerequisites.
7
+
Before submitting code contributions, complete the following prerequisites first.
6
8
7
9
### 1. Sign the CLA
8
10
@@ -16,40 +18,102 @@ Please make sure to read and observe the [Contribution Policy](code-of-conduct.m
16
18
17
19
### 1. Making a bug report
18
20
19
-
Improvement and bugfix tasks for Percona's projects are tracked in [Jira](https://jira.percona.com/projects/K8SPG/issues).
21
+
We track improvement and bugfix tasks for Percona Operator project in [Jira](https://jira.percona.com/projects/K8SPG/issues).
20
22
21
23
Although not mandatory, it is a good practice to examine already open Jira issues first. For bigger contributions, we suggest creating a Jira issue and discussing it with the engineering team and community before proposing any code changes.
22
24
23
25
Another good place to discuss Percona's projects with developers and other community members is the [community forum](https://forums.percona.com).
24
26
25
27
### 2. Contributing to the source tree
26
28
27
-
Contributions to the source tree should follow the workflow described below:
29
+
Follow the workflow described below:
30
+
31
+
1.[Fork the repository on GitHub](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo), clone your fork locally, and then [sync your local fork to upstream](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/syncing-a-fork). Make sure to always sync your fork with upstream before starting to work on any changes.
28
32
29
-
1. First, you need to [fork the repository on GitHub](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo), clone your fork locally, and then [sync your local fork to upstream](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/syncing-a-fork). After that, before starting to work on changes, make sure to always sync your fork with upstream.
30
-
2. Create a branch for changes you are planning to make. If there is a Jira ticket related to your contribution, it is recommended to name your branch in the following way: `<Jira issue number>-<short description>`, where the issue number is something like `K8SPG-42`.
33
+
2. Create a branch for changes you are planning to make. If there is a Jira ticket related to your contribution, name your branch in the following way: `<Jira issue number>-<short description>`, where the issue number is something like `K8SPG-42`.
31
34
32
35
Create the branch in your local repo as follows:
33
36
34
37
```
35
38
$ git checkout -b K8SPG-42-fix-feature-X
36
39
```
37
40
38
-
When your changes are ready, make a commit, mentioning the Jira issue in the commit message, if any:
41
+
3. When your changes are ready, make a commit, mentioning the Jira issue in the commit message, if any:
39
42
40
43
```
41
44
$ git add .
42
45
$ git commit -m "K8SPG-42 fixed by ......"
43
46
$ git push -u origin K8SPG-42-fix-feature-X
44
47
```
45
48
46
-
3. Create a pull request to the main repository on GitHub.
47
-
4. When the reviewer makes some comments, address any feedback that comes and update the pull request.
48
-
5. When your contribution is accepted, your pull request will be approved and merged to the main branch.
49
+
4. Create a pull request to the main repository on GitHub.
50
+
5.[Build a custom Operator image based on your changes](#build-a-custom-operator-image) to verify that they work
51
+
6.[Update deployment manifests](#update-deployment-manifests) to reflect your changes
52
+
7.[Run e2e tests](#run-e2e-tests) to verify your changes are stable and robust.
53
+
8. Someone from our team reviews your pull request. When the reviewer makes some comments, address any feedback that comes and update the pull request.
54
+
9. When your contribution is accepted, your pull request will be approved and merged to the main branch.
55
+
56
+
#### Build a custom Operator image based on your changes
57
+
58
+
To build a new Operator image based on your local changes, do the following:
59
+
60
+
1. Set the `IMAGE` environment variable to the your image repository and tag. For example:
Replace <your-repository> and <feature-XYZ> with your own values.
67
+
68
+
2. Build the Docker image and push it to the specified repository:
69
+
70
+
```
71
+
$ make build-docker-image
72
+
```
73
+
74
+
#### Update deployment manifests
75
+
76
+
Update the files under the `deploy/` directory to reflect any new fields in the resource API, a new image, etc. The `deploy/` directory contains the CRDs, bundles, and other manifests.
77
+
78
+
Run the following command to update deployment manifests:
79
+
80
+
```
81
+
$ make generate VERSION=<feature-XYZ>
82
+
```
83
+
84
+
`<feature-XYZ>` here is the tag of your built image.
85
+
86
+
Next, test your custom changes by deploying the Operator on your Kubernetes cluster.
The Operator repository includes a collection of end-to-end (e2e) tests under the `e2e-tests/` directory. You can run these tests on your own Kubernetes cluster to ensure that your changes are robust and stable.
103
+
104
+
105
+
To run a specific test by name, use the following command. In the example below, we run the `init-deploy` test:
106
+
107
+
```
108
+
$ kubectl kuttl test --config e2e-tests/kuttl.yaml --test "^init-deploy\$" --skip-delete
109
+
```
110
+
111
+
Replace `init-deploy` with the name of the test you want to run.
49
112
50
113
### 3. Contributing to documentation
51
114
52
115
The workflow for documentation is similar, but we store source code for the Percona Operator for PostgreSQL documentation in a [separate repository](https://github.com/percona/k8spg-docs).
116
+
53
117
See the [Documentation Contribution Guide](https://github.com/percona/k8spg-docs/blob/main/CONTRIBUTING.md) for more information.
0 commit comments