Skip to content

Commit 6cac196

Browse files
committed
feat Updating the overall project CI/CD and openapi-generator dependencies
Signed-off-by: S3B4SZ17 <[email protected]>
1 parent e9b0d33 commit 6cac196

File tree

1,862 files changed

+45138
-45976
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,862 files changed

+45138
-45976
lines changed

.flake8

Lines changed: 0 additions & 6 deletions
This file was deleted.

.github/workflows/ci-master-scheduled.yml renamed to .github/workflows/ci-master-scheduled.yaml

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -20,35 +20,25 @@ jobs:
2020
- "3.11"
2121
runs-on: ubuntu-latest
2222
steps:
23-
- uses: actions/checkout@v3
23+
- uses: actions/checkout@v4
2424

25-
- uses: actions/setup-python@v4
25+
- name: Setup python
26+
uses: actions/setup-python@v5
2627
with:
27-
python-version: ${{ matrix.python_version }}
28+
python-version: "${{ matrix.python_version }}"
2829

29-
- name: Install Poetry
30-
run: python -m pip install poetry poetry-dynamic-versioning
31-
32-
- uses: actions/cache@v3
33-
name: Cache Poetry dependencies
30+
- name: Install uv
31+
uses: astral-sh/setup-uv@v6
3432
with:
35-
path: |
36-
~/.cache
37-
~/.local/share/virtualenvs/
38-
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
39-
restore-keys: |
40-
${{ runner.os }}-poetry-
41-
42-
- name: Get dependencies
43-
run: poetry install
33+
python-version: "${{ matrix.python_version }}"
34+
enable-cache: true
35+
version: "0.8.7"
4436

4537
- name: Lint
4638
continue-on-error: true
4739
run: |
4840
# stop the build if there are Python syntax errors or undefined names
49-
poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
50-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
51-
poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
41+
uvx ruff check . --fix --select=E9,F63,F7,F82 --statistics --config ruff.toml --exclude specs
5242
5343
- name: Travis Test - Start agent
5444
id: start_agent
@@ -59,11 +49,6 @@ jobs:
5949
sudo apt-get install linux-headers-$(uname -r) dkms gcc-multilib g++-multilib
6050
./test/start_agent.sh
6151
62-
- name: Travis Test - Install dependencies
63-
run: |
64-
poetry build
65-
python -m pip install $(find dist -iname "*.whl" | head -1)
66-
6752
- name: Travis Test - Secure APIs
6853
env:
6954
PYTHON_SDC_TEST_API_TOKEN: ${{ secrets.STAGING_SECURE_API_TOKEN }}
@@ -75,7 +60,7 @@ jobs:
7560
SDC_SECURE_TOKEN: ${{ secrets.STAGING_SECURE_API_TOKEN }}
7661
SDC_MONITOR_URL: "https://app-staging.sysdigcloud.com"
7762
SDC_SECURE_URL: "https://secure-staging.sysdig.com"
78-
run: poetry run mamba -f documentation
63+
run: uv run -- mamba -f documentation
7964

8065
- name: Travis Test - Stop agent
8166
run: ./test/stop_agent.sh

.github/workflows/ci-pull-request.yml renamed to .github/workflows/ci-pull-request.yaml

Lines changed: 23 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -15,54 +15,42 @@ jobs:
1515
matrix:
1616
python_version:
1717
# https://python-release-cycle.glitch.me/
18-
- "3.7"
19-
- "3.8"
2018
- "3.9"
2119
- "3.10"
2220
- "3.11"
2321
runs-on: ubuntu-latest
2422
steps:
25-
- uses: actions/checkout@v3
23+
- uses: actions/checkout@v4
2624

27-
- uses: actions/setup-python@v4
25+
- name: Setup python
26+
uses: actions/setup-python@v5
2827
with:
29-
python-version: ${{ matrix.python_version }}
28+
python-version: "${{ matrix.python_version }}"
3029

31-
- name: Install Poetry
32-
run: python -m pip install poetry poetry-dynamic-versioning
33-
34-
- uses: actions/cache@v3
35-
name: Cache Poetry dependencies
30+
- name: Install uv
31+
uses: astral-sh/setup-uv@v6
3632
with:
37-
path: |
38-
~/.cache
39-
~/.local/share/virtualenvs/
40-
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
41-
restore-keys: |
42-
${{ runner.os }}-poetry-
43-
44-
- name: Get dependencies
45-
run: poetry install
33+
python-version: "${{ matrix.python_version }}"
34+
enable-cache: true
35+
version: "0.8.7"
4636

4737
- name: Lint
4838
run: |
49-
# stop the build if there are Python syntax errors or undefined names
50-
poetry run flake8
5139
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
52-
poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
40+
uvx ruff check . --fix --select=E9,F63,F7,F82 --statistics --config ruff.toml --exclude specs
5341
5442
- name: Test in staging
5543
env:
5644
SDC_MONITOR_TOKEN: ${{ secrets.STAGING_MONITOR_API_TOKEN }}
5745
SDC_SECURE_TOKEN: ${{ secrets.STAGING_SECURE_API_TOKEN }}
5846
SDC_MONITOR_URL: "https://app-staging.sysdigcloud.com"
5947
SDC_SECURE_URL: "https://secure-staging.sysdig.com"
60-
run: poetry run mamba -f documentation -t integration
48+
run: uv run -- mamba -f documentation -t integration
6149

6250
test-release:
6351
runs-on: ubuntu-latest
64-
steps:
65-
- uses: actions/checkout@v3
52+
steps:
53+
- uses: actions/checkout@v4
6654
with:
6755
fetch-depth: 0
6856

@@ -79,15 +67,17 @@ jobs:
7967
- name: Generate changelog
8068
run: git-chglog -c .github/git-chglog/config.yml -o RELEASE_CHANGELOG.md $(git describe --tags $(git rev-list --tags --max-count=1))
8169

82-
- name: Set up Python
83-
uses: actions/setup-python@v4
70+
- name: Setup python
71+
uses: actions/setup-python@v5
8472
with:
85-
python-version: 3.8
73+
python-version: "3.10"
8674

87-
- name: Install dependencies
88-
run: |
89-
python -m pip install --upgrade pip
90-
pip install poetry poetry-dynamic-versioning
75+
- name: Install uv
76+
uses: astral-sh/setup-uv@v6
77+
with:
78+
python-version: "3.10"
79+
enable-cache: true
80+
version: "0.8.7"
9181

9282
- name: Build
93-
run: poetry build
83+
run: uv build

.github/workflows/codeql-analysis.yml renamed to .github/workflows/codeql-analysis.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030

3131
steps:
3232
- name: Checkout repository
33-
uses: actions/checkout@v3
33+
uses: actions/checkout@v4
3434
with:
3535
# We must fetch at least the immediate parents so that if this is
3636
# a pull request then we can checkout the head.
@@ -47,7 +47,7 @@ jobs:
4747
with:
4848
languages: ${{ matrix.language }}
4949
# If you wish to specify custom queries, you can do so here or in a config file.
50-
# By default, queries listed here will override any specified in a config file.
50+
# By default, queries listed here will override any specified in a config file.
5151
# Prefix the list here with "+" to use these queries and those in the config file.
5252
# queries: ./path/to/local/query, your-org/your-repo/queries@main
5353

.github/workflows/python.yaml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# NOTE: This file is auto generated by OpenAPI Generator.
2+
# URL: https://openapi-generator.tech
3+
#
4+
# ref: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
5+
6+
name: sysdig_client Python package
7+
8+
on:
9+
push:
10+
pull_request:
11+
workflow_call:
12+
workflow_dispatch:
13+
14+
jobs:
15+
build:
16+
17+
runs-on: ubuntu-latest
18+
strategy:
19+
matrix:
20+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
21+
max-parallel: 5
22+
23+
steps:
24+
- uses: actions/checkout@v4
25+
26+
- name: Set up Python ${{ matrix.python-version }}
27+
uses: actions/setup-python@v5
28+
with:
29+
python-version: ${{ matrix.python-version }}
30+
31+
- name: Install uv
32+
uses: astral-sh/setup-uv@v6
33+
with:
34+
python-version: "${{ matrix.python-version }}"
35+
enable-cache: true
36+
version: "0.8.7"
37+
38+
- name: Download dependencies
39+
run: make init
40+
41+
- name: Run ruff check
42+
run: uvx ruff check . --fix --select=E9,F63,F7,F82 --statistics --config ruff.toml --exclude specs
43+
44+
- name: Run Tests
45+
run: make test-all
46+
47+
check_version:
48+
name: Check Version
49+
runs-on: ubuntu-latest
50+
needs: build
51+
permissions:
52+
contents: write # required for creating a tag
53+
steps:
54+
- name: Check out repository
55+
uses: actions/checkout@v4
56+
with:
57+
ref: ${{ github.sha }} # required for better experience using pre-releases
58+
fetch-depth: '0' # Required due to the way Git works, without it this action won't be able to find any or the correct tags
59+
60+
- name: Extract current version
61+
id: pyproject_version
62+
run: |
63+
TAG=v$(grep 'version =' pyproject.toml | sed -e 's/version = "\(.*\)"/\1/')
64+
echo "TAG=$TAG" >> "$GITHUB_OUTPUT"
65+
66+
- name: Get branch ref name
67+
id: branch_ref
68+
run: |
69+
BRANCH_NAME=${{ github.base_ref || github.ref_name }}
70+
echo "$BRANCH_NAME"
71+
echo "BRANCH_NAME=$BRANCH_NAME" >> "$GITHUB_OUTPUT"
72+
73+
- name: Get tag version
74+
id: semantic_release
75+
uses: anothrNick/[email protected]
76+
env:
77+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
78+
DEFAULT_BUMP: "patch"
79+
TAG_CONTEXT: 'repo'
80+
WITH_V: true
81+
DRY_RUN: true
82+
83+
- name: Compare versions
84+
run: |
85+
echo "Current version: ${{ steps.pyproject_version.outputs.TAG }}"
86+
echo "New version: ${{ steps.semantic_release.outputs.tag }}"
87+
if [ "${{ steps.pyproject_version.outputs.TAG }}" != "${{ steps.semantic_release.outputs.tag }}" ]; then
88+
echo "### Version mismatch detected! :warning:
89+
Current pyproject version: ${{ steps.pyproject_version.outputs.TAG }}
90+
New Tag version: **${{ steps.semantic_release.outputs.tag }}**
91+
Current Tag: ${{ steps.semantic_release.outputs.old_tag }}
92+
Please update the version in pyproject.toml." >> $GITHUB_STEP_SUMMARY
93+
exit 1
94+
else
95+
echo "### Version match confirmed! :rocket:
96+
Current pyproject version: ${{ steps.pyproject_version.outputs.TAG }}
97+
New Tag version: **${{ steps.semantic_release.outputs.tag }}**
98+
The version is up-to-date." >> $GITHUB_STEP_SUMMARY
99+
fi

.github/workflows/python.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

.github/workflows/release.yml renamed to .github/workflows/release.yaml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
upload_url: ${{ steps.create_release.outputs.upload_url }}
1313

1414
steps:
15-
- uses: actions/checkout@v3
15+
- uses: actions/checkout@v4
1616
with:
1717
fetch-depth: 0
1818

@@ -52,10 +52,14 @@ jobs:
5252
with:
5353
python-version: 3.10
5454

55-
- name: Install dependencies
56-
run: |
57-
python -m pip install --upgrade pip
58-
pip install poetry poetry-dynamic-versioning
55+
- name: Install uv
56+
uses: astral-sh/setup-uv@v6
57+
with:
58+
python-version: 3.10
59+
enable-cache: true
60+
version: "0.8.7"
5961

6062
- name: Build and publish
61-
run: poetry publish --build -u ${{ secrets.PYPI_USER }} -p ${{ secrets.PYPI_PASSWORD }}
63+
run: |
64+
uv build
65+
uv publish -u ${{ secrets.PYPI_USER }} -p ${{ secrets.PYPI_PASSWORD }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ venv/
4848
.venv/
4949
.python-version
5050
.pytest_cache
51+
pytest.xml
5152

5253
# Translations
5354
*.mo

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "api-spec"]
2+
path = api-spec
3+
url = [email protected]:draios/api-spec.git@0d4b5a9fb72b1bb2275878f0b46ec1cba3ee91a4

.openapi-generator-ignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@
1515
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
1616
#foo/**/qux
1717
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18+
.gitlab-ci.yml
19+
.travis.yml
20+
git_push.sh
21+
requirements.txt
22+
setup.cfg
23+
setup.py
24+
test-requirements.txt
25+
tox.ini
26+
pyproject.toml
1827

1928
# You can also negate patterns with an exclamation (!).
2029
# For example, you can ignore all files in a docs folder with the file extension .md:

0 commit comments

Comments
 (0)