From cdc460b16104fd21edf7d0f1eae6b2f6a4f0744a Mon Sep 17 00:00:00 2001 From: Michal Fiedorowicz Date: Wed, 16 Oct 2024 16:05:21 +0100 Subject: [PATCH 1/7] chore: update diode target (#19) Update diode target references into default diode's ingress provided via docker compose Signed-off-by: Michal Fiedorowicz --- README.md | 4 ++-- docs/entities.md | 30 +++++++++++++++--------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index cf4b941..53cac60 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ pip install netboxlabs-diode-sdk ### Example -* `target` should be the address of the Diode service, e.g. `grpc://localhost:8081` for insecure connection +* `target` should be the address of the Diode service, e.g. `grpc://localhost:8080/diode` for insecure connection or `grpcs://example.com` for secure connection. ```python @@ -39,7 +39,7 @@ from netboxlabs.diode.sdk.ingester import ( def main(): with DiodeClient( - target="grpc://localhost:8081", + target="grpc://localhost:8080/diode", app_name="my-test-app", app_version="0.0.1", ) as client: diff --git a/docs/entities.md b/docs/entities.md index 49681fc..d320391 100644 --- a/docs/entities.md +++ b/docs/entities.md @@ -33,7 +33,7 @@ from netboxlabs.diode.sdk.ingester import ( def main(): with DiodeClient( - target="grpc://localhost:8081", + target="grpc://localhost:8080/diode", app_name="my-test-app", app_version="0.0.1", ) as client: @@ -141,7 +141,7 @@ from netboxlabs.diode.sdk.ingester import ( def main(): with DiodeClient( - target="grpc://localhost:8081", + target="grpc://localhost:8080/diode", app_name="my-test-app", app_version="0.0.1", ) as client: @@ -241,7 +241,7 @@ from netboxlabs.diode.sdk.ingester import ( def main(): with DiodeClient( - target="grpc://localhost:8081", + target="grpc://localhost:8080/diode", app_name="my-test-app", app_version="0.0.1", ) as client: @@ -324,7 +324,7 @@ from netboxlabs.diode.sdk.ingester import ( def main(): with DiodeClient( - target="grpc://localhost:8081", + target="grpc://localhost:8080/diode", app_name="my-test-app", app_version="0.0.1", ) as client: @@ -399,7 +399,7 @@ from netboxlabs.diode.sdk.ingester import ( def main(): with DiodeClient( - target="grpc://localhost:8081", + target="grpc://localhost:8080/diode", app_name="my-test-app", app_version="0.0.1", ) as client: @@ -452,7 +452,7 @@ from netboxlabs.diode.sdk.ingester import ( def main(): with DiodeClient( - target="grpc://localhost:8081", + target="grpc://localhost:8080/diode", app_name="my-test-app", app_version="0.0.1", ) as client: @@ -506,7 +506,7 @@ from netboxlabs.diode.sdk.ingester import ( def main(): with DiodeClient( - target="grpc://localhost:8081", + target="grpc://localhost:8080/diode", app_name="my-test-app", app_version="0.0.1", ) as client: @@ -574,7 +574,7 @@ from netboxlabs.diode.sdk.ingester import ( def main(): with DiodeClient( - target="grpc://localhost:8081", + target="grpc://localhost:8080/diode", app_name="my-test-app", app_version="0.0.1", ) as client: @@ -679,7 +679,7 @@ from netboxlabs.diode.sdk.ingester import ( def main(): with DiodeClient( - target="grpc://localhost:8081", + target="grpc://localhost:8080/diode", app_name="my-test-app", app_version="0.0.1", ) as client: @@ -770,7 +770,7 @@ from netboxlabs.diode.sdk.ingester import ( def main(): with DiodeClient( - target="grpc://localhost:8081", + target="grpc://localhost:8080/diode", app_name="my-test-app", app_version="0.0.1", ) as client: @@ -820,7 +820,7 @@ from netboxlabs.diode.sdk.ingester import ( def main(): with DiodeClient( - target="grpc://localhost:8081", + target="grpc://localhost:8080/diode", app_name="my-test-app", app_version="0.0.1", ) as client: @@ -875,7 +875,7 @@ from netboxlabs.diode.sdk.ingester import ( def main(): with DiodeClient( - target="grpc://localhost:8081", + target="grpc://localhost:8080/diode", app_name="my-test-app", app_version="0.0.1", ) as client: @@ -987,7 +987,7 @@ from netboxlabs.diode.sdk.ingester import ( def main(): with DiodeClient( - target="grpc://localhost:8081", + target="grpc://localhost:8080/diode", app_name="my-test-app", app_version="0.0.1", ) as client: @@ -1137,7 +1137,7 @@ from netboxlabs.diode.sdk.ingester import ( def main(): with DiodeClient( - target="grpc://localhost:8081", + target="grpc://localhost:8080/diode", app_name="my-test-app", app_version="0.0.1", ) as client: @@ -1289,7 +1289,7 @@ from netboxlabs.diode.sdk.ingester import ( def main(): with DiodeClient( - target="grpc://localhost:8081", + target="grpc://localhost:8080/diode", app_name="my-test-app", app_version="0.0.1", ) as client: From 3919ceacb925fa65ef805692949bf8b33a47f080 Mon Sep 17 00:00:00 2001 From: Michal Fiedorowicz Date: Mon, 21 Oct 2024 11:31:51 +0100 Subject: [PATCH 2/7] chore: add GitHub issue templates (#20) Signed-off-by: Michal Fiedorowicz --- .../ISSUE_TEMPLATE/01-feature_request.yaml | 36 +++++++++++++ .github/ISSUE_TEMPLATE/02-bug_report.yaml | 53 +++++++++++++++++++ .../03-documentation_change.yaml | 35 ++++++++++++ .github/ISSUE_TEMPLATE/config.yaml | 1 + 4 files changed, 125 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/01-feature_request.yaml create mode 100644 .github/ISSUE_TEMPLATE/02-bug_report.yaml create mode 100644 .github/ISSUE_TEMPLATE/03-documentation_change.yaml create mode 100644 .github/ISSUE_TEMPLATE/config.yaml diff --git a/.github/ISSUE_TEMPLATE/01-feature_request.yaml b/.github/ISSUE_TEMPLATE/01-feature_request.yaml new file mode 100644 index 0000000..085b9b0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/01-feature_request.yaml @@ -0,0 +1,36 @@ +--- +name: ✨ Feature Request +description: Propose a new Diode SDK Python feature or enhancement +labels: ["enhancement", "status: needs triage"] +body: + - type: input + attributes: + label: Diode SDK Python version + description: What version of Diode SDK Python are you currently running? + placeholder: v0.4.0 + validations: + required: true + - type: dropdown + attributes: + label: Feature type + options: + - New ingestion entity type or new field of existing entity type + - New functionality + - Change to existing functionality + validations: + required: true + - type: textarea + attributes: + label: Proposed feature or enhancement + description: > + Describe in detail the new feature or enhancement you are proposing. The more detail you provide here, + the greater chance your proposal has of being discussed. + validations: + required: true + - type: textarea + attributes: + label: Use case + description: > + Explain how adding this feature or enhancement would benefit Diode users. What need does it address? + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/02-bug_report.yaml b/.github/ISSUE_TEMPLATE/02-bug_report.yaml new file mode 100644 index 0000000..6c5ad64 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/02-bug_report.yaml @@ -0,0 +1,53 @@ +--- +name: 🐛 Bug Report +description: Report a reproducible bug in the current release of Diode SDK Python +labels: ["bug", "status: needs triage"] +body: + - type: input + attributes: + label: Diode SDK Python version + description: What version of Diode SDK Python are you currently running? + placeholder: v0.4.0 + validations: + required: true + - type: input + attributes: + label: Diode version + description: What version of Diode are you currently running? + placeholder: v0.6.0 + validations: + required: true + - type: input + attributes: + label: Diode NetBox Plugin version + description: What version of Diode NetBox Plugin are you currently running? + placeholder: v0.6.0 + validations: + required: true + - type: input + attributes: + label: NetBox version + description: What version of NetBox are you currently running? + placeholder: v4.1.3 + validations: + required: true + - type: textarea + attributes: + label: Steps to reproduce + description: > + Describe in detail the exact steps that someone else can take to reproduce this bug using given Diode SDK + Python, Diode, Diode NetBox Plugin and NetBox versions. + validations: + required: true + - type: textarea + attributes: + label: Expected behavior + description: What did you expect to happen? + validations: + required: true + - type: textarea + attributes: + label: Observed behavior + description: What happened instead? + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/03-documentation_change.yaml b/.github/ISSUE_TEMPLATE/03-documentation_change.yaml new file mode 100644 index 0000000..4f34b79 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/03-documentation_change.yaml @@ -0,0 +1,35 @@ +--- +name: 📖 Documentation Change +description: Suggest an addition or modification to the Diode SDK Python documentation +labels: ["documentation", "status: needs triage"] +body: + - type: dropdown + attributes: + label: Change type + description: What type of change are you proposing? + options: + - Addition + - Correction + - Removal + - Cleanup (formatting, typos, etc.) + validations: + required: true + - type: dropdown + attributes: + label: Area + description: To what section of the documentation does this change primarily pertain? + options: + - Features + - Installation/upgrade + - Getting started + - Configuration + - Development + - Other + validations: + required: true + - type: textarea + attributes: + label: Proposed changes + description: Describe the proposed changes and why they are necessary. + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/config.yaml b/.github/ISSUE_TEMPLATE/config.yaml new file mode 100644 index 0000000..3ba13e0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yaml @@ -0,0 +1 @@ +blank_issues_enabled: false From 65e261aed51a64375df59b2af0497235c5b46cad Mon Sep 17 00:00:00 2001 From: Michal Fiedorowicz Date: Wed, 27 Nov 2024 11:22:33 +0000 Subject: [PATCH 3/7] chore: GHA release - use GITHUB_TOKEN (#27) Signed-off-by: Michal Fiedorowicz --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 9464388..25997e7 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -9,7 +9,7 @@ concurrency: cancel-in-progress: false env: - GH_TOKEN: ${{ secrets.ORB_CI_GH_TOKEN }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} SEMANTIC_RELEASE_PACKAGE: ${{ github.repository }} PYTHON_RUNTIME_VERSION: "3.11" APP_NAME: diode-sdk-python From f86f90e6ded08f9f9050b7f92e72a593f883e1e4 Mon Sep 17 00:00:00 2001 From: Michal Fiedorowicz Date: Wed, 27 Nov 2024 12:16:30 +0000 Subject: [PATCH 4/7] chore: GHA release - set permissions (#28) Signed-off-by: Michal Fiedorowicz --- .github/workflows/release.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 25997e7..3a0ec85 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -15,6 +15,10 @@ env: APP_NAME: diode-sdk-python PYTHON_PACKAGE_NAME: netboxlabs-diode-sdk +permissions: + id-token: write + contents: write + jobs: get-python-package-name: name: Get Python package name @@ -126,9 +130,6 @@ jobs: needs: [ get-python-package-name, get-next-version ] runs-on: ubuntu-latest timeout-minutes: 5 - permissions: - id-token: write - contents: read env: BUILD_VERSION: ${{ needs.get-next-version.outputs.new-release-version }} BUILD_TRACK: release From b44f07b6a6537c8a343d4b2c186df3f8a7cedb0c Mon Sep 17 00:00:00 2001 From: Arthur Hanson Date: Thu, 12 Dec 2024 02:15:39 -0800 Subject: [PATCH 5/7] chore: update grpcio version (#29) --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 44a7ff1..3388bec 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ # Optional dependencies = [ "certifi==2024.7.4", - "grpcio==1.62.1", - "grpcio-status==1.62.1", + "grpcio==1.68.1", + "grpcio-status==1.68.1", "sentry-sdk>=2.2.1", ] From 5a9fdaf6a23194b75911e732a0693f399dba98fb Mon Sep 17 00:00:00 2001 From: Michal Fiedorowicz Date: Thu, 12 Dec 2024 11:11:22 +0000 Subject: [PATCH 6/7] chore: GHA release - add missing permissions (#30) Signed-off-by: Michal Fiedorowicz --- .github/workflows/release.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 3a0ec85..328952b 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -18,6 +18,8 @@ env: permissions: id-token: write contents: write + issues: write + pull-requests: write jobs: get-python-package-name: From 45369810fa45b91e65249ef26723046d4b92f14c Mon Sep 17 00:00:00 2001 From: Michal Fiedorowicz Date: Fri, 13 Dec 2024 18:32:34 +0000 Subject: [PATCH 7/7] fix: use build semantic version (#32) Signed-off-by: Michal Fiedorowicz --- netboxlabs/diode/sdk/client.py | 3 ++- tests/test_client.py | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/netboxlabs/diode/sdk/client.py b/netboxlabs/diode/sdk/client.py index c62bae6..44049c8 100644 --- a/netboxlabs/diode/sdk/client.py +++ b/netboxlabs/diode/sdk/client.py @@ -16,6 +16,7 @@ from netboxlabs.diode.sdk.diode.v1 import ingester_pb2, ingester_pb2_grpc from netboxlabs.diode.sdk.exceptions import DiodeClientError, DiodeConfigError from netboxlabs.diode.sdk.ingester import Entity +from netboxlabs.diode.sdk.version import version_semver _DIODE_API_KEY_ENVVAR_NAME = "DIODE_API_KEY" _DIODE_SDK_LOG_LEVEL_ENVVAR_NAME = "DIODE_SDK_LOG_LEVEL" @@ -69,7 +70,7 @@ class DiodeClient: """Diode Client.""" _name = "diode-sdk-python" - _version = "0.0.1" + _version = version_semver() _app_name = None _app_version = None _channel = None diff --git a/tests/test_client.py b/tests/test_client.py index f1d6596..02a319c 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -19,6 +19,7 @@ parse_target, ) from netboxlabs.diode.sdk.exceptions import DiodeClientError, DiodeConfigError +from netboxlabs.diode.sdk.version import version_semver def test_init(): @@ -31,7 +32,7 @@ def test_init(): ) assert config.target == "localhost:8081" assert config.name == "diode-sdk-python" - assert config.version == "0.0.1" + assert config.version == version_semver() assert config.app_name == "my-producer" assert config.app_version == "0.0.1" assert config.tls_verify is False @@ -370,7 +371,7 @@ def test_client_properties_return_expected_values(): api_key="abcde", ) assert client.name == "diode-sdk-python" - assert client.version == "0.0.1" + assert client.version == version_semver() assert client.target == "localhost:8081" assert client.path == "" assert client.tls_verify is False