Skip to content

Commit cc9ef48

Browse files
feat: release changes for version 0.4.7
1 parent 99c5d46 commit cc9ef48

File tree

6 files changed

+42
-33
lines changed

6 files changed

+42
-33
lines changed

galaxy/integrations/gcp/.rely/blueprints.json

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@
8585
},
8686
"relations": {
8787
"project": {
88-
"value": "gcp.v1.cloudresourcemanager_project",
89-
"title": "Project",
90-
"description": "The project this App Engine application belongs to"
88+
"value": "gcp.v1.cloudresourcemanager_project",
89+
"title": "Project",
90+
"description": "The project this App Engine application belongs to"
9191
}
9292
}
9393
},
@@ -177,9 +177,9 @@
177177
},
178178
"relations": {
179179
"project": {
180-
"value": "gcp.v1.cloudresourcemanager_project",
181-
"title": "Project",
182-
"description": "The project this Cloud Run function belongs to"
180+
"value": "gcp.v1.cloudresourcemanager_project",
181+
"title": "Project",
182+
"description": "The project this Cloud Run function belongs to"
183183
}
184184
}
185185
},
@@ -217,14 +217,14 @@
217217
},
218218
"relations": {
219219
"folder": {
220-
"value": "gcp.v1.cloudresourcemanager_folder",
221-
"title": "Folder",
222-
"description": "The parent folder this folder is contained in"
220+
"value": "gcp.v1.cloudresourcemanager_folder",
221+
"title": "Folder",
222+
"description": "The parent folder this folder is contained in"
223223
},
224224
"organization": {
225-
"value": "gcp.v1.cloudresourcemanager_organization",
226-
"title": "Organization",
227-
"description": "The organization this folder belongs to"
225+
"value": "gcp.v1.cloudresourcemanager_organization",
226+
"title": "Organization",
227+
"description": "The organization this folder belongs to"
228228
}
229229
}
230230
},
@@ -285,14 +285,14 @@
285285
},
286286
"relations": {
287287
"folder": {
288-
"value": "gcp.v1.cloudresourcemanager_folder",
289-
"title": "Folder",
290-
"description": "The folder this project is contained in"
288+
"value": "gcp.v1.cloudresourcemanager_folder",
289+
"title": "Folder",
290+
"description": "The folder this project is contained in"
291291
},
292292
"organization": {
293-
"value": "gcp.v1.cloudresourcemanager_organization",
294-
"title": "Organization",
295-
"description": "The organization this project belongs to"
293+
"value": "gcp.v1.cloudresourcemanager_organization",
294+
"title": "Organization",
295+
"description": "The organization this project belongs to"
296296
}
297297
}
298298
},
@@ -387,9 +387,9 @@
387387
},
388388
"relations": {
389389
"project": {
390-
"value": "gcp.v1.cloudresourcemanager_project",
391-
"title": "Project",
392-
"description": "The project this Kubernetes Engine cluster belongs to"
390+
"value": "gcp.v1.cloudresourcemanager_project",
391+
"title": "Project",
392+
"description": "The project this Kubernetes Engine cluster belongs to"
393393
}
394394
}
395395
},
@@ -464,9 +464,9 @@
464464
},
465465
"relations": {
466466
"project": {
467-
"value": "gcp.v1.cloudresourcemanager_project",
468-
"title": "Project",
469-
"description": "The project this Cloud SQL instance belongs to"
467+
"value": "gcp.v1.cloudresourcemanager_project",
468+
"title": "Project",
469+
"description": "The project this Cloud SQL instance belongs to"
470470
}
471471
}
472472
}

galaxy/integrations/gitlab/.rely/mappings.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ resources:
2626
openMergeRequestsCount: .openMergeRequestsCount
2727
languages: '[.languages[].name]'
2828
starCount: .starCount
29-
defaultBranch: .repository.rootRef
29+
defaultBranch: '.repository.rootRef // "main"'
3030
updatedAt: .updatedAt
31-
readmeUrl: 'if .repository.blobs.nodes | length > 0 then .webUrl + "/-/blob/" + .repository.rootRef + "/" + .repository.blobs.nodes[0].path else "" end'
31+
readmeUrl: 'if .repository.blobs.nodes | length > 0 then .webUrl + "/-/blob/" + (.repository.rootRef // "main") + "/" + .repository.blobs.nodes[0].path else "" end'
3232
readme: 'if .repository.blobs.nodes | length > 0 then .repository.blobs.nodes[0].rawBlob else "" end'
3333
defaultBranchRequiredReviews: .requiredReviews["default"]
3434
allBranchesRequiredReviews: .requiredReviews["All branches"]

galaxy/integrations/gitlab/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ async def repository_metrics(self) -> list[dict]:
294294
all_metrics = []
295295
for repo in self.repositories.values():
296296
project_id = repo["id"].split("/")[-1]
297-
commits = await self.client.get_commits(project_id, branch=repo["repository"]["rootRef"])
297+
commits = await self.client.get_commits(project_id, branch=repo["repository"].get("rootRef", "main"))
298298
repository_metrics = await self.mapper.process(
299299
"repository_metrics", [{"commits": commits}], context={"repository": repo}
300300
)

galaxy/integrations/snyk/client.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from logging import Logger
44
from types import TracebackType
55
from typing import Any
6+
from datetime import datetime
67

78
from galaxy.core.models import Config
89
from galaxy.utils.requests import ClientSession, create_session, make_request
@@ -78,7 +79,8 @@ async def get_projects(self, org_id: str, target_id: str) -> list[dict]:
7879
f"/rest/orgs/{org_id}/projects", params={"target_id": [target_id], "meta.latest_issue_counts": "true"}
7980
)
8081

81-
async def get_issues(self, org_id: str, project_id: str) -> list[dict]:
82-
return await self._fetch_list_data(
83-
f"/rest/orgs/{org_id}/issues", params={"scan_item.type": "project", "scan_item.id": project_id}
84-
)
82+
async def get_issues(self, org_id: str, project_id: str, history_start_date: datetime = None) -> list[dict]:
83+
params = {"scan_item.type": "project", "scan_item.id": project_id}
84+
if history_start_date is not None:
85+
params["created_after"] = history_start_date.strftime("%Y-%m-%dT%H:%M:%S.%f")[:-3] + "Z"
86+
return await self._fetch_list_data(f"/rest/orgs/{org_id}/issues", params=params)

galaxy/integrations/snyk/config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ integration:
1515
properties:
1616
apiToken: "{{ env('RELY_INTEGRATION_SNYK_TOKEN') | default('', true) }}"
1717
region: "{{ env('RELY_INTEGRATION_SNYK_REGION') | default('', true) }}"
18+
daysOfHistory: "{{ env('DAYS_OF_HISTORY') | default(30, true) | int }}"

galaxy/integrations/snyk/main.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from datetime import datetime, timedelta
12
from types import TracebackType
23
from typing import Any
34

@@ -75,14 +76,19 @@ async def issues(self) -> tuple[Any]:
7576
for item in self._all_projects
7677
]
7778

79+
history_start_date = datetime.now() - timedelta(days=int(self.config.integration.properties["daysOfHistory"]))
80+
7881
mapped_issues = []
7982
for org_id, target_id, project_id in organization_target_project_triples:
80-
raw_issues = await self.client.get_issues(org_id, project_id)
83+
raw_issues = await self.client.get_issues(org_id, project_id, history_start_date)
8184
project_issues = await self.mapper.process(
8285
"issue", raw_issues, context={"target_id": target_id, "organization_slug": self._organizations[org_id]}
8386
)
8487
mapped_issues.extend(project_issues)
8588

86-
self.logger.debug("Found %d issues", len(mapped_issues))
89+
self.logger.debug(
90+
"Found %d issues from the last %s days",
91+
(len(mapped_issues), self.config.integration.properties["daysOfHistory"]),
92+
)
8793

8894
return mapped_issues

0 commit comments

Comments
 (0)