Skip to content

Commit

Permalink
feat: release changes for version 0.4.12
Browse files Browse the repository at this point in the history
  • Loading branch information
DeXtroTip committed Dec 10, 2024
1 parent ffaa207 commit b57af14
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion galaxy/integrations/gitlab/.rely/mappings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ resources:
repository:
value: '"gitlab_repo_" + (.context.repository.id | split("/") | last)'
triggeredBy:
value: '"gitlab_user_" + (.node.triggerer.id | split("/") | last)'
value: 'if .node.triggerer.id? then "gitlab_user_" + (.node.triggerer.id | split("/") | last) else null end'
pipeline:
value: '"gitlab_pipeline_" + (.node.job.pipeline.id | split("/") | last)'
environment:
Expand Down
18 changes: 15 additions & 3 deletions galaxy/integrations/gitlab/main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import re
from types import TracebackType
from enum import Enum

from galaxy.core.galaxy import Integration, register
from galaxy.core.models import Config
Expand All @@ -20,6 +21,12 @@
DEFAULT_BRANCH_NAME: str = "main"


class FileCheckStatus(Enum):
FILE_FOUND = "FILE_FOUND"
FILE_NOT_FOUND = "FILE_NOT_FOUND"
FILE_FOUND_NO_MATCH = "FILE_FOUND_NO_MATCH"


class Gitlab(Integration):
_methods = []
# Default Group for previous members of the organization
Expand Down Expand Up @@ -117,10 +124,15 @@ async def get_repo_files(self, repo_full_path: str) -> dict:
for file_check in self.repo_files_to_check:
file = await self.client.get_file(repo_full_path, file_check["path"])
if file:
result = re.search(file_check["regex"], file["content"]) if file_check["regex"] else None
repo_file_checks[file_check["destination"]] = result
if file_check["regex"]:
result = re.search(file_check["regex"], file["content"]) if file_check["regex"] else None
repo_file_checks[file_check["destination"]] = (
result.group(1) if result else FileCheckStatus.FILE_FOUND_NO_MATCH
)
else:
repo_file_checks[file_check["destination"]] = FileCheckStatus.FILE_FOUND
else:
repo_file_checks[file_check["destination"]] = False
repo_file_checks[file_check["destination"]] = FileCheckStatus.FILE_NOT_FOUND

return repo_file_checks

Expand Down

0 comments on commit b57af14

Please sign in to comment.