-
Notifications
You must be signed in to change notification settings - Fork 4
Initial import #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
8740174
chore(git): Add Gitignore
vmercierfr 75a096e
chore(github): Add Github issue templates
vmercierfr 535a475
chore(github): Configure dependabot
vmercierfr 637e383
chore(linter): Add linters
vmercierfr 5460841
chore(localdev): Add local development environment
vmercierfr ef7817e
chore(go): Add initial project structure
vmercierfr e1733c2
chore(go): Add retry package
vmercierfr 0888ed7
chore(go): Add UUID7 package
vmercierfr 12b4269
chore(go): Add postgresql package
vmercierfr d08c93f
chore(go): Add PPM package
vmercierfr 8478b1e
chore(go): Add CLI commands
vmercierfr 6b90215
chore(bats): Add bats tests
vmercierfr eca07c7
chore(ci): Add test
vmercierfr b70d290
chore(ci): Add linter
vmercierfr abd4147
chore(docs): Add PPM configuration file template
vmercierfr 1e00631
chore(README): Initial import
vmercierfr 06cedb0
chore(helm): Add Helm chart
vmercierfr ddf3d8d
chore(debian): Add Debian package
vmercierfr 3fd5df6
chore(go): Simplify date in postgresql tests
vmercierfr 8ef42b2
refact(postgresql): Rewrite package to split PostgreSQL logic
vmercierfr da95adb
refact(partition): Rewrite package to split PostgreSQL logic
vmercierfr dcaf1c6
refact(ppm): Rewrite package to split PostgreSQL logic
vmercierfr 6d86fcc
refact(cmd): Rewrite package to split PostgreSQL logic
vmercierfr b670733
chore(kubernetesdev): Add local development environment
vmercierfr ddd0a97
chore(goreleaser): Add Goreleaser configuration
vmercierfr 5d17554
chore(ci): Add checkov
vmercierfr 3bc21c9
chore(ci): Disable checkov until project is private
vmercierfr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| skip-check: | ||
| - CKV_SECRET_4 # We have password in our configuration templates | ||
| - CKV_DOCKER_2 # We don't define healthcheck for our containers because it's a CLI | ||
|
|
||
| skip-path: | ||
| - scripts/kubernetesdev # Exclude kubernetes development environment, mostly for PostgreSQL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| --- | ||
| name: Bug report | ||
| about: Create a report to help us improve | ||
| title: '' | ||
| labels: bug | ||
| assignees: '' | ||
|
|
||
| --- | ||
|
|
||
| ### Describe the bug | ||
|
|
||
| A clear and concise description of what the bug is. | ||
|
|
||
| ### Desktop (please complete the following information) | ||
|
|
||
| - OS: [e.g. Linux] | ||
| - PostgreSQL partition manager [e.g. v1.1] | ||
| - PostgreSQL version: [e.g. v14] | ||
| - Partition key column type [e.g. date, uuidv7] | ||
|
|
||
| If possible, please also share: | ||
|
|
||
| - Table table structure dump (`pg_dump --schema-only --no-comments --no-privileges -t <table_name> <database_name>`) | ||
| - PostgreSQL Partition Manager configuration (`postgresql-partition-manager.yaml`) | ||
|
|
||
| ### To Reproduce | ||
|
|
||
| Steps to reproduce the behavior | ||
|
|
||
| ### Expected behavior | ||
|
|
||
| A clear and concise description of what you expected to happen. | ||
|
|
||
| ### Additional context | ||
|
|
||
| Add any other context about the problem here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| --- | ||
| name: Feature request | ||
| about: Suggest an idea for this project | ||
| title: '' | ||
| labels: enhancement | ||
| assignees: '' | ||
|
|
||
| --- | ||
|
|
||
| ### Is your feature request related to a problem? Please describe | ||
|
|
||
| A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] | ||
|
|
||
| ### Describe the solution you'd like | ||
|
|
||
| A clear and concise description of what you want to happen. | ||
|
|
||
| ### Describe alternatives you've considered | ||
|
|
||
| A clear and concise description of any alternative solutions or features you've considered. | ||
|
|
||
| ### Additional context | ||
|
|
||
| Add any other context or screenshots about the feature request here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| --- | ||
| version: 2 | ||
| updates: | ||
|
|
||
| - package-ecosystem: gomod | ||
| directory: "/" | ||
| schedule: | ||
| interval: weekly | ||
| open-pull-requests-limit: 10 | ||
|
|
||
| - package-ecosystem: "github-actions" | ||
| directory: "/" | ||
| schedule: | ||
| interval: weekly | ||
|
|
||
| - package-ecosystem: "docker" | ||
| directory: "/scripts/localdev" | ||
| schedule: | ||
| interval: weekly |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| --- | ||
| name: linter | ||
| on: # yamllint disable-line rule:truthy | ||
| push: | ||
| branches: | ||
| - "*" | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| golangci: | ||
| name: golangci | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: '1.21' | ||
| cache: false | ||
| - name: golangci-lint | ||
| uses: golangci/golangci-lint-action@v4 | ||
| with: | ||
| version: v1.54 | ||
|
|
||
| yamllint: | ||
| name: yamllint | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Lint YAML files | ||
| run: yamllint . # YAML lint is already installed in ubuntu-latest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,181 @@ | ||
| --- | ||
| name: unittest | ||
| on: # yamllint disable-line rule:truthy | ||
| push: | ||
| branches: | ||
| - "*" | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| go: | ||
| name: go | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: '1.21' | ||
| - name: Install dependencies | ||
| run: | | ||
| go get . | ||
| - name: Build | ||
| run: make build | ||
| - name: Run Go tests | ||
| run: make test | ||
| - name: Code Coverage Report | ||
| uses: irongut/CodeCoverageSummary@v1.3.0 | ||
| with: | ||
| filename: coverage.xml | ||
| badge: true | ||
| fail_below_min: true | ||
| format: markdown | ||
| hide_branch_rate: false | ||
| hide_complexity: true | ||
| indicators: true | ||
| output: both | ||
| thresholds: '60 80' | ||
| - uses: jwalton/gh-find-current-pr@v1 | ||
| id: finder | ||
| - name: Add Coverage PR Comment | ||
| uses: marocchino/sticky-pull-request-comment@v2 | ||
| with: | ||
| number: ${{ steps.finder.outputs.pr }} | ||
| path: code-coverage-results.md | ||
| recreate: true | ||
| - name: Upload artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: binary | ||
| path: postgresql-partition-manager | ||
| if-no-files-found: error | ||
| retention-days: 1 | ||
|
|
||
| e2e: | ||
| name: End-to-end | ||
| needs: go | ||
| strategy: | ||
| matrix: | ||
| postgres: | ||
| - postgres:14 | ||
| - postgres:15 | ||
| - postgres:16 | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| BATS_LIB_PATH: "${{ github.workspace }}/test/bats/lib/" | ||
| PGHOST: localhost | ||
| PGUSER: postgres | ||
| PGPASSWORD: hackme | ||
| PGDATABASE: unittest | ||
| services: | ||
| postgres: | ||
| image: ${{ matrix.postgres }} | ||
| options: >- | ||
| --health-cmd pg_isready | ||
| --health-interval 10s | ||
| --health-timeout 5s | ||
| --health-retries 5 | ||
| --hostname postgres | ||
| env: | ||
| POSTGRES_PASSWORD: hackme | ||
| ports: | ||
| - 5432:5432 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Bats and bats libs | ||
| uses: bats-core/bats-action@2.0.0 | ||
| with: | ||
| support-path: ${{ github.workspace }}/test/bats/lib/bats-support | ||
| assert-path: ${{ github.workspace }}/test/bats/lib/bats-assert | ||
| file-install: false # Unused | ||
| detik-install: false # Unused | ||
|
|
||
| - name: Download artifact | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: binary | ||
|
|
||
| # File permissions are not maintained during artifact upload/download | ||
| - name: Move binary to local executable | ||
| run: mv postgresql-partition-manager /usr/local/bin && chmod +x /usr/local/bin/postgresql-partition-manager | ||
|
|
||
| - name: Run bats | ||
| run: make bats-test | ||
|
|
||
| helm: | ||
| name: helm | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| HELM_UNITTEST_VERSION: v0.3.5 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Install helm-unittest | ||
| run: helm plugin install --version $HELM_UNITTEST_VERSION https://github.com/helm-unittest/helm-unittest.git | ||
| - name: Run Helm test | ||
| run: make helm-test | ||
|
|
||
| kubeconform: | ||
| name: kubeconform | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| KUBECONFORM_VERSION: 0.6.2 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Install kubeconform | ||
| run: | | ||
| curl -sSLo /tmp/kubeconform.tar.gz "https://github.com/yannh/kubeconform/releases/download/v${KUBECONFORM_VERSION}/kubeconform-linux-amd64.tar.gz" \ | ||
| && tar -C /usr/local/bin/ -xzvf /tmp/kubeconform.tar.gz | ||
| - name: Run Kubeconform test | ||
| run: make kubeconform-test | ||
|
|
||
| debian: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: stable | ||
| - name: Set up QEMU for ARM64 build | ||
| uses: docker/setup-qemu-action@v3 | ||
| - uses: goreleaser/goreleaser-action@v5 | ||
| with: | ||
| distribution: goreleaser | ||
| version: latest | ||
| args: release --clean --skip=publish --skip=docker --snapshot | ||
| env: | ||
| GORELEASER_CURRENT_TAG: 0.0.0 | ||
| - name: Run Debian package tests | ||
| run: make debian-test-ci | ||
|
|
||
| # checkcov: | ||
| # permissions: | ||
| # security-events: write # for github/codeql-action/upload-sarif to upload SARIF results | ||
| # actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status | ||
| # runs-on: ubuntu-latest | ||
| # steps: | ||
| # - uses: actions/checkout@v4 | ||
| # - name: Checkov GitHub Action | ||
| # uses: bridgecrewio/checkov-action@v12 | ||
| # with: | ||
| # # This will add both a CLI output to the console and create a results.sarif file | ||
| # output_format: cli,sarif | ||
| # output_file_path: console,results.sarif | ||
| # - name: Upload SARIF file | ||
| # uses: github/codeql-action/upload-sarif@v3 | ||
| # # Results are generated only on a success or failure | ||
| # # this is required since GitHub by default won't run the next step | ||
| # # when the previous one has failed. Security checks that do not pass will 'fail'. | ||
| # # An alternative is to add `continue-on-error: true` to the previous step | ||
| # # Or 'soft_fail: true' to checkov. | ||
| # if: success() || failure() | ||
| # with: | ||
| # sarif_file: results.sarif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| .DS_Store | ||
| /.vscode | ||
| /cover.html | ||
| /coverage.txt | ||
| /coverage.xml | ||
| /dist | ||
| /postgresql-partition-manager | ||
| /postgresql-partition-manager.yaml | ||
| scripts/localdev/.data | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.