Skip to content

Commit

Permalink
[Integrations][Gitlab] Align default resources with the examples in P…
Browse files Browse the repository at this point in the history
…ort Docs (#231)
  • Loading branch information
Tankilevitch authored Nov 16, 2023
1 parent 49aa4ac commit 925e13c
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 35 deletions.
58 changes: 34 additions & 24 deletions integrations/gitlab/.port/resources/blueprints.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,46 @@
[
{
"identifier": "project",
"title": "Project",
"icon": "GitLab",
"identifier": "repository",
"title": "Repository",
"icon": "Microservice",
"schema": {
"properties": {
"url": {
"title": "URL",
"format": "url",
"type": "string"
"type": "string",
"format": "url"
},
"readme": {
"title": "README",
"type": "string",
"format": "markdown"
},
"description": {
"title": "Description",
"type": "string"
},
"language": {
"title": "Language",
"type": "string"
},
"namespace": {
"title": "Namespace",
"type": "string"
},
"full_path": {
"fullPath": {
"title": "Full Path",
"type": "string"
},
"defaultBranch": {
"title": "Default Branch",
"type": "string"
}
}
}
},
"required": []
},
"mirrorProperties": {},
"calculationProperties": {},
"relations": {}
},
{
"identifier": "mergeRequest",
Expand All @@ -38,12 +55,7 @@
"status": {
"title": "Status",
"type": "string",
"enum": [
"opened",
"closed",
"merged",
"locked"
],
"enum": ["opened", "closed", "merged", "locked"],
"enumColors": {
"opened": "yellow",
"closed": "red",
Expand Down Expand Up @@ -74,9 +86,9 @@
}
},
"relations": {
"project": {
"target": "project",
"required": true,
"repository": {
"target": "repository",
"required": false,
"many": false
}
}
Expand Down Expand Up @@ -119,10 +131,7 @@
"status": {
"title": "Status",
"type": "string",
"enum": [
"opened",
"closed"
],
"enum": ["opened", "closed"],
"enumColors": {
"opened": "green",
"closed": "purple"
Expand All @@ -138,11 +147,12 @@
}
},
"relations": {
"project": {
"target": "project",
"repository": {
"target": "repository",
"title": "Repository",
"required": true,
"many": false
}
}
}
]
]
22 changes: 12 additions & 10 deletions integrations/gitlab/.port/resources/port-app-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,24 @@ deleteDependentEntities: true
resources:
- kind: project
selector:
query: 'true'
query: "true"
port:
entity:
mappings:
identifier: .path_with_namespace | gsub(" "; "")
title: .name
blueprint: '"project"'
blueprint: '"repository"'
properties:
url: .web_link
url: .web_url
readme: file://README.md
description: .description
language: .__languages | to_entries | max_by(.value) | .key
namespace: .namespace.name
full_path: .namespace.full_path
fullPath: .namespace.full_path
defaultBranch: .default_branch
- kind: merge-request
selector:
query: 'true'
query: "true"
port:
entity:
mappings:
Expand All @@ -32,10 +35,10 @@ resources:
description: .description
link: .web_url
relations:
project: .references.full | gsub("!.+"; "")
repository: .references.full | gsub("!.+"; "")
- kind: issue
selector:
query: 'true'
query: "true"
port:
entity:
mappings:
Expand All @@ -50,7 +53,6 @@ resources:
updatedAt: .updated_at
description: .description
link: .web_url
labels: '[.labels[]]'
object: .
labels: "[.labels[]]"
relations:
project: .references.full | gsub("#.+"; "")
repository: .references.full | gsub("#.+"; "")
7 changes: 7 additions & 0 deletions integrations/gitlab/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

<!-- towncrier release notes start -->

0.1.28 (2023-11-16)
===================

### Improvements

- Aligned default resources and mapping with Port docs examples (#1)

0.1.27 (2023-11-08)
===================

Expand Down
2 changes: 1 addition & 1 deletion integrations/gitlab/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "gitlab"
version = "0.1.27"
version = "0.1.28"
description = "Gitlab integration for Port using Port-Ocean Framework"
authors = ["Yair Siman-Tov <[email protected]>"]

Expand Down

0 comments on commit 925e13c

Please sign in to comment.