community[patch]: Add support for pebblo server and client version (#20269)

**Description**:
_PebbloSafeLoader_: Add support for pebblo server and client version


**Documentation:** NA
**Unit test:** NA
**Issue:** NA
**Dependencies:**  None

---------

Co-authored-by: Bagatur <22008038+baskaryan@users.noreply.github.com>
pull/20075/head^2
Dristy Srivastava 3 weeks ago committed by GitHub
parent b54b19ba1c
commit 5f1d1666e3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -287,6 +287,7 @@ class PebbloSafeLoader(BaseLoader):
def _send_discover(self) -> None:
"""Send app discovery payload to pebblo-server. Internal method."""
pebblo_resp = None
headers = {
"Accept": "application/json",
"Content-Type": "application/json",
@ -326,6 +327,18 @@ class PebbloSafeLoader(BaseLoader):
if self.api_key:
try:
headers.update({"x-api-key": self.api_key})
if pebblo_resp:
pebblo_resp_docs = json.loads(pebblo_resp.text).get("docs")
payload.update(
{
"pebbloServerVersion": pebblo_resp_docs.get(
"pebbloServerVersion"
),
"pebbloClientVersion": pebblo_resp_docs.get(
"pebbloClientVersion"
),
}
)
pebblo_cloud_url = f"{PEBBLO_CLOUD_URL}{APP_DISCOVER_URL}"
pebblo_cloud_response = requests.post(
pebblo_cloud_url, headers=headers, json=payload, timeout=20

Loading…
Cancel
Save