From ca4e43acac64355d082cca53ec573676e36cb815 Mon Sep 17 00:00:00 2001 From: Alex Terehov Date: Tue, 14 Jul 2026 12:52:21 -0230 Subject: [PATCH 1/2] Allow overwriting content name on download --- Apps.GitLab/Actions/RepositoryActions.cs | 7 ++++++- Apps.GitLab/Apps.GitLab.csproj | 2 +- .../Models/Respository/Requests/GetFileRequest.cs | 3 +++ Apps.GitLab/Utils/File/FileHelper.cs | 11 ++++++++--- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/Apps.GitLab/Actions/RepositoryActions.cs b/Apps.GitLab/Actions/RepositoryActions.cs index 4e8d8ac..b7c6486 100644 --- a/Apps.GitLab/Actions/RepositoryActions.cs +++ b/Apps.GitLab/Actions/RepositoryActions.cs @@ -60,7 +60,12 @@ public async Task GetFile( repository.WebUrl, branch, RestClient.BaseUrl); - var fileData = FileHelper.ProcessDownloadedFile(fileToProcess, InvocationContext.Logger, getFileRequest.LanguageCode, getFileRequest.ContentId); + var fileData = FileHelper.ProcessDownloadedFile( + fileToProcess, + InvocationContext.Logger, + getFileRequest.LanguageCode, + getFileRequest.ContentId, + getFileRequest.ContentName); var fileReference = await fileManagementClient.UploadAsync(fileData.FileStream, fileData.MimeType, fileData.FileName); return new GetFileResponse diff --git a/Apps.GitLab/Apps.GitLab.csproj b/Apps.GitLab/Apps.GitLab.csproj index 8e195fe..3f6ae02 100644 --- a/Apps.GitLab/Apps.GitLab.csproj +++ b/Apps.GitLab/Apps.GitLab.csproj @@ -6,7 +6,7 @@ enable GitLab GitLab is a developer platform that allows developers to create, store, and manage their code. This app focuses on connecting repository events and file actions into the Blackbird ecosystem. - 1.0.16 + 1.0.17 Apps.GitLab diff --git a/Apps.GitLab/Models/Respository/Requests/GetFileRequest.cs b/Apps.GitLab/Models/Respository/Requests/GetFileRequest.cs index 7fdee25..6f0384c 100644 --- a/Apps.GitLab/Models/Respository/Requests/GetFileRequest.cs +++ b/Apps.GitLab/Models/Respository/Requests/GetFileRequest.cs @@ -15,4 +15,7 @@ public class GetFileRequest [Display("Content ID", Description = "The ID of the content, used by Blacklake when diffing.")] public string? ContentId { get; set; } + + [Display("Content name")] + public string? ContentName { get; set; } } diff --git a/Apps.GitLab/Utils/File/FileHelper.cs b/Apps.GitLab/Utils/File/FileHelper.cs index 114275d..f10c3da 100644 --- a/Apps.GitLab/Utils/File/FileHelper.cs +++ b/Apps.GitLab/Utils/File/FileHelper.cs @@ -10,7 +10,12 @@ namespace Apps.GitLab.Utils.File; public static class FileHelper { - public static ProcessedDownloadedFile ProcessDownloadedFile(DownloadedFile downloadedFile, Logger? logger, string? language, string? contentId) + public static ProcessedDownloadedFile ProcessDownloadedFile( + DownloadedFile downloadedFile, + Logger? logger, + string? language, + string? contentId, + string? contentName) { var filename = Path.GetFileName(downloadedFile.Path); if (!MimeTypes.TryGetMimeType(filename, out var mimeType)) @@ -32,10 +37,10 @@ public static ProcessedDownloadedFile ProcessDownloadedFile(DownloadedFile downl fileContent.Language = language; fileContent.SystemReference.ContentId = contentId; fileContent.SystemReference.AdminUrl = editUrl; - fileContent.SystemReference.ContentName = filename; + fileContent.SystemReference.ContentName = string.IsNullOrWhiteSpace(contentName) ? filename : contentName; fileContent.SystemReference.SystemName = "Gitlab"; fileContent.SystemReference.SystemRef = "https://gitlab.com/"; return new(fileContent.ToStream(), mimeType, filename); } -} \ No newline at end of file +} From 46d02de67865efbdc41559a745967099872c585f Mon Sep 17 00:00:00 2001 From: Alex Terehov Date: Tue, 14 Jul 2026 13:26:31 -0230 Subject: [PATCH 2/2] Update filters library --- Apps.GitLab/Apps.GitLab.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Apps.GitLab/Apps.GitLab.csproj b/Apps.GitLab/Apps.GitLab.csproj index 3f6ae02..4813ef0 100644 --- a/Apps.GitLab/Apps.GitLab.csproj +++ b/Apps.GitLab/Apps.GitLab.csproj @@ -14,7 +14,7 @@ - +