Skip to content

Commit

Permalink
Merge branch 'main' into PG-1116-Def-table-access-method
Browse files Browse the repository at this point in the history
  • Loading branch information
artemgavrilov authored Nov 14, 2024
2 parents 86b24a8 + 25ac0c2 commit 85d9425
Show file tree
Hide file tree
Showing 16 changed files with 517 additions and 113 deletions.
25 changes: 0 additions & 25 deletions .github/workflows/docker-push-tde-image.yaml

This file was deleted.

24 changes: 0 additions & 24 deletions .github/workflows/docker-test-image.yaml

This file was deleted.

48 changes: 48 additions & 0 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Docker

on:
workflow_dispatch:
pull_request:
push:
branches:
- main

jobs:
build-and-push:
name: Build and Push
runs-on: ubuntu-latest

steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build
uses: docker/build-push-action@v6
with:
file: docker/Dockerfile
load: true # Put image in local docker
tags: perconalab/pg_tde:latest

- name: Test
run: |
docker run --pull=never --name pg-tde -e POSTGRES_PASSWORD=mysecretpassword -d perconalab/pg_tde:latest
sleep 10
IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' pg-tde)
echo $IP
echo "CREATE TABLE test_enc(id SERIAL, k INTEGER DEFAULT '0' NOT NULL, PRIMARY KEY (id)) USING pg_tde;" | docker run -e PGPASSWORD=mysecretpassword --rm postgres psql -h $IP -U postgres
echo "SELECT * FROM test_enc;" | docker run -e PGPASSWORD=mysecretpassword --rm postgres psql -h $IP -U postgres
- name: Login to Docker Hub
if: ${{ github.ref == 'refs/heads/main' }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Push
if: ${{ github.ref == 'refs/heads/main' }}
uses: docker/build-push-action@v6
with:
file: docker/Dockerfile
push: true
tags: perconalab/pg_tde:latest
40 changes: 16 additions & 24 deletions .github/workflows/doc-build.yaml → .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
name: Build pg_tde documentation
name: Docs
on:
push:
branches:
branches:
- main
paths:
- 'documentation/**'
- "documentation/**"

jobs:
build:
name: Deploy docs
release:
name: Release
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ github.workspace }}/documentation

steps:
#Pull the latest changes
- name: Chekout code
steps:
- name: Chekout
uses: actions/checkout@v4
with:
fetch-depth: 0
#Prepare the env

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'

#Configure git
python-version: "3.x"

- name: Configure git
env:
ROBOT_TOKEN: ${{ secrets.ROBOT_TOKEN }}
Expand All @@ -34,21 +33,14 @@ jobs:
git config user.password "${ROBOT_TOKEN}"
echo "GIT_USER=percona-platform-robot:${ROBOT_TOKEN}" >> $GITHUB_ENV
#Set up MkDocs
- name: Install MkDocs
run: |
cd documentation
python -m pip install --upgrade pip
pip install wheel
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi

# Deploy docs
- name: Deploy docs
- name: Deploy
run: |
cd documentation
mike deploy main -p
mike set-default main -p
mike retitle main "Beta" -p
mike retitle main "Beta" -p
3 changes: 2 additions & 1 deletion .github/workflows/postgresql-17-src-meson.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,6 @@ jobs:
with:
name: Regressions diff and postgresql log
path: |
src/build/testrun/pg_tde/regress/
src/build/testrun/pg_tde/
src/contrib/pg_tde/t/results/
retention-days: 3
48 changes: 48 additions & 0 deletions .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Scorecard
on:
# To guarantee Maintained check is occasionally updated. See
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
schedule:
- cron: "24 3 * * 1"
push:
branches:
- main

# Declare default permissions as read only.
permissions: read-all

jobs:
analysis:
name: Analysis
runs-on: ubuntu-latest
permissions:
# Needed to upload the results to code-scanning dashboard.
security-events: write
# Needed to publish results and get a badge (see publish_results below).
id-token: write

steps:
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
persist-credentials: false

- name: Run analysis
uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1
with:
results_file: results.sarif
results_format: sarif
publish_results: true

- name: Upload results
uses: actions/upload-artifact@97a0fba1372883ab732affbe8f94b823f91727db # v3.pre.node20
with:
name: SARIF file
path: results.sarif
retention-days: 5

# Upload the results to GitHub's code scanning dashboard (optional).
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif
124 changes: 124 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
# 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 `<JIRAISSUE>-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.
<details>
<summary>.vimrc configuration example</summary>

```
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
```
</details>
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
7. Commit the changes. Add the Jira issue number at the beginning of your message subject, so that is reads as `<JIRAISSUE> : My commit message`. Follow this pattern for your commits:
```
PG-1234: Main commit message.
<Blank line>
Details of fix.
```
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
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
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. 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
Once your pull request is merged, you are an official Percona Community Contributor. Welcome to the community!
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Percona LLC
Copyright (c) 2024 Percona LLC

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/percona/pg_tde/badge)](https://scorecard.dev/viewer/?uri=github.com/percona/pg_tde)
[![Forum](https://img.shields.io/badge/Forum-join-brightgreen)](https://forums.percona.com/)

# pg_tde: Transparent Database Encryption for PostgreSQL
Expand Down
Loading

0 comments on commit 85d9425

Please sign in to comment.