-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
210 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
config/clients/python/template/.github/ISSUE_TEMPLATE/bug_report.md.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
--- | ||
name: Report an issue | ||
about: Create a bug report about an existing issue. | ||
title: '' | ||
labels: 'bug' | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Please do not report security vulnerabilities here**. See the [Responsible Disclosure Program](https://{{gitHost}}/{{gitUserId}}/{{gitRepoId}}/blob/main/.github/SECURITY.md). | ||
|
||
**Thank you in advance for helping us to improve this library!** Please read through the template below and answer all relevant questions. Your additional work here is greatly appreciated and will help us respond as quickly as possible. | ||
|
||
By submitting an issue to this repository, you agree to the terms within the [{{appName}} Code of Conduct](https://{{gitHost}}/{{gitUserId}}/rfcs/blob/main/CODE-OF-CONDUCT.md). | ||
|
||
### Description | ||
|
||
> Provide a clear and concise description of the issue, including what you expected to happen. | ||
|
||
### Version of SDK | ||
|
||
``` | ||
$ python -m openfga_sdk.help | ||
<paste here> | ||
``` | ||
|
||
This command is only available on openfga_sdk `v0.3.2` and greater. Otherwise, please provide some basic information about your system. | ||
|
||
### Version of OpenFGA (if known) | ||
|
||
> v1.1.0 | ||
|
||
### OpenFGA Flags/Custom Configuration Applicable | ||
|
||
> environment: | ||
> - OPENFGA_DATASTORE_ENGINE=postgres | ||
> - OPENFGA_DATASTORE_URI=postgres://postgres:password@postgres:5432/postgres?sslmode=disable | ||
> - OPENFGA_TRACE_ENABLED=true | ||
> - OPENFGA_TRACE_SAMPLE_RATIO=1 | ||
> - OPENFGA_TRACE_OTLP_ENDPOINT=otel-collector:4317 | ||
> - OPENFGA_METRICS_ENABLE_RPC_HISTOGRAMS=true | ||
|
||
### Reproduction | ||
|
||
> Detail the steps taken to reproduce this error, what was expected, and whether this issue can be reproduced consistently or if it is intermittent. | ||
> | ||
> 1. Initialize OpenFgaClient with openfga_sdk.ClientConfiguration parameter api_host=127.0.0.1, credentials method client_credentials | ||
> 2. Invoke method read_authorization_models | ||
> 3. See exception thrown | ||
|
||
### Sample Code the Produces Issues | ||
|
||
> | ||
> ``` | ||
> <code snippet> | ||
> ``` | ||
|
||
### Backtrace (if applicable) | ||
|
||
> ``` | ||
> <backtrace> | ||
> ``` | ||
|
||
|
||
### Expected behavior | ||
> A clear and concise description of what you expected to happen. | ||
|
||
### Additional context | ||
> Add any other context about the problem here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
import json | ||
import platform | ||
import sys | ||
from typing import Dict | ||
from collections import OrderedDict | ||
|
||
from . import __version__ as openfga_sdk_version | ||
|
||
try: | ||
import urllib3 | ||
|
||
urllib3_version = urllib3.__version__ | ||
except ModuleNotFoundError: | ||
urllib3_version = "" | ||
|
||
try: | ||
import six | ||
|
||
six_version = six.__version__ | ||
except ModuleNotFoundError: | ||
six_version = "" | ||
|
||
try: | ||
import dateutil | ||
|
||
dateutil_version = dateutil.__version__ | ||
except ModuleNotFoundError: | ||
dateutil_version = "" | ||
|
||
try: | ||
import aiohttp | ||
|
||
aiohttp_version = aiohttp.__version__ | ||
except ModuleNotFoundError: | ||
aiohttp_version = "" | ||
|
||
|
||
def info() -> Dict[str, Dict[str, str]]: | ||
""" | ||
Generate information for a bug report. | ||
Based on the requests package help utility module. | ||
""" | ||
try: | ||
platform_info = { | ||
"system": platform.system(), | ||
"release": platform.release(), | ||
} | ||
except OSError: | ||
platform_info = {"system": "Unknown", "release": "Unknown"} | ||
|
||
implementation = platform.python_implementation() | ||
|
||
if implementation == "CPython": | ||
implementation_version = platform.python_version() | ||
elif implementation == "PyPy": | ||
pypy_version_info = sys.pypy_version_info # type: ignore[attr-defined] | ||
implementation_version = ( | ||
f"{pypy_version_info.major}." | ||
f"{pypy_version_info.minor}." | ||
f"{pypy_version_info.micro}" | ||
) | ||
if pypy_version_info.releaselevel != "final": | ||
implementation_version = "".join( | ||
[implementation_version, pypy_version_info.releaselevel] | ||
) | ||
else: | ||
implementation_version = "Unknown" | ||
|
||
return OrderedDict( | ||
{ | ||
"platform": platform_info, | ||
"implementation": { | ||
"name": implementation, | ||
"version": implementation_version, | ||
}, | ||
"openfga_sdk": {"version": openfga_sdk_version}, | ||
"dependencies": { | ||
"urllib3": {"version": urllib3_version}, | ||
"six": {"version": six_version}, | ||
"python-dateutil": {"version": dateutil_version}, | ||
"aiohttp": {"version": aiohttp_version}, | ||
}, | ||
} | ||
) | ||
|
||
|
||
def main() -> None: | ||
"""Pretty-print the bug information as JSON.""" | ||
print(json.dumps(info(), indent=2)) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
six >= 1.16 | ||
setuptools >= 69.0.2 | ||
setuptools >= 67.7.2 | ||
python-dateutil >= 2.8.2 | ||
urllib3 >= 1.25.11 | ||
aiohttp >= 3.9.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters