Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/ISSUE_TEMPLATE/01-feature_request.yaml
Original file line number Diff line number Diff line change
@@ -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
53 changes: 53 additions & 0 deletions .github/ISSUE_TEMPLATE/02-bug_report.yaml
Original file line number Diff line number Diff line change
@@ -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
35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE/03-documentation_change.yaml
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
11 changes: 7 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,18 @@ 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
PYTHON_PACKAGE_NAME: netboxlabs-diode-sdk

permissions:
id-token: write
contents: write
issues: write
pull-requests: write

jobs:
get-python-package-name:
name: Get Python package name
Expand Down Expand Up @@ -126,9 +132,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
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
30 changes: 15 additions & 15 deletions docs/entities.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion netboxlabs/diode/sdk/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]

Expand Down
5 changes: 3 additions & 2 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading