Skip to content

Commit

Permalink
Merge pull request #1224 from kapicorp/improve-development-workflow
Browse files Browse the repository at this point in the history
Improve development workflow
  • Loading branch information
ademariag authored Sep 1, 2024
2 parents ee1e9f8 + ffd625c commit f2fcd74
Show file tree
Hide file tree
Showing 108 changed files with 849 additions and 1,269 deletions.
20 changes: 10 additions & 10 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ body:
# information
- type: markdown
attributes:
value: |
value: |
Thanks for taking the time to fill out this bug report!
*Note:* Please search to see if an issue already exists for the bug you encountered.
# bug description
Expand All @@ -27,10 +27,10 @@ body:
placeholder: Tell us what steps you did to encounter the bug!
render: bash
value: |
1.
2.
3.
4.
1.
2.
3.
4.
validations:
required: true
# expected behavior
Expand All @@ -47,7 +47,7 @@ body:
id: additional-context
attributes:
label: Additional context
description: |
description: |
Add any other context about the problem here.
If applicable, you can add screenshots to help explain your problem.
placeholder: Anything that might help us understanding your problem...
Expand All @@ -62,7 +62,7 @@ body:
attributes:
label: Version (kapitan)
description: |
Which version of kapitan are you running?
Which version of kapitan are you running?
If you are using an older version of kapitan, please try it against the master branch or the latest stable version.
options:
- v0.31.0 (stable)
Expand All @@ -76,11 +76,11 @@ body:
attributes:
label: Version (kapitan)
description: |
Which version of python are you using? Kapitan officially supports only version 3.10 and 3.11
Which version of python are you using? Kapitan officially supports only version 3.10 and 3.11
If you are using an older version of python, please check if the bug still exists with a newer (supported) version.
options:
- "3.11"
- "3.10"
- "3.10"
- I use kapitan directly (pip, docker)
multiple: true
validations:
Expand All @@ -107,7 +107,7 @@ body:
id: logs
attributes:
label: Relevant log output
description: |
description: |
Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
Use the `--verbose` flag to see all the logs.
render: bash
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ contact_links:
- name: '💬 Join us on Slack'
url: https://kubernetes.slack.com/archives/C981W2HD3
about: |
Join our Slack channel to connect with our community, ask questions, and stay updated on project developments.
Join our Slack channel to connect with our community, ask questions, and stay updated on project developments.
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ body:
# information
- type: markdown
attributes:
value: |
value: |
Thanks for taking the time to give us feedback!
# feature description
- type: textarea
id: documentation-issue-description
attributes:
label: Description of the documentation issue
description: |
A clear and concise description of what the issue with documentation is.
A clear and concise description of what the issue with documentation is.
Please make proposals, how it could be done better.
placeholder: Tell us what you want to see in the project!
validations:
Expand All @@ -24,6 +24,6 @@ body:
id: additional-context
attributes:
label: Additional context
description: |
description: |
Add any other context about the feature here.
placeholder: Anything that might help us understanding your documentation issue...
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ body:
# information
- type: markdown
attributes:
value: |
value: |
Thanks for taking the time to fill out this feature request!
# feature description
- type: textarea
id: feature-description
attributes:
label: Description of the feature
description: |
A clear and concise description of what the feature request is.
A clear and concise description of what the feature request is.
Please make proposals, how you would use this feature (syntax).
placeholder: Tell us what you want to see in the project!
validations:
Expand All @@ -24,6 +24,6 @@ body:
id: additional-context
attributes:
label: Additional context
description: |
description: |
Add any other context about the feature here.
placeholder: Anything that might help us understanding your feature request...
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ updates:
schedule:
interval: "daily"
labels:
- "github-actions"
- "github-actions"
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ Fixes #
## Docs and Tests

* [ ] Tests added
* [ ] Updated documentation
* [ ] Updated documentation
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
- 'docs/**'
- '.github/workflows/documentation.yml'
- 'mkdocs.yml'
- 'CNAME'
- 'CNAME'
push:
branches:
- master
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/housekeeping.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ jobs:
with:
stale-issue-message: |
This issue is stale because it has been open for 1 year with no activity.
Remove the stale label or comment if this issue is still relevant for you.
Remove the stale label or comment if this issue is still relevant for you.
If not, please close it yourself.
days-before-issue-stale: 365
day-before-pr-stale: -1
days-before-pr-stale: -1
days-before-close: -1
days-before-pr-close: -1
days-before-pr-close: -1
6 changes: 3 additions & 3 deletions .github/workflows/pex-build-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Install poetry
run: |-
run: |-
pipx install poetry
pipx inject poetry poetry-plugin-export --force
- name: Set up Python
Expand All @@ -40,14 +40,14 @@ jobs:
- name: Build Pex
run: |-
mkdir -p dist
pex .[gojsonnet] -r requirements.txt \
pex '.[gojsonnet,omegaconf,reclass-rs]' -r requirements.txt \
--python-shebang='#!/usr/bin/env python3' \
--python=python3.11 \
--python=python3.10 \
--python=python3.12 \
-m kapitan \
-o dist/kapitan.linux-x86_64.pex
dist/kapitan.linux-x86_64.pex --help
dist/kapitan.linux-x86_64.pex --help
- name: Add linux-x86_64 pex to assets
uses: softprops/action-gh-release@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-pip-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Upload Python Package
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true

on:
workflow_dispatch:
release:
Expand Down
26 changes: 13 additions & 13 deletions .github/workflows/test-build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true

on:
on:
push:
branches:
- master
Expand All @@ -29,15 +29,15 @@ on:
- 'CNAME'

jobs:
lint:
name: linter
precommit:
name: precommit checks
runs-on: ubuntu-latest
if: success() || failure() # Continue running if other jobs fail
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: psf/black@main
- uses: pre-commit/action@v3.0.1

test:
name: python ${{ matrix.python-version }} tests
runs-on: ubuntu-latest
Expand All @@ -60,7 +60,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install libraries dependencies
run: |
poetry install --no-root
poetry install --with test --no-root --extras=gojsonnet --extras=omegaconf --extras=reclass-rs
- name: Install testing dependencies (Helm)
run: |
sudo apt-get -qq update
Expand Down Expand Up @@ -92,7 +92,7 @@ jobs:
uses: actions/checkout@v4
with:
submodules: recursive

# Setup QEMU and Buildx to build multi-platform image
# This was inspired by this example : https://docs.docker.com/build/ci/github-actions/examples/#multi-platform-images
- name: Set up QEMU
Expand All @@ -104,7 +104,7 @@ jobs:
- name: build Kapitan Image
uses: docker/build-push-action@v6
with:
push: False
push: False
platforms: ${{ matrix.platform }}
load: True
file: Dockerfile
Expand All @@ -120,7 +120,7 @@ jobs:
publish:
name: publish platform images
# Only starts if everything else is successful
needs: [lint, test, build]
needs: [precommit, test, build]
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
strategy:
Expand All @@ -134,7 +134,7 @@ jobs:
uses: actions/checkout@v4
with:
submodules: recursive

# Setup QEMU and Buildx to build multi-platform image
# This was inspired by this example : https://docs.docker.com/build/ci/github-actions/examples/#multi-platform-images
- name: Set up QEMU
Expand Down Expand Up @@ -180,7 +180,7 @@ jobs:
platforms: ${{ matrix.platform }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{steps.meta.output.labels}}
labels: ${{steps.meta.outputs.labels}}
cache-from: type=gha,scope=$GITHUB_REF_NAME-${{ matrix.platform }}
cache-to: type=gha,mode=max,scope=$GITHUB_REF_NAME-${{ matrix.platform }}

Expand Down Expand Up @@ -223,7 +223,7 @@ jobs:
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- uses: int128/docker-manifest-create-action@v1
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME}}
Expand All @@ -233,4 +233,4 @@ jobs:
builder: buildx
suffixes: |
-linux-amd64
-linux-arm64
-linux-arm64
2 changes: 1 addition & 1 deletion .markdownlintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
examples/
tests/
kapitan/
PULL_REQUEST_TEMPLATE.md
PULL_REQUEST_TEMPLATE.md
29 changes: 25 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,30 @@
exclude: ^(examples/|tests/test_terraform_compiled/|tests/test_kubernetes_compiled/|tests/test_docker_compiled/|tests/test_resources/|tests/test_jsonnet/)
repos:
- repo: https://github.com/psf/black
rev: 22.10.0
rev: 24.8.0
hooks:
- id: black
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.32.2
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: markdownlint-fix
- id: isort
args: [--profile, black]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: check-docstring-first
- id: debug-statements
- id: end-of-file-fixer
- id: check-merge-conflict
- repo: https://github.com/python-poetry/poetry
rev: '1.8.0'
hooks:
- id: poetry-check
- id: poetry-lock
entry: env PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring poetry lock
- id: poetry-install
- repo: https://github.com/rhysd/actionlint
rev: 'v1.7.1'
hooks:
- id: actionlint-docker
2 changes: 1 addition & 1 deletion CNAME
Original file line number Diff line number Diff line change
@@ -1 +1 @@
kapitan.dev
kapitan.dev
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ COPY ./poetry.lock ./poetry.lock
COPY ./README.md ./README.md

# Installs and caches dependencies
RUN poetry install --no-root --extras=gojsonnet --extras=reclass-rs
ENV POETRY_VIRTUALENVS_CREATE=false
RUN poetry install --no-root --extras=gojsonnet --extras=reclass-rs --extras=omegaconf

COPY ./kapitan ./kapitan

RUN pip install --editable .[test] \
&& pip install .[gojsonnet]
RUN pip install .[gojsonnet,omegaconf,reclass-rs]


# Final image with virtualenv built in previous step
Expand Down
Loading

0 comments on commit f2fcd74

Please sign in to comment.