From 6e81fbd03681adc818836eb11d3f5127ada16b19 Mon Sep 17 00:00:00 2001 From: Artem Gavrilov Date: Mon, 11 Nov 2024 17:55:13 +0200 Subject: [PATCH 1/5] PG-1191 Add CONTRIBUTING.md --- CONTRIBUTING.md | 127 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..a25bcfff --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,127 @@ +# Contributing guide + +Welcome to `pg_tde` - the Transparent Database Encryption for PostgreSQL! + +We're glad that you would like to become a Percona community member and participate in keeping open source open. + +You can contribute in one of the following ways: + +1. Reach us on our [Forums](https://forums.percona.com/c/postgresql/pg-tde-transparent-data-encryption-tde/82). +2. [Submit a bug report or a feature request](#submit-a-bug-report-or-a-feature-request) +3. [Submit a pull request (PR) with the code patch](#submit-a-pull-request) +4. [Contribute to documentation](#contributing-to-documentation) + +By contributing, you agree to the [Percona Community code of conduct](https://github.com/percona/community/blob/main/content/contribute/coc.md). + + +## Submit a bug report or a feature request + +All bug reports, enhancements and feature requests are tracked in [Jira issue tracker](https://jira.percona.com/projects/PG). If you would like to suggest a new feature / an improvement or you found a bug in `pg_tde`, please submit the report to the [PG project](https://jira.percona.com/projects/PG/issues). + +Start by searching the open tickets for a similar report. If you find that someone else has already reported your issue, then you can upvote that report to increase its visibility. + +If there is no existing report, submit your report following these steps: + +1. Sign in to [Jira issue tracker](https://jira.percona.com/projects/PG/issues). You will need to create an account if you do not have one. +2. In the _Summary_, _Description_, _Steps To Reproduce_, _Affects Version_ fields describe the problem you have detected or an idea that you have for a new feature or improvement. +3. As a general rule of thumb, try to create bug reports that are: + + * Reproducible: describe the steps to reproduce the problem. + * Unique: check if there already exists a JIRA ticket to describe the problem. + * Scoped to a Single Bug: only report one bug in one JIRA ticket + +## Submit a pull request + +Though not mandatory, we encourage you to first check for a bug report among Jira issues and in the PR list: perhaps the bug has already been addressed. + +For feature requests and enhancements, we do ask you to create a Jira issue, describe your idea and discuss the design with us. This way we align your ideas with our vision for the product development. + +If the bug hasn’t been reported / addressed, or we’ve agreed on the enhancement implementation with you, do the following: + +1. [Fork](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo) this repository +2. Clone this repository on your machine. +3. Create a separate branch for your changes. If you work on a Jira issue, please include the issue number in the branch name so it reads as `-my_branch`. This makes it easier to track your contribution. +4. Make your changes. Please follow the guidelines outlined in the [PostgreSQL Coding Standard](https://www.postgresql.org/docs/current/source.html) to improve code readability. +
+ .vimrc configuration example + + ``` + set nocompatible " choose no compatibility with legacy vi + syntax enableset + tabstop=4set + background=lightset + textwidth=80set + colorcolumn=80 + let g:filestyle_ignore_patterns = ['^\t* \{1,3}\S'] + highlight Normal ctermbg=15 + highlight ColorColumn ctermbg=52 + ``` +
+ +5. Test your changes locally. See the [Running tests ](#running-tests) section for more information +6. Update the documentation describing your changes. See the [Contributing to documentation](#contributing-to-documentation) section for details +8. Commit the changes. Add the Jira issue number at the beginning of your message subject, so that is reads as ` : My commit message`. Follow this pattern for your commits: + + ``` + PG-1234: Main commit message. + + Details of fix. + ``` + + The [commit message guidelines](https://gist.github.com/robertpainsi/b632364184e70900af4ab688decf6f53) will help you with writing great commit messages + +9. Open a pull request to Percona +10. Our team will review your code and if everything is correct, will merge it. Otherwise, we will contact you for additional information or with the request to make changes. +11. Make sure your pull request contains only one commit message + +### Building pg_tde + +To build `pg_tde` from source code, you require the following: + +* git +* make +* gcc +* pg_config + +Refer to the [Building from source code](https://github.com/percona/pg_tde?tab=readme-ov-file#building-from-sources-for-community-postgresql) section for guidelines. + + +### Running tests + +When you work, you should periodically run tests to check that your changes don’t break existing code. + +You can find the tests in the `sql` directory. + +#### Run manually + +1. Change directory to pg_tde + +**NOTE**: Make sure `postgres` user is the owner of the `pg_tde` directory + +2. Start the tests + 1. If you built PostgreSQL from PGDG, use the following command: + + ```sh + make installcheck + ``` + + + 2. If you installed PostgreSQL server from Percona Distribution for PostgreSQL, use the following command: + + ```sh + sudo su postgres bash -c 'make installcheck USE_PGXS=1' + ``` +#### Run automatically + +The tests are run automatically with GitHub actions once you commit and push your changes. Make sure all tests are successfully passed before you proceed. + + +## Contributing to documentation + +`pg_tde` documentation is maintained in the `documentation` directory. + +// TODO + +## After your pull request is merged + +Once your pull request is merged, you are an official Percona Community Contributor. Welcome to the community! From d72f59216bfc78283bd381986479d143219e6640 Mon Sep 17 00:00:00 2001 From: Artem Gavrilov Date: Tue, 12 Nov 2024 16:44:46 +0200 Subject: [PATCH 2/5] Update CONTRIBUTING.md --- CONTRIBUTING.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a25bcfff..495b56cd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -60,7 +60,7 @@ If the bug hasn’t been reported / addressed, or we’ve agreed on the enhancem 5. Test your changes locally. See the [Running tests ](#running-tests) section for more information 6. Update the documentation describing your changes. See the [Contributing to documentation](#contributing-to-documentation) section for details -8. Commit the changes. Add the Jira issue number at the beginning of your message subject, so that is reads as ` : My commit message`. Follow this pattern for your commits: +7. Commit the changes. Add the Jira issue number at the beginning of your message subject, so that is reads as ` : My commit message`. Follow this pattern for your commits: ``` PG-1234: Main commit message. @@ -70,9 +70,8 @@ If the bug hasn’t been reported / addressed, or we’ve agreed on the enhancem The [commit message guidelines](https://gist.github.com/robertpainsi/b632364184e70900af4ab688decf6f53) will help you with writing great commit messages -9. Open a pull request to Percona -10. Our team will review your code and if everything is correct, will merge it. Otherwise, we will contact you for additional information or with the request to make changes. -11. Make sure your pull request contains only one commit message +8. Open a pull request to Percona +9. Our team will review your code and if everything is correct, will merge it. Otherwise, we will contact you for additional information or with the request to make changes. ### Building pg_tde From 13223c3f0f5713291d60305002c1727d38d9202f Mon Sep 17 00:00:00 2001 From: Artem Gavrilov Date: Tue, 12 Nov 2024 17:35:13 +0200 Subject: [PATCH 3/5] PG-1191 Add documentation contribuing guide --- documentation/CONTRIBUTING.md | 114 ++++++++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 documentation/CONTRIBUTING.md diff --git a/documentation/CONTRIBUTING.md b/documentation/CONTRIBUTING.md new file mode 100644 index 00000000..4a5bcc7f --- /dev/null +++ b/documentation/CONTRIBUTING.md @@ -0,0 +1,114 @@ +## Contribute to documentation + +`pg_tde` documentation is written in Markdown language, so you can [edit it online via GitHub](#edit-documentation-online-vi-github). If you wish to have more control over the doc process, jump to how to [edit documentation locally](#edit-documentation-locally). + +Before you start, learn what [git], [MkDocs] and [Docker] are and what [Markdown] is and how to write it. For your convenience, there's also a cheat sheet to help you with the syntax. + +The doc files are in the `documentation` directory. + +### Edit documentation online via GitHub + +1. Click the **Edit this page** icon next to the page title. The source `.md` file of the page opens in GitHub editor in your browser. If you haven’t worked with the repository before, GitHub creates a [fork](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo) of it for you. +2. Edit the page. You can check your changes on the **Preview** tab. +3. Commit your changes. + * In the _Commit changes_ section, describe your changes. + * Select the **Create a new branch for this commit** and start a pull request option + * Click **Propose changes**. +4. GitHub creates a branch and a commit for your changes. It loads a new page on which you can open a pull request to Percona. The page shows the base branch - the one you offer your changes for, your commit message and a diff - a visual representation of your changes against the original page. This allows you to make a last-minute review. When you are ready, click the Create pull request button. +5. Someone from our team reviews the pull request and if everything is correct, merges it into the documentation. Then it gets published on the site. + +### Edit documentation locally + +This option is for users who prefer to work from their computer and / or have the full control over the documentation process. + +The steps are the following: + +1. Fork this repository +2. Clone the repository on your machine: + +```sh +git clone git@github.com:/pg_tde.git +``` + +3. Change the directory to ``pg_tde`` and add the remote upstream repository: + +```sh +git remote add upstream git@github.com:percona/pg_tde.git +``` + +4. Pull the latest changes from upstream + +```sh +git fetch upstream +git merge upstream/main +``` + +5. Create a separate branch for your changes + +```sh +git checkout -b +``` + +6. Make changes +7. Commit your changes. The [commit message guidelines](https://gist.github.com/robertpainsi/b632364184e70900af4ab688decf6f53) will help you with writing great commit messages + +8. Open a pull request to Percona + +#### Building the documentation + +To verify how your changes look, generate the static site with the documentation. This process is called *building*. You can do it in these ways: +- [Use Docker](#use-docker) +- [Install MkDocs and build locally](#install-sphinx-and-build-locally) + +##### Use Docker + +1. [Get Docker](https://docs.docker.com/get-docker/) +2. We use [our Docker image](https://hub.docker.com/repository/docker/perconalab/pmm-doc-md) to build documentation. Run the following command: + +```sh +docker run --rm -v $(pwd):/documentation perconalab/pmm-doc-md mkdocs build +``` + If Docker can't find the image locally, it first downloads the image, and then runs it to build the documentation. + +3. Go to the ``site`` directory and open the ``index.html`` file to see the documentation. + +If you want to see the changes as you edit the docs, use this command instead: + +```sh +docker run --rm -v $(pwd):/documentation -p 8000:8000 perconalab/pmm-doc-md mkdocs serve --dev-addr=0.0.0.0:8000 +``` + +Wait until you see `INFO - Start detecting changes`, then enter `0.0.0.0:8000` in the browser's address bar. The documentation automatically reloads after you save the changes in source files. + +##### Install MkDocs and build locally + +1. Install [Python]. + +2. Install MkDocs and required extensions: + + ```sh + pip install -r requirements.txt + ``` + +3. Build the site: + + ```sh + mkdocs build + ``` + +4. Open `site/index.html` + +Or, to run the built-in web server: + +```sh +mkdocs serve +``` + + +View the site at + +[MkDocs]: https://www.mkdocs.org/ +[Markdown]: https://daringfireball.net/projects/markdown/ +[Git]: https://git-scm.com +[Python]: https://www.python.org/downloads/ +[Docker]: https://docs.docker.com/get-docker/ From 62b002221493f9012c50588d22cbb8e8dcc82c28 Mon Sep 17 00:00:00 2001 From: Artem Gavrilov Date: Tue, 12 Nov 2024 17:37:19 +0200 Subject: [PATCH 4/5] Add link to docs contrib guide --- CONTRIBUTING.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 495b56cd..d0656d3a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -117,9 +117,7 @@ The tests are run automatically with GitHub actions once you commit and push you ## Contributing to documentation -`pg_tde` documentation is maintained in the `documentation` directory. - -// TODO +`pg_tde` documentation is maintained in the `documentation` directory. Please read the [Contributing guide](https://github.com/percona/pg_tde/blob/main/documentation/CONTRIBUTING.md) for guidelines how you can contribute to the docs. ## After your pull request is merged From 7152f9db164557b2f1fb67b5058b997edee07a7d Mon Sep 17 00:00:00 2001 From: Artem Gavrilov Date: Tue, 12 Nov 2024 18:55:41 +0200 Subject: [PATCH 5/5] Update documentation/CONTRIBUTING.md Co-authored-by: Anastasia Alexandrova --- documentation/CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/CONTRIBUTING.md b/documentation/CONTRIBUTING.md index 4a5bcc7f..f49b40b7 100644 --- a/documentation/CONTRIBUTING.md +++ b/documentation/CONTRIBUTING.md @@ -2,7 +2,7 @@ `pg_tde` documentation is written in Markdown language, so you can [edit it online via GitHub](#edit-documentation-online-vi-github). If you wish to have more control over the doc process, jump to how to [edit documentation locally](#edit-documentation-locally). -Before you start, learn what [git], [MkDocs] and [Docker] are and what [Markdown] is and how to write it. For your convenience, there's also a cheat sheet to help you with the syntax. +Before you start, learn what [git], [MkDocs] and [Docker] are and what [Markdown] is and how to write it. For your convenience, there's also a [cheat sheet](https://www.markdownguide.org/cheat-sheet/) to help you with the syntax. The doc files are in the `documentation` directory.