Skip to content

Commit b57af14

Browse files
committed
feat: release changes for version 0.4.12
1 parent ffaa207 commit b57af14

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ resources:
218218
repository:
219219
value: '"gitlab_repo_" + (.context.repository.id | split("/") | last)'
220220
triggeredBy:
221-
value: '"gitlab_user_" + (.node.triggerer.id | split("/") | last)'
221+
value: 'if .node.triggerer.id? then "gitlab_user_" + (.node.triggerer.id | split("/") | last) else null end'
222222
pipeline:
223223
value: '"gitlab_pipeline_" + (.node.job.pipeline.id | split("/") | last)'
224224
environment:

galaxy/integrations/gitlab/main.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import re
22
from types import TracebackType
3+
from enum import Enum
34

45
from galaxy.core.galaxy import Integration, register
56
from galaxy.core.models import Config
@@ -20,6 +21,12 @@
2021
DEFAULT_BRANCH_NAME: str = "main"
2122

2223

24+
class FileCheckStatus(Enum):
25+
FILE_FOUND = "FILE_FOUND"
26+
FILE_NOT_FOUND = "FILE_NOT_FOUND"
27+
FILE_FOUND_NO_MATCH = "FILE_FOUND_NO_MATCH"
28+
29+
2330
class Gitlab(Integration):
2431
_methods = []
2532
# Default Group for previous members of the organization
@@ -117,10 +124,15 @@ async def get_repo_files(self, repo_full_path: str) -> dict:
117124
for file_check in self.repo_files_to_check:
118125
file = await self.client.get_file(repo_full_path, file_check["path"])
119126
if file:
120-
result = re.search(file_check["regex"], file["content"]) if file_check["regex"] else None
121-
repo_file_checks[file_check["destination"]] = result
127+
if file_check["regex"]:
128+
result = re.search(file_check["regex"], file["content"]) if file_check["regex"] else None
129+
repo_file_checks[file_check["destination"]] = (
130+
result.group(1) if result else FileCheckStatus.FILE_FOUND_NO_MATCH
131+
)
132+
else:
133+
repo_file_checks[file_check["destination"]] = FileCheckStatus.FILE_FOUND
122134
else:
123-
repo_file_checks[file_check["destination"]] = False
135+
repo_file_checks[file_check["destination"]] = FileCheckStatus.FILE_NOT_FOUND
124136

125137
return repo_file_checks
126138

0 commit comments

Comments
 (0)