Skip to content

Commit

Permalink
Merge branch 'inventree:master' into custom-states
Browse files Browse the repository at this point in the history
  • Loading branch information
matmair authored Jan 15, 2024
2 parents d72ac2b + 3511450 commit 0817152
Show file tree
Hide file tree
Showing 710 changed files with 283,045 additions and 133,472 deletions.
29 changes: 15 additions & 14 deletions .deepsource.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
version = 1
exclude_patterns = [
"docs/docs/javascripts/**",
"docs/ci/**",
"InvenTree/InvenTree/static/**",
"ci/**",
"InvenTree/**/migrations/*.py"
]
test_patterns = [
"test_.*.py",
"test.py",
"tests.py"
"docs/docs/javascripts/**", # Docs: Helpers
"docs/ci/**", # Docs: CI
"InvenTree/InvenTree/static/**", # Backend: CUI static files
"ci/**", # Backend: CI
"InvenTree/**/migrations/*.py", # Backend: Migration files
"src/frontend/src/locales/**", # Frontend: Translations
]
test_patterns = ["**/test_*.py", "**/test.py", "**/tests.py"]


[[analyzers]]
Expand All @@ -19,14 +16,18 @@ name = "shell"
[[analyzers]]
name = "javascript"

[analyzers.meta]
plugins = ["react"]
[analyzers.meta]
plugins = ["react"]

[[analyzers]]
name = "python"

[analyzers.meta]
runtime_version = "3.x.x"
[analyzers.meta]
runtime_version = "3.x.x"

[[analyzers]]
name = "docker"

[[analyzers]]
name = "test-coverage"
enabled = false
51 changes: 0 additions & 51 deletions .devcontainer/Dockerfile

This file was deleted.

23 changes: 10 additions & 13 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@
{
"name": "InvenTree",
"build": {
"dockerfile": "Dockerfile",
"dockerfile": "../Dockerfile",
"context": "..",
"target": "devcontainer",
"args": {
// Update 'VARIANT' to pick a Python version: 3, 3.10, 3.9, 3.8, 3.7, 3.6
// Append -bullseye or -buster to pin to an OS version.
// Use -bullseye variants on local on arm64/Apple Silicon.
"VARIANT": "3.10-bullseye",
// Options
"NODE_VERSION": "lts/*",
"WORKSPACE": "${containerWorkspaceFolder}"
"base_image": "mcr.microsoft.com/vscode/devcontainers/base:alpine-3.18",
"workspace": "${containerWorkspaceFolder}"
}
},

Expand All @@ -25,12 +21,10 @@
"python.defaultInterpreterPath": "${containerWorkspaceFolder}/dev/venv/bin/python",
"python.linting.enabled": true,
"python.linting.pylintEnabled": false,
"python.linting.flake8Enabled": true,
"python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8",
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
"python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf",
"python.linting.banditPath": "/usr/local/py-utils/bin/bandit",
"python.linting.flake8Path": "/usr/local/py-utils/bin/flake8",
"python.linting.mypyPath": "/usr/local/py-utils/bin/mypy",
"python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle",
"python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle",
Expand All @@ -48,8 +42,11 @@
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [8000],
"forwardPorts": [5173, 8000],
"portsAttributes": {
"5173": {
"label": "Vite server"
},
"8000": {
"label": "InvenTree server"
}
Expand All @@ -60,9 +57,9 @@

// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode",
"containerUser": "vscode",
"features": {
"git": "os-provided",
"github-cli": "latest"
"git": "os-provided"
},

"remoteEnv": {
Expand Down
6 changes: 3 additions & 3 deletions .devcontainer/postCreateCommand.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ mkdir -p $1/dev/{commandhistory,plugins}
cd $1

# create venv
python3 -m venv dev/venv
. dev/venv/bin/activate
python3 -m venv $1/dev/venv
. $1/dev/venv/bin/activate

# setup InvenTree server
pip install invoke
invoke update --no-frontend
invoke update
invoke setup-dev
invoke frontend-install

Expand Down
3 changes: 0 additions & 3 deletions .djlintrc

This file was deleted.

10 changes: 0 additions & 10 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,12 +1,2 @@
# General owner is the maintainers team
* @SchrodingersGat

# plugins are co-owned
/InvenTree/plugin/ @SchrodingersGat @matmair
/InvenTree/plugins/ @SchrodingersGat @matmair

# Installer functions
.pkgr.yml @matmair
Procfile @matmair
runtime.txt @matmair
/contrib/ @matmair
6 changes: 3 additions & 3 deletions .github/actions/setup/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ runs:
using: 'composite'
steps:
- name: Checkout Code
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # pin@v3.1.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # pin@v4.1.1

# Python installs
- name: Set up Python ${{ env.python_version }}
if: ${{ inputs.python == 'true' }}
uses: actions/setup-python@13ae5bb136fac2878aff31522b9efb785519f984 # pin@v4.3.0
uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # pin@v4.7.1
with:
python-version: ${{ env.python_version }}
cache: pip
Expand All @@ -58,7 +58,7 @@ runs:
# NPM installs
- name: Install node.js ${{ env.node_version }}
if: ${{ inputs.npm == 'true' }}
uses: actions/setup-node@969bd2663942d722d85b6a8626225850c2f7be4b # pin to v3.5.0
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # pin to v3.8.2
with:
node-version: ${{ env.node_version }}
cache: 'npm'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/backport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name: Backport

on:
pull_request_target:
types: ["labeled", "closed"]
types: [ "labeled", "closed" ]

jobs:
backport:
Expand All @@ -22,7 +22,7 @@ jobs:
)
steps:
- name: Backport Action
uses: sqren/backport-github-action@v8.9.3
uses: sqren/backport-github-action@f54e19901f2a57f8b82360f2490d47ee82ec82c6 # [email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
auto_backport_label_prefix: backport-to-
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/check_translations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ jobs:

steps:
- name: Checkout Code
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # pin@v3.1.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # pin@v4.1.1
- name: Set Up Python ${{ env.python_version }}
uses: actions/setup-python@13ae5bb136fac2878aff31522b9efb785519f984 # pin@v4.3.0
uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # pin@v4.7.1
with:
python-version: ${{ env.python_version }}
cache: 'pip'
Expand Down
53 changes: 37 additions & 16 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,39 @@ on:
push:
branches:
- 'master'

# pull_request:
# branches:
# - 'master'
pull_request:
branches:
- 'master'

jobs:

paths-filter:
name: Filter
runs-on: ubuntu-latest

outputs:
docker: ${{ steps.filter.outputs.docker }}

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # [email protected]
- uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # [email protected]
id: filter
with:
filters: |
docker:
- .github/workflows/docker.yaml
- docker/**
- docker-compose.yml
- docker.dev.env
- Dockerfile
- requirements.txt
# Build the docker image
build:
runs-on: ubuntu-latest
needs: paths-filter
if: needs.paths-filter.outputs.docker == 'true' || github.event_name == 'release' || github.event_name == 'push'
permissions:
contents: read
packages: write
Expand All @@ -39,9 +62,9 @@ jobs:
python_version: 3.9
steps:
- name: Check out repo
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # pin@v3.1.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # pin@v4.1.1
- name: Set Up Python ${{ env.python_version }}
uses: actions/setup-python@13ae5bb136fac2878aff31522b9efb785519f984 # pin@v4.3.0
uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # pin@v4.7.1
with:
python-version: ${{ env.python_version }}
- name: Version Check
Expand All @@ -60,7 +83,6 @@ jobs:
docker-compose run inventree-dev-server invoke update
docker-compose run inventree-dev-server invoke setup-dev
docker-compose up -d
docker-compose run inventree-dev-server pip install setuptools==68.1.2
docker-compose run inventree-dev-server invoke wait
- name: Check Data Directory
# The following file structure should have been created by the docker image
Expand All @@ -82,23 +104,23 @@ jobs:
docker-compose down
- name: Set up QEMU
if: github.event_name != 'pull_request'
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # pin@v2.1.0
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # pin@v3.0.0
- name: Set up Docker Buildx
if: github.event_name != 'pull_request'
uses: docker/setup-buildx-action@95cb08cb2672c73d4ffd2f422e6d11953d2a9c70 # pin@v2.1.0
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # pin@v3.0.0
- name: Set up cosign
if: github.event_name != 'pull_request'
uses: sigstore/cosign-installer@7cc35d7fdbe70d4278a0c96779081e6fac665f88 # pin@v2.8.0
uses: sigstore/cosign-installer@11086d25041f77fe8fe7b9ea4e48e3b9192b8f19 # pin@v3.1.2
- name: Login to Dockerhub
if: github.event_name != 'pull_request'
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # pin@v2.1.0
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # pin@v3.0.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Log into registry ghcr.io
if: github.event_name != 'pull_request'
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # pin@v2
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # pin@v3.0.0
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand All @@ -107,7 +129,7 @@ jobs:
- name: Extract Docker metadata
if: github.event_name != 'pull_request'
id: meta
uses: docker/metadata-action@12cce9efe0d49980455aaaca9b071c0befcdd702 # pin@v4.1.0
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # pin@v5.0.0
with:
images: |
inventree/inventree
Expand All @@ -116,7 +138,7 @@ jobs:
- name: Build and Push
id: build-and-push
if: github.event_name != 'pull_request'
uses: docker/build-push-action@c56af957549030174b10d6867f20e78cfd7debc5 # pin@v3.2.0
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # pin@v5.0.0
with:
context: .
platforms: linux/amd64,linux/arm64
Expand All @@ -133,5 +155,4 @@ jobs:
if: ${{ false }} # github.event_name != 'pull_request'
env:
COSIGN_EXPERIMENTAL: "true"
run: cosign sign ${{ steps.meta.outputs.tags }}@${{
steps.build-and-push.outputs.digest }}
run: cosign sign ${{ steps.meta.outputs.tags }}@${{ steps.build-and-push.outputs.digest }}
Loading

0 comments on commit 0817152

Please sign in to comment.