diff --git a/pyproject.toml b/pyproject.toml index ace3985..dbb860e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "pysnyk" -version = "0.9.9" +version = "0.9.10" description = "A Python client for the Snyk API" authors = [ "Gareth Rushgrove ", diff --git a/snyk/managers.py b/snyk/managers.py index 4a6565e..972b880 100644 --- a/snyk/managers.py +++ b/snyk/managers.py @@ -1,4 +1,5 @@ import abc +import json from typing import Any, Dict, List from deprecation import deprecated # type: ignore @@ -143,7 +144,13 @@ def _rest_to_v1_response_format(self, project): settings = attributes.get("settings", {}) recurring_tests = settings.get("recurring_tests", {}) issue_counts = project.get("meta", {}).get("latest_issue_counts") - + remote_repo_url = ( + project.get("relationships", {}) + .get("target", {}) + .get("data", {}) + .get("attributes", {}) + .get("url") + ) return { "name": attributes.get("name"), "id": project.get("id"), @@ -161,6 +168,7 @@ def _rest_to_v1_response_format(self, project): }, "targetReference": attributes.get("target_reference"), "branch": attributes.get("target_reference"), + "remoteRepoUrl": remote_repo_url, "_tags": attributes.get("tags", []), "importingUserId": project.get("relationships", {}) .get("importer", {}) @@ -189,6 +197,7 @@ def _query(self, tags: List[Dict[str, str]] = [], next_url: str = None): # Append the issue count param to the params if this is the first page if not next_url: params["meta.latest_issue_counts"] = "true" + params["expand"] = "target" # And lastly, make the API call resp = self.client.get(