-
Notifications
You must be signed in to change notification settings - Fork 58
PORT-14552 - Docs for Github ocean integration #2494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
melodyogonna
wants to merge
47
commits into
main
Choose a base branch
from
PORT-14552-document-github-ocean
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,791
−51
Open
Changes from 30 commits
Commits
Show all changes
47 commits
Select commit
Hold shift + click to select a range
09f7849
Initial setup for Github-v2 documentation
melodyogonna 2989109
Rename documentation directory to Github ocean
melodyogonna afdba40
Add updated example for file
melodyogonna 4cf3344
Remove unnecessary examples for now
melodyogonna f8260d4
Replace Github app references
melodyogonna beb98ad
Merge branch 'main' into PORT-14552-document-github-ocean
mk-armah 7644f0d
Replace gitlab references in docs
melodyogonna bec998d
Update docker image examples
melodyogonna 18eb311
Continue updating file references
melodyogonna 6b328b8
Rename examples
melodyogonna 120c3ee
Update port exposure
melodyogonna dd539d9
Merge branch 'main' into PORT-14552-document-github-ocean
mk-armah 7103fe2
revert: examples name
melodyogonna dc3afbb
Merge branch 'PORT-14552-document-github-ocean' of github.com:port-la…
melodyogonna 1661758
Enable live event support in installation method
melodyogonna 52912bc
Add monitored pr events
melodyogonna aa46d92
Add more supported live events
melodyogonna 0139327
Modify organization param
melodyogonna d0f61e4
Add code scanning to list of app required permissions
melodyogonna c141d5d
Clean up document
melodyogonna 4a2c338
Update branch mapping details
melodyogonna 1c5d388
Update image name in the self-hosted-installation guide
melodyogonna a5c9d19
Update example file
melodyogonna e3db760
Correct docker run command
melodyogonna 5a21ea9
small corrections
melodyogonna 069590b
Correct link to Github documentation
melodyogonna b25be57
Update docker parameters
melodyogonna 358386d
correct naming convention for integration in argocd
melodyogonna c464ad5
Case correction
melodyogonna c2c50db
Merge branch 'main' of github.com:port-labs/port-docs into PORT-14552…
melodyogonna 1d28ecc
Trim down documentation to only documented examples
melodyogonna 9497739
Update limitations
melodyogonna dc68bd4
clarify app installation page
melodyogonna b70e911
Fix broken link
melodyogonna 2331752
Bump github integration version
melodyogonna f3a2f3e
fix: complete title with "installation" word
melodyogonna 9d709ae
Remove hosted by port installation method
melodyogonna 8670c82
Remove health check section
melodyogonna 3bffbb3
Remove validation check section
melodyogonna 32b84c3
Simplify to just "Github organization" rather than "self-hosted Github"
melodyogonna fbd195a
Move app installation to a subdirectory
melodyogonna e2986b5
Fix repository name example
melodyogonna 8620c10
Remove setup url from app setup step
melodyogonna 3e0024f
Add markings to two images in docs
melodyogonna 9079e3e
Redo change to settings image
melodyogonna 233a333
Merge branch 'main' of github.com:port-labs/port-docs into PORT-14552…
melodyogonna c3dc362
Update integration name in helm installation
melodyogonna File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
docs/build-your-software-catalog/sync-data-to-catalog/git/github-ocean/_category_.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"label": "GitHub Ocean", | ||
"position": 1 | ||
} |
11 changes: 11 additions & 0 deletions
11
...are-catalog/sync-data-to-catalog/git/github-ocean/_github_docker_parameters.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
| Parameter | Description | Example | Required | | ||
| --------- | ----------- | ------- | -------- | | ||
| `OCEAN__INTEGRATION__CONFIG__GITHUB_TOKEN` | The Github access token used to authenticate with your Github Organization | | ✅ | | ||
| `OCEAN__INTEGRATION__CONFIG__GTIHUB_HOST` | The URL of your Github organization (will default to https://api.github.com, pass your self-hosted URL) | | ❌ | | ||
| `OCEAN__INTEGRATION__CONFIG__GTIHUB_ORGANIZATION` | The name of your Github organization | | ✅ | | ||
| `OCEAN__BASE_URL` | The URL of your GitHub integration instance, used for real-time updates | | ❌ | | ||
| `OCEAN__PORT__CLIENT_ID` | Your Port client ([How to get the credentials](https://docs.port.io/build-your-software-catalog/custom-integration/api/#find-your-port-credentials)) id | | ✅ | | ||
| `OCEAN__PORT__CLIENT_SECRET` | Your Port client ([How to get the credentials](https://docs.port.io/build-your-software-catalog/custom-integration/api/#find-your-port-credentials)) secret | | ✅ | | ||
| `OCEAN__PORT__BASE_URL` | Your Port API URL - `https://api.getport.io` for EU, `https://api.us.getport.io` for US | | ✅ | | ||
| `OCEAN__INITIALIZE_PORT_RESOURCES` | Default true, When set to true the integration will create default blueprints and the port App config Mapping. Read more about [initializePortResources](https://ocean.getport.io/develop-an-integration/integration-configuration/#initializeportresources---initialize-port-resources) | | ❌ | | ||
| `OCEAN__INTEGRATION__IDENTIFIER` | The identifier of the integration that will be installed | | ❌ | |
17 changes: 17 additions & 0 deletions
17
.../sync-data-to-catalog/git/github-ocean/_github_exporter_supported_resources.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
- [`repository`](https://docs.github.com/en/rest/repos/repos#get-a-repository) | ||
- [`pull-request`](https://docs.github.com/en/rest/pulls/pulls#get-a-pull-request) | ||
- [`environment`](https://docs.github.com/en/rest/deployments/environments#get-an-environment) | ||
- [`deployment`](https://docs.github.com/en/rest/deployments/deployments#get-a-deployment) | ||
- [`workflow`](https://docs.github.com/en/rest/actions/workflows#get-a-workflow) | ||
- [`workflow-run`](https://docs.github.com/en/rest/actions/workflow-runs#get-a-workflow-run) | ||
- [`issue`](https://docs.github.com/en/rest/issues/issues#get-an-issue) | ||
- [`folder`](https://docs.github.com/en/rest/git/trees#get-a-tree) | ||
- [`file`](/build-your-software-catalog/sync-data-to-catalog/git/github/#ingest-files-from-your-repositories) | ||
- [`user`](https://docs.github.com/en/rest/users/users#get-a-user) | ||
- [`team`](https://docs.github.com/en/rest/teams/teams#get-a-team-by-name) | ||
- [`dependabot-alert`](https://docs.github.com/en/rest/dependabot/alerts#list-dependabot-alerts-for-a-repository) | ||
- [`branches`](https://docs.github.com/en/rest/branches/branches#get-a-branch) | ||
- [`code-scanning`](https://docs.github.com/en/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-a-repository) | ||
- [`releases`](https://docs.github.com/en/rest/releases/releases#list-releases) | ||
- [`tags`](https://docs.github.com/en/rest/repos/repos#list-repository-tags) | ||
|
4 changes: 4 additions & 0 deletions
4
...uild-your-software-catalog/sync-data-to-catalog/git/github-ocean/examples/_category_.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"label": "Examples", | ||
"position": 2 | ||
} |
52 changes: 52 additions & 0 deletions
52
...-catalog/git/github-ocean/examples/_github_exporter_example_port_app_config.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<details> | ||
|
||
<summary> Port port-app-config.yml </summary> | ||
|
||
```yaml showLineNumbers | ||
resources: | ||
- kind: repository | ||
selector: | ||
query: "true" # JQ boolean query. If evaluated to false - skip syncing the object. | ||
port: | ||
entity: | ||
mappings: | ||
identifier: ".name" # The Entity identifier will be the repository name. | ||
title: ".name" | ||
blueprint: '"githubRepository"' | ||
properties: | ||
readme: file://README.md # fetching the README.md file that is within the root folder of the repository and ingesting its contents as a markdown property | ||
url: .html_url | ||
defaultBranch: .default_branch | ||
- kind: pull-request | ||
selector: | ||
query: "true" # JQ boolean query. If evaluated to false - skip syncing the object. | ||
port: | ||
entity: | ||
mappings: | ||
identifier: ".head.repo.name + (.id|tostring)" # The Entity identifier will be the repository name + the pull request ID. | ||
title: ".title" | ||
blueprint: '"githubPullRequest"' | ||
properties: | ||
creator: ".user.login" | ||
assignees: "[.assignees[].login]" | ||
reviewers: "[.requested_reviewers[].login]" | ||
status: ".status" # merged, closed, opened | ||
closedAt: ".closed_at" | ||
updatedAt: ".updated_at" | ||
mergedAt: ".merged_at" | ||
createdAt: ".created_at" | ||
prNumber: ".id" | ||
link: ".html_url" | ||
leadTimeHours: >- | ||
(.created_at as $createdAt | .merged_at as $mergedAt | | ||
($createdAt | sub("\\..*Z$"; "Z") | strptime("%Y-%m-%dT%H:%M:%SZ") | mktime) as $createdTimestamp | | ||
($mergedAt | if . == null then null else sub("\\..*Z$"; "Z") | | ||
strptime("%Y-%m-%dT%H:%M:%SZ") | mktime end) as $mergedTimestamp | | ||
if $mergedTimestamp == null then null else | ||
(((($mergedTimestamp - $createdTimestamp) / 3600) * 100 | floor) / 100) end) | ||
|
||
relations: | ||
repository: .__repository | ||
``` | ||
|
||
</details> |
84 changes: 84 additions & 0 deletions
84
...g/git/github-ocean/examples/_github_exporter_example_pull_request_blueprint.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
<details> | ||
<summary>Pull request blueprint</summary> | ||
|
||
```json showLineNumbers | ||
{ | ||
"identifier": "githubPullRequest", | ||
"title": "Pull Request", | ||
"icon": "Github", | ||
"schema": { | ||
"properties": { | ||
"creator": { | ||
"title": "Creator", | ||
"type": "string" | ||
}, | ||
"assignees": { | ||
"title": "Assignees", | ||
"type": "array" | ||
}, | ||
"reviewers": { | ||
"title": "Reviewers", | ||
"type": "array" | ||
}, | ||
"status": { | ||
"title": "Status", | ||
"type": "string", | ||
"enum": ["merged", "open", "closed"], | ||
"enumColors": { | ||
"merged": "purple", | ||
"open": "green", | ||
"closed": "red" | ||
} | ||
}, | ||
"closedAt": { | ||
"title": "Closed At", | ||
"type": "string", | ||
"format": "date-time" | ||
}, | ||
"updatedAt": { | ||
"title": "Updated At", | ||
"type": "string", | ||
"format": "date-time" | ||
}, | ||
"mergedAt": { | ||
"title": "Merged At", | ||
"type": "string", | ||
"format": "date-time" | ||
}, | ||
"createdAt": { | ||
"title": "Created At", | ||
"type": "string", | ||
"format": "date-time" | ||
}, | ||
"link": { | ||
"format": "url", | ||
"type": "string" | ||
}, | ||
"leadTimeHours": { | ||
"title": "Lead Time in hours", | ||
"type": "number" | ||
} | ||
}, | ||
"required": [] | ||
}, | ||
"mirrorProperties": {}, | ||
"calculationProperties": { | ||
"days_old": { | ||
"title": "Days Old", | ||
"icon": "DefaultProperty", | ||
"calculation": "(now / 86400) - (.properties.createdAt | capture(\"(?<date>\\\\d{4}-\\\\d{2}-\\\\d{2})\") | .date | strptime(\"%Y-%m-%d\") | mktime / 86400) | floor", | ||
"type": "number" | ||
} | ||
}, | ||
"relations": { | ||
"repository": { | ||
"title": "Repository", | ||
"target": "githubRepository", | ||
"required": false, | ||
"many": false | ||
} | ||
} | ||
} | ||
``` | ||
|
||
</details> |
34 changes: 34 additions & 0 deletions
34
...log/git/github-ocean/examples/_github_exporter_example_repository_blueprint.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<details> | ||
<summary>Repository blueprint</summary> | ||
|
||
```json showLineNumbers | ||
{ | ||
"identifier": "githubRepository", | ||
"title": "Repository", | ||
"icon": "Microservice", | ||
"schema": { | ||
"properties": { | ||
"readme": { | ||
"title": "README", | ||
"type": "string", | ||
"format": "markdown" | ||
}, | ||
"url": { | ||
"title": "Repository URL", | ||
"type": "string", | ||
"format": "url" | ||
}, | ||
"defaultBranch": { | ||
"title": "Default branch", | ||
"type": "string" | ||
} | ||
}, | ||
"required": [] | ||
}, | ||
"mirrorProperties": {}, | ||
"calculationProperties": {}, | ||
"relations": {} | ||
} | ||
``` | ||
|
||
</details> |
34 changes: 34 additions & 0 deletions
34
...alog/git/github-ocean/examples/example-file-kind/_example_package_blueprint.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<details> | ||
<summary>Package blueprint</summary> | ||
|
||
```json showLineNumbers | ||
{ | ||
"identifier": "package", | ||
"title": "Package", | ||
"icon": "Package", | ||
"schema": { | ||
"properties": { | ||
"package": { | ||
"icon": "DefaultProperty", | ||
"type": "string", | ||
"title": "Package" | ||
}, | ||
"version": { | ||
"icon": "DefaultProperty", | ||
"type": "string", | ||
"title": "Version" | ||
} | ||
}, | ||
"required": [ | ||
"package", | ||
"version" | ||
] | ||
}, | ||
"mirrorProperties": {}, | ||
"calculationProperties": {}, | ||
"aggregationProperties": {}, | ||
"relations": {} | ||
} | ||
``` | ||
|
||
</details> |
28 changes: 28 additions & 0 deletions
28
...atalog/git/github-ocean/examples/example-file-kind/_package_json_app_config.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<details> | ||
|
||
<summary>Port config YAML</summary> | ||
|
||
```yaml showLineNumbers | ||
- kind: file | ||
selector: | ||
query: 'true' | ||
files: | ||
- path: package.json | ||
repos: | ||
- name: vscode | ||
branch: main | ||
port: | ||
itemsToParse: .content.dependencies | to_entries | ||
entity: | ||
mappings: | ||
identifier: >- | ||
.item.key + "_" + if (.item.value | startswith("^")) then | ||
.item.value[1:] else .item.value end | ||
title: .item.key + "@" + .item.value | ||
blueprint: '"package"' | ||
properties: | ||
package: .item.key | ||
version: .item.value | ||
``` | ||
|
||
</details> |
38 changes: 38 additions & 0 deletions
38
...ory-admins/_github_export_example_repository_with_admins_relation_blueprint.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<details> | ||
<summary>Repository blueprint</summary> | ||
|
||
```json showLineNumbers | ||
{ | ||
"identifier": "githubRepository", | ||
"title": "Repository", | ||
"icon": "Microservice", | ||
"schema": { | ||
"properties": { | ||
"readme": { | ||
"title": "README", | ||
"type": "string", | ||
"format": "markdown" | ||
}, | ||
"url": { | ||
"title": "Repository URL", | ||
"type": "string", | ||
"format": "url" | ||
} | ||
}, | ||
"required": [] | ||
}, | ||
"mirrorProperties": {}, | ||
"calculationProperties": {}, | ||
"aggregationProperties": {}, | ||
"relations": { | ||
"admins": { | ||
"title": "Admins", | ||
"target": "githubUser", | ||
"required": false, | ||
"many": true | ||
} | ||
} | ||
} | ||
``` | ||
|
||
</details> |
48 changes: 48 additions & 0 deletions
48
...ple-repository-admins/_github_exporter_example_admins_users_port_app_config.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<details> | ||
|
||
<summary> Port port-app-config.yml </summary> | ||
|
||
```yaml showLineNumbers | ||
createMissingRelatedEntities: true | ||
resources: | ||
- kind: repository | ||
selector: | ||
query: "true" | ||
collaborators: true | ||
port: | ||
entity: | ||
mappings: | ||
identifier: .name | ||
title: .name | ||
blueprint: '"githubRepository"' | ||
properties: | ||
readme: file://README.md | ||
url: .html_url | ||
defaultBranch: .default_branch | ||
relations: | ||
admins: "[.collaborators[] | select(.is_admin == true) | .login]" | ||
- kind: user | ||
selector: | ||
query: "true" | ||
port: | ||
entity: | ||
mappings: | ||
identifier: .login | ||
title: .login | ||
blueprint: '"githubUser"' | ||
relations: | ||
user: .email | ||
- kind: user | ||
selector: | ||
query: "true" | ||
port: | ||
entity: | ||
mappings: | ||
identifier: .email | ||
title: .email | ||
blueprint: '"user"' | ||
relations: | ||
user: .email | ||
``` | ||
|
||
</details> |
32 changes: 32 additions & 0 deletions
32
...s/example-repository-admins/_github_exporter_example_github_users_blueprint.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<details> | ||
<summary>Github Users blueprint</summary> | ||
|
||
```json showLineNumbers | ||
{ | ||
"identifier": "githubUser", | ||
"title": "Github User", | ||
"icon": "Microservice", | ||
"schema": { | ||
"properties": { | ||
"email": { | ||
"title": "Email", | ||
"type": "string" | ||
} | ||
}, | ||
"required": [] | ||
}, | ||
"mirrorProperties": {}, | ||
"calculationProperties": {}, | ||
"aggregationProperties": {}, | ||
"relations": { | ||
"user": { | ||
"title": "User", | ||
"target": "user", | ||
"required": false, | ||
"many": false | ||
} | ||
} | ||
} | ||
``` | ||
|
||
</details> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.