Skip to content

Commit

Permalink
fix: removed core commons dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Luca Pirovano committed Aug 7, 2024
1 parent 5a54b90 commit f8bdbc5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@ public interface GitlabPipelineMapper {
*/
@Mapping(source = "configuration.params", target = "variables")
@Mapping(source = "template.branch", target = "ref")
default GitlabPipelineResource toGitlabPipelineResource(ConfigurationResource configuration, TemplateResource template, String callbackRef) {
default GitlabPipelineResource toGitlabPipelineResource(ConfigurationResource configuration, TemplateResource template, String callbackRef, Long taskId) {
GitlabPipelineResource gitlabPipelineResource = new GitlabPipelineResource();
gitlabPipelineResource.setRef(template.getBranch());
List<Map<String, String>> variables = new ArrayList<>();
for (Map.Entry<String, String> entry : configuration.getParams().entrySet()) {
variables.add(Map.of("key", entry.getKey(), "value", entry.getValue()));
}
variables.add(Map.of("key", "taskId", "value", taskId.toString()));
gitlabPipelineResource.setVariables(variables);
return gitlabPipelineResource;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public GitlabRunResourceResponse runPipeline(ConfigurationResource configuration
Long taskId,
String gitlabInstanceUrl) throws UnprocessableEntityException {
GitlabPipelineResource pipelineResource = pipelineMapper.toGitlabPipelineResource(
configurationResource, templateResource, callbackRef
configurationResource, templateResource, callbackRef, taskId
);

if (templateResource.getBranch() == null || templateResource.getProjectId() == null) {
Expand Down

0 comments on commit f8bdbc5

Please sign in to comment.