diff --git a/.github/workflows/upload-integration-templates.yaml b/.github/workflows/upload-integration-templates.yaml new file mode 100644 index 0000000..482ab28 --- /dev/null +++ b/.github/workflows/upload-integration-templates.yaml @@ -0,0 +1,45 @@ +name: Upload integration templates +on: + push: + branches: + - main + paths: + # we only want to run this workflow when changes are made to the integrations folder + - integrations/** + + # when running the workflow manually upload to stg bucket + workflow_dispatch: + inputs: + bucket_environment: + description: 'Environment to deploy to, either stg or prod' + required: true + default: 'stg-01' + options: + - 'stg-01' + +jobs: + upload-templates: + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + steps: + - name: Check out code + uses: actions/checkout@v4 + - name: Configure AWS Credentials 🔒 + id: aws-credentials + uses: aws-actions/configure-aws-credentials@v2 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ secrets.AWS_REGION }} + - name: resolve the aws s3 bucket name + id: resolve-bucket-name + run: | + if [[ "${{ github.event_name }}" == "push" ]]; then + echo "BUCKET_NAME=advance-templates" >> $GITHUB_OUTPUT + else + echo "BUCKET_NAME=advance-templates-stg-01" >> $GITHUB_OUTPUT + fi + - name: Upload specifications to s3 + run: aws s3 cp integrations/ s3://${{ steps.resolve-bucket-name.outputs.BUCKET_NAME }}/integrations/ --recursive diff --git a/integrations/bitbucket/actions.json b/integrations/bitbucket/actions.json new file mode 100644 index 0000000..26a9725 --- /dev/null +++ b/integrations/bitbucket/actions.json @@ -0,0 +1,170 @@ +[ + { + "identifier": "bitbucket_scaffold_service", + "title": "Scaffold Service", + "icon": "Microservice", + "userInputs": { + "properties": { + "service_name": { + "title": "Service Name", + "description": "The new service's name", + "type": "string" + }, + "bitbucket_workspace_name": { + "title": "Bitbucket Workspace Name", + "description": "The workspace to create the new service in", + "type": "string" + }, + "bitbucket_project_key": { + "title": "Bitbucket Project Key", + "description": "Bitbucket project key symbol", + "type": "string" + } + }, + "required": [ + "service_name", + "bitbucket_workspace_name", + "bitbucket_project_key" + ], + "order": [ + "service_name", + "bitbucket_workspace_name", + "bitbucket_project_key" + ] + }, + "invocationMethod": { + "type": "WEBHOOK", + "agent": true, + "url": "https://example.com", + "synchronized": false, + "method": "POST" + }, + "trigger": "CREATE", + "description": "To complete setting up this action, please refer to the following guide: [Setup scaffold service action ->](https://docs.getport.io/guides-and-tutorials/scaffold-a-new-service?git-provider=bitbucket)", + "requiredApproval": false, + "blueprint": "service" + }, + { + "identifier": "bitbucket_send_scorecard_reminder", + "icon": "Slack", + "title": "Send scorecard reminder", + "userInputs": { + "properties": {}, + "required": [] + }, + "invocationMethod": { + "type": "WEBHOOK", + "agent": true, + "url": "https://example.com", + "synchronized": false, + "method": "POST" + }, + "trigger": "CREATE", + "description": "To complete setting up this action, please refer to the following guide: [Setup send scorecard reminder action ->](https://docs.getport.io/guides-and-tutorials/setup-slack-reminders?git-provider=bitbucket)", + "requiredApproval": false, + "blueprint": "service" + }, + { + "identifier": "bitbucket_enrich_service", + "title": "Enrich service", + "icon": "Git", + "userInputs": { + "properties": { + "type": { + "icon": "BlankPage", + "title": "Type", + "description": "The service's type", + "type": "string", + "enum": [ + "backend", + "frontend", + "integration" + ], + "enumColors": { + "backend": "lightGray", + "frontend": "lightGray", + "integration": "lightGray" + } + }, + "lifecycle": { + "icon": "CICD", + "title": "Lifecycle", + "description": "The service's lifecycle state", + "type": "string", + "enum": [ + "Production", + "Experimental", + "Deprecated" + ], + "enumColors": { + "Production": "green", + "Experimental": "orange", + "Deprecated": "red" + } + } + }, + "required": [], + "order": [ + "type", + "lifecycle" + ] + }, + "invocationMethod": { + "type": "WEBHOOK", + "agent": true, + "url": "https://example.com", + "synchronized": false, + "method": "POST" + }, + "trigger": "DAY-2", + "description": "To complete setting up this action, please refer to the following guide: [Setup enrich service action ->](https://docs.getport.io/guides-and-tutorials/let-developers-enrich-services-using-gitops?git-provider=bitbucket)", + "requiredApproval": false, + "blueprint": "service" + }, + { + "identifier": "bitbucket_create_s3_bucket", + "icon": "S3", + "title": "Create s3 bucket", + "userInputs": { + "properties": { + "name": { + "title": "Name", + "description": "The name of the cloud resource", + "type": "string" + }, + "visibility": { + "title": "Visibility", + "description": "The resource's public/private visibility", + "type": "string", + "enum": [ + "public", + "private" + ], + "enumColors": { + "public": "green", + "private": "red" + } + } + }, + "required": [ + "name", + "visibility" + ], + "order": [ + "name", + "visibility" + ] + }, + "invocationMethod": { + "type": "WEBHOOK", + "agent": true, + "url": "https://example.com", + "synchronized": false, + "method": "POST" + }, + "trigger": "DAY-2", + "description": "To complete setting up this action, please refer to the following guide: [Setup create s3 bucket ->](https://docs.getport.io/guides-and-tutorials/create-cloud-resource-using-iac?git-provider=bitbucket)", + "requiredApproval": false, + "blueprint": "service" + } +] \ No newline at end of file diff --git a/integrations/bitbucket/blueprints.json b/integrations/bitbucket/blueprints.json new file mode 100644 index 0000000..33ebdd1 --- /dev/null +++ b/integrations/bitbucket/blueprints.json @@ -0,0 +1,57 @@ +[ + { + "identifier": "service", + "title": "Service", + "icon": "BitBucket", + "schema": { + "properties": { + "readme": { + "title": "README", + "type": "string", + "format": "markdown", + "icon": "Book" + }, + "url": { + "title": "URL", + "format": "url", + "type": "string", + "icon": "Link" + }, + "language": { + "type": "string", + "title": "Language", + "icon": "Git" + }, + "slack": { + "icon": "Slack", + "type": "string", + "title": "Slack", + "format": "url" + }, + "tier": { + "title": "Tier", + "type": "string", + "description": "How mission-critical the service is", + "enum": [ + "Mission Critical", + "Customer Facing", + "Internal Service", + "Other" + ], + "enumColors": { + "Mission Critical": "turquoise", + "Customer Facing": "green", + "Internal Service": "darkGray", + "Other": "yellow" + }, + "icon": "DefaultProperty" + } + }, + "required": [] + }, + "mirrorProperties": {}, + "calculationProperties": {}, + "aggregationProperties": {}, + "relations": {} + } +] \ No newline at end of file diff --git a/integrations/bitbucket/pages.json b/integrations/bitbucket/pages.json new file mode 100644 index 0000000..4de2b13 --- /dev/null +++ b/integrations/bitbucket/pages.json @@ -0,0 +1,290 @@ +[ + { + "icon": "Apps", + "title": "Service Dashboard", + "protected": false, + "widgets": [ + { + "id": "1", + "type": "dashboard-widget", + "layout": [ + { + "height": 400, + "columns": [ + { + "id": "bitbucketScorecardReadme", + "size": 8 + }, + { + "id": "bitbucketServicesByLanguageChart", + "size": 4 + } + ] + }, + { + "height": 400, + "columns": [ + { + "id": "bitbucketExternalDashboard", + "size": 6 + }, + { + "id": "bitbucketNumberOfPythonServices", + "size": 6 + } + ] + } + ], + "widgets": [ + { + "id": "bitbucketScorecardReadme", + "title": "Port Dashboards", + "description": "", + "markdown": "[Dashboards](https://docs.getport.io/customize-pages-dashboards-and-plugins/page/dashboard-page) enable you to visualize the data from your catalog. Dashboards contain various widgets that display the data in different ways, such as pie charts, number charts, iframes, and more. You can create pages and dashboards for specific processes and expose them to the relevant people using [page permissions](https://docs.getport.io/customize-pages-dashboards-and-plugins/page/page-permissions).\n\nHere are some ideas for dashboards\n- [SVP engineering dashboard](https://demo.getport.io/dashboard_svp_engineering)\n- [Security dashboard](https://demo.getport.io/dashboard_security)\n- [SRE dashboard](https://demo.getport.io/dashboard_sre)", + "type": "markdown", + "icon": "port" + }, + { + "icon": "PieChart", + "id": "bitbucketServicesByLanguageChart", + "type": "entities-pie-chart", + "description": "", + "title": "Services By Language", + "dataset": { + "combinator": "and", + "rules": [ + { + "operator": "=", + "value": "service", + "property": "$blueprint" + } + ] + }, + "property": "property#language" + }, + { + "title": "External dashboard", + "id": "bitbucketExternalDashboard", + "description": "", + "icon": "Code", + "urlType": "public", + "url": "https://port-graphical-assets.s3.eu-west-1.amazonaws.com/Widget+Preview.html", + "type": "iframe-widget" + }, + { + "blueprint": "service", + "id": "bitbucketNumberOfPythonServices", + "calculationBy": "entities", + "unit": "none", + "description": "", + "title": "Number of Python Services", + "dataset": [ + { + "property": "language", + "operator": "in", + "value": [ + "Python", + "python" + ] + }, + { + "property": "$blueprint", + "operator": "=", + "value": "service" + } + ], + "func": "count", + "type": "entities-number-chart", + "icon": "Metric" + } + ] + } + ], + "identifier": "bitbucket-Service-Dashboard", + "showInSidebar": true, + "requiredQueryParams": [], + "section": "software_catalog", + "type": "dashboard" + }, + { + "icon": "Scorecards", + "title": "Production Readiness", + "protected": false, + "widgets": [ + { + "id": "bitbucketDashboardWidget", + "type": "dashboard-widget", + "layout": [ + { + "height": 400, + "columns": [ + { + "id": "bitbucketReadme", + "size": 8 + }, + { + "id": "bitbucketLevelsSummaryEntitiesPieChart", + "size": 4 + } + ] + }, + { + "height": 595, + "columns": [ + { + "id": "bitbucketServicesByLevelTable", + "size": 12 + } + ] + }, + { + "height": 400, + "columns": [ + { + "id": "bitbucketHasReadmeEntitiesPieChart", + "size": 4 + }, + { + "id": "bitbucketUseSupLangEntitiesPieChart", + "size": 4 + }, + { + "id": "bitbucketHasTeamEntitiesPieChart", + "size": 4 + } + ] + } + ], + "widgets": [ + { + "title": "Scorecard dashboard", + "description": "", + "markdown": "[Scorecards](https://docs.getport.io/promote-scorecards/) are a way for you and your team to define and measure standards in different categories, such as service maturity, production readiness, quality, productivity, and more. Scorecards contain [rules](https://docs.getport.io/promote-scorecards/#rule-elements) that determine its overall score (such as bronze, silver, and gold).\n\nThis dashboard is based on the \"Production Readiness\" scorecard we automatically created for you. It contains the following rules:\n- Has a readme (Bronze rule) - checks if the service has a readme file in the repository\n- Uses a supported language (Silver rule) - checks if the service is using one of the supported languages\n- Has a team (Gold rule) - checks if the service has a team that owns it (according to the \"team\" property of the service)", + "type": "markdown", + "icon": "port", + "id": "bitbucketReadme" + }, + { + "id": "bitbucketLevelsSummaryEntitiesPieChart", + "type": "entities-pie-chart", + "property": "scorecard#ProductionReadiness", + "title": "Levels summary", + "dataset": { + "combinator": "and", + "rules": [ + { + "property": "$blueprint", + "operator": "=", + "value": "service" + } + ] + } + }, + { + "id": "bitbucketServicesByLevelTable", + "type": "table-entities-explorer", + "title": "Services by level", + "icon": "Users", + "blueprintConfig": { + "service": { + "groupSettings": { + "groupBy": [ + "ProductionReadiness" + ] + }, + "propertiesSettings": { + "hidden": [ + "$identifier", + "$updatedAt", + "$createdAt", + "readme", + "url", + "language", + "slack", + "tier" + ], + "order": [] + }, + "sortSettings": { + "sortBy": [ + { + "property": "ProductionReadiness", + "order": "asc" + } + ] + } + } + }, + "displayMode": "widget", + "dataset": { + "combinator": "and", + "rules": [ + { + "property": "$blueprint", + "operator": "=", + "value": "service" + } + ] + } + }, + { + "id": "bitbucketHasReadmeEntitiesPieChart", + "type": "entities-pie-chart", + "property": "scorecard-rule#ProductionReadiness#hasReadme", + "title": "Has a readme", + "icon": "Star", + "dataset": { + "combinator": "and", + "rules": [ + { + "property": "$blueprint", + "operator": "=", + "value": "service" + } + ] + } + }, + { + "id": "bitbucketUseSupLangEntitiesPieChart", + "type": "entities-pie-chart", + "property": "scorecard-rule#ProductionReadiness#usesASupportedLanguage", + "title": "Uses a supported language", + "icon": "Star", + "dataset": { + "combinator": "and", + "rules": [ + { + "property": "$blueprint", + "operator": "=", + "value": "service" + } + ] + } + }, + { + "id": "bitbucketHasTeamEntitiesPieChart", + "type": "entities-pie-chart", + "property": "scorecard-rule#ProductionReadiness#hasTeam", + "title": "Has a Team", + "icon": "Star", + "dataset": { + "combinator": "and", + "rules": [ + { + "property": "$blueprint", + "operator": "=", + "value": "service" + } + ] + } + } + ] + } + ], + "identifier": "bitbucketProductionReadinessDashboard", + "showInSidebar": true, + "requiredQueryParams": [], + "section": "software_catalog", + "type": "dashboard" + } +] \ No newline at end of file diff --git a/integrations/bitbucket/port-app-config.yml b/integrations/bitbucket/port-app-config.yml new file mode 100644 index 0000000..068442e --- /dev/null +++ b/integrations/bitbucket/port-app-config.yml @@ -0,0 +1,14 @@ +resources: + - kind: repository + selector: + query: 'true' + port: + entity: + mappings: + identifier: .name + title: .name + blueprint: '"service"' + properties: + readme: file://README.md + url: .html_url + language: .language \ No newline at end of file diff --git a/integrations/bitbucket/scorecards.json b/integrations/bitbucket/scorecards.json new file mode 100644 index 0000000..0bc3823 --- /dev/null +++ b/integrations/bitbucket/scorecards.json @@ -0,0 +1,67 @@ +[ + { + "identifier": "ProductionReadiness", + "title": "Production Readiness", + "blueprint": "service", + "rules": [ + { + "identifier": "hasReadme", + "title": "Has a readme", + "level": "Bronze", + "query": { + "combinator": "and", + "conditions": [ + { + "operator": "isNotEmpty", + "property": "readme" + } + ] + } + }, + { + "identifier": "usesASupportedLanguage", + "title": "Uses a supported language", + "level": "Silver", + "query": { + "combinator": "or", + "conditions": [ + { + "operator": "=", + "property": "language", + "value": "Python" + }, + { + "operator": "=", + "property": "language", + "value": "JavaScript" + }, + { + "operator": "=", + "property": "language", + "value": "React" + }, + { + "operator": "=", + "property": "language", + "value": "GoLang" + } + ] + } + }, + { + "identifier": "hasTeam", + "title": "Has a Team", + "level": "Gold", + "query": { + "combinator": "and", + "conditions": [ + { + "operator": "isNotEmpty", + "property": "$team" + } + ] + } + } + ] + } +] \ No newline at end of file diff --git a/integrations/github/actions.json b/integrations/github/actions.json new file mode 100644 index 0000000..fe2cd68 --- /dev/null +++ b/integrations/github/actions.json @@ -0,0 +1,164 @@ +[ + { + "identifier": "github_scaffold_service", + "title": "Scaffold Service", + "icon": "Microservice", + "userInputs": { + "properties": { + "service_name": { + "title": "Service Name", + "description": "The new service's name", + "type": "string" + } + }, + "required": [ + "service_name" + ], + "order": [ + "service_name" + ] + }, + "invocationMethod": { + "type": "GITHUB", + "omitPayload": false, + "omitUserInputs": true, + "reportWorkflowStatus": true, + "org": "Fill here your org name", + "repo": "Fill here your repo name", + "workflow": "Fill here your workflow name" + }, + "trigger": "CREATE", + "description": "To complete setting up this action, please refer to the following guide: [Setup scaffold service action ->](https://docs.getport.io/guides-and-tutorials/scaffold-a-new-service?git-provider=github)", + "requiredApproval": false, + "blueprint": "service" + }, + { + "identifier": "github_send_scorecard_reminder", + "icon": "Slack", + "title": "Send scorecard reminder", + "userInputs": { + "properties": {}, + "required": [] + }, + "invocationMethod": { + "type": "GITHUB", + "omitPayload": false, + "omitUserInputs": false, + "reportWorkflowStatus": true, + "org": "Fill here your org name", + "repo": "Fill here your repo name", + "workflow": "Fill here your workflow name" + }, + "trigger": "CREATE", + "description": "To complete setting up this action, please refer to the following guide: [Setup send scorecard reminder action ->](https://docs.getport.io/guides-and-tutorials/setup-slack-reminders?git-provider=github)", + "requiredApproval": false, + "blueprint": "service" + }, + { + "identifier": "github_enrich_service", + "title": "Enrich service", + "icon": "Git", + "userInputs": { + "properties": { + "type": { + "icon": "BlankPage", + "title": "Type", + "description": "The service's type", + "type": "string", + "enum": [ + "backend", + "frontend", + "integration" + ], + "enumColors": { + "backend": "lightGray", + "frontend": "lightGray", + "integration": "lightGray" + } + }, + "lifecycle": { + "icon": "CICD", + "title": "Lifecycle", + "description": "The service's lifecycle state", + "type": "string", + "enum": [ + "Production", + "Experimental", + "Deprecated" + ], + "enumColors": { + "Production": "green", + "Experimental": "orange", + "Deprecated": "red" + } + } + }, + "required": [], + "order": [ + "type", + "lifecycle" + ] + }, + "invocationMethod": { + "type": "GITHUB", + "omitPayload": false, + "omitUserInputs": false, + "reportWorkflowStatus": true, + "org": "Fill here your org name", + "repo": "Fill here your repo name", + "workflow": "Fill here your workflow name" + }, + "trigger": "DAY-2", + "description": "To complete setting up this action, please refer to the following guide: [Setup enrich service action ->](https://docs.getport.io/guides-and-tutorials/let-developers-enrich-services-using-gitops?git-provider=github)", + "requiredApproval": false, + "blueprint": "service" + }, + { + "identifier": "github_create_s3_bucket", + "icon": "S3", + "title": "Create s3 bucket", + "userInputs": { + "properties": { + "name": { + "title": "Name", + "description": "The name of the cloud resource", + "type": "string" + }, + "visibility": { + "title": "Visibility", + "description": "The resource's public/private visibility", + "type": "string", + "enum": [ + "public", + "private" + ], + "enumColors": { + "public": "green", + "private": "red" + } + } + }, + "required": [ + "name", + "visibility" + ], + "order": [ + "name", + "visibility" + ] + }, + "invocationMethod": { + "type": "GITHUB", + "omitPayload": false, + "omitUserInputs": false, + "reportWorkflowStatus": true, + "org": "Fill here your org name", + "repo": "Fill here your repo name", + "workflow": "Fill here your workflow name" + }, + "trigger": "DAY-2", + "description": "To complete setting up this action, please refer to the following guide: [Setup create s3 bucket ->](https://docs.getport.io/guides-and-tutorials/create-cloud-resource-using-iac?git-provider=github)", + "requiredApproval": false, + "blueprint": "service" + } +] \ No newline at end of file diff --git a/integrations/github/blueprints.json b/integrations/github/blueprints.json new file mode 100644 index 0000000..03ea465 --- /dev/null +++ b/integrations/github/blueprints.json @@ -0,0 +1,57 @@ +[ + { + "identifier": "service", + "title": "Service", + "icon": "Github", + "schema": { + "properties": { + "readme": { + "title": "README", + "type": "string", + "format": "markdown", + "icon": "Book" + }, + "url": { + "title": "URL", + "format": "url", + "type": "string", + "icon": "Link" + }, + "language": { + "type": "string", + "title": "Language", + "icon": "Git" + }, + "slack": { + "icon": "Slack", + "type": "string", + "title": "Slack", + "format": "url" + }, + "tier": { + "title": "Tier", + "type": "string", + "description": "How mission-critical the service is", + "enum": [ + "Mission Critical", + "Customer Facing", + "Internal Service", + "Other" + ], + "enumColors": { + "Mission Critical": "turquoise", + "Customer Facing": "green", + "Internal Service": "darkGray", + "Other": "yellow" + }, + "icon": "DefaultProperty" + } + }, + "required": [] + }, + "mirrorProperties": {}, + "calculationProperties": {}, + "aggregationProperties": {}, + "relations": {} + } +] \ No newline at end of file diff --git a/integrations/github/pages.json b/integrations/github/pages.json new file mode 100644 index 0000000..9b360f9 --- /dev/null +++ b/integrations/github/pages.json @@ -0,0 +1,290 @@ +[ + { + "icon": "Apps", + "title": "Service Dashboard", + "protected": false, + "widgets": [ + { + "id": "1", + "type": "dashboard-widget", + "layout": [ + { + "height": 400, + "columns": [ + { + "id": "githubScorecardReadme", + "size": 8 + }, + { + "id": "githubServicesByLanguageChart", + "size": 4 + } + ] + }, + { + "height": 400, + "columns": [ + { + "id": "githubExternalDashboard", + "size": 6 + }, + { + "id": "githubNumberOfPythonServices", + "size": 6 + } + ] + } + ], + "widgets": [ + { + "id": "githubScorecardReadme", + "title": "Port Dashboards", + "description": "", + "markdown": "[Dashboards](https://docs.getport.io/customize-pages-dashboards-and-plugins/page/dashboard-page) enable you to visualize the data from your catalog. Dashboards contain various widgets that display the data in different ways, such as pie charts, number charts, iframes, and more. You can create pages and dashboards for specific processes and expose them to the relevant people using [page permissions](https://docs.getport.io/customize-pages-dashboards-and-plugins/page/page-permissions).\n\nHere are some ideas for dashboards\n- [SVP engineering dashboard](https://demo.getport.io/dashboard_svp_engineering)\n- [Security dashboard](https://demo.getport.io/dashboard_security)\n- [SRE dashboard](https://demo.getport.io/dashboard_sre)", + "type": "markdown", + "icon": "port" + }, + { + "icon": "PieChart", + "id": "githubServicesByLanguageChart", + "type": "entities-pie-chart", + "description": "", + "title": "Services By Language", + "dataset": { + "combinator": "and", + "rules": [ + { + "operator": "=", + "value": "service", + "property": "$blueprint" + } + ] + }, + "property": "property#language" + }, + { + "title": "External dashboard", + "id": "githubExternalDashboard", + "description": "", + "icon": "Code", + "urlType": "public", + "url": "https://port-graphical-assets.s3.eu-west-1.amazonaws.com/Widget+Preview.html", + "type": "iframe-widget" + }, + { + "blueprint": "service", + "id": "githubNumberOfPythonServices", + "calculationBy": "entities", + "unit": "none", + "description": "", + "title": "Number of Python Services", + "dataset": [ + { + "property": "language", + "operator": "in", + "value": [ + "Python", + "python" + ] + }, + { + "property": "$blueprint", + "operator": "=", + "value": "service" + } + ], + "func": "count", + "type": "entities-number-chart", + "icon": "Metric" + } + ] + } + ], + "identifier": "github-Service-Dashboard", + "showInSidebar": true, + "requiredQueryParams": [], + "section": "software_catalog", + "type": "dashboard" + }, + { + "icon": "Scorecards", + "title": "Production Readiness", + "protected": false, + "widgets": [ + { + "id": "githubDashboardWidget", + "type": "dashboard-widget", + "layout": [ + { + "height": 400, + "columns": [ + { + "id": "githubReadme", + "size": 8 + }, + { + "id": "githubLevelsSummaryEntitiesPieChart", + "size": 4 + } + ] + }, + { + "height": 595, + "columns": [ + { + "id": "githubServicesByLevelTable", + "size": 12 + } + ] + }, + { + "height": 400, + "columns": [ + { + "id": "githubHasReadmeEntitiesPieChart", + "size": 4 + }, + { + "id": "githubUseSupLangEntitiesPieChart", + "size": 4 + }, + { + "id": "githubHasTeamEntitiesPieChart", + "size": 4 + } + ] + } + ], + "widgets": [ + { + "title": "Scorecard dashboard", + "description": "", + "markdown": "[Scorecards](https://docs.getport.io/promote-scorecards/) are a way for you and your team to define and measure standards in different categories, such as service maturity, production readiness, quality, productivity, and more. Scorecards contain [rules](https://docs.getport.io/promote-scorecards/#rule-elements) that determine its overall score (such as bronze, silver, and gold).\n\nThis dashboard is based on the \"Production Readiness\" scorecard we automatically created for you. It contains the following rules:\n- Has a readme (Bronze rule) - checks if the service has a readme file in the repository\n- Uses a supported language (Silver rule) - checks if the service is using one of the supported languages\n- Has a team (Gold rule) - checks if the service has a team that owns it (according to the \"team\" property of the service)", + "type": "markdown", + "icon": "port", + "id": "githubReadme" + }, + { + "id": "githubLevelsSummaryEntitiesPieChart", + "type": "entities-pie-chart", + "property": "scorecard#ProductionReadiness", + "title": "Levels summary", + "dataset": { + "combinator": "and", + "rules": [ + { + "property": "$blueprint", + "operator": "=", + "value": "service" + } + ] + } + }, + { + "id": "githubServicesByLevelTable", + "type": "table-entities-explorer", + "title": "Services by level", + "icon": "Users", + "blueprintConfig": { + "service": { + "groupSettings": { + "groupBy": [ + "ProductionReadiness" + ] + }, + "propertiesSettings": { + "hidden": [ + "$identifier", + "$updatedAt", + "$createdAt", + "readme", + "url", + "language", + "slack", + "tier" + ], + "order": [] + }, + "sortSettings": { + "sortBy": [ + { + "property": "ProductionReadiness", + "order": "asc" + } + ] + } + } + }, + "displayMode": "widget", + "dataset": { + "combinator": "and", + "rules": [ + { + "property": "$blueprint", + "operator": "=", + "value": "service" + } + ] + } + }, + { + "id": "githubHasReadmeEntitiesPieChart", + "type": "entities-pie-chart", + "property": "scorecard-rule#ProductionReadiness#hasReadme", + "title": "Has a readme", + "icon": "Star", + "dataset": { + "combinator": "and", + "rules": [ + { + "property": "$blueprint", + "operator": "=", + "value": "service" + } + ] + } + }, + { + "id": "githubUseSupLangEntitiesPieChart", + "type": "entities-pie-chart", + "property": "scorecard-rule#ProductionReadiness#usesASupportedLanguage", + "title": "Uses a supported language", + "icon": "Star", + "dataset": { + "combinator": "and", + "rules": [ + { + "property": "$blueprint", + "operator": "=", + "value": "service" + } + ] + } + }, + { + "id": "githubHasTeamEntitiesPieChart", + "type": "entities-pie-chart", + "property": "scorecard-rule#ProductionReadiness#hasTeam", + "title": "Has a Team", + "icon": "Star", + "dataset": { + "combinator": "and", + "rules": [ + { + "property": "$blueprint", + "operator": "=", + "value": "service" + } + ] + } + } + ] + } + ], + "identifier": "githubProductionReadinessDashboard", + "showInSidebar": true, + "requiredQueryParams": [], + "section": "software_catalog", + "type": "dashboard" + } +] \ No newline at end of file diff --git a/integrations/github/port-app-config.yml b/integrations/github/port-app-config.yml new file mode 100644 index 0000000..068442e --- /dev/null +++ b/integrations/github/port-app-config.yml @@ -0,0 +1,14 @@ +resources: + - kind: repository + selector: + query: 'true' + port: + entity: + mappings: + identifier: .name + title: .name + blueprint: '"service"' + properties: + readme: file://README.md + url: .html_url + language: .language \ No newline at end of file diff --git a/integrations/github/scorecards.json b/integrations/github/scorecards.json new file mode 100644 index 0000000..0bc3823 --- /dev/null +++ b/integrations/github/scorecards.json @@ -0,0 +1,67 @@ +[ + { + "identifier": "ProductionReadiness", + "title": "Production Readiness", + "blueprint": "service", + "rules": [ + { + "identifier": "hasReadme", + "title": "Has a readme", + "level": "Bronze", + "query": { + "combinator": "and", + "conditions": [ + { + "operator": "isNotEmpty", + "property": "readme" + } + ] + } + }, + { + "identifier": "usesASupportedLanguage", + "title": "Uses a supported language", + "level": "Silver", + "query": { + "combinator": "or", + "conditions": [ + { + "operator": "=", + "property": "language", + "value": "Python" + }, + { + "operator": "=", + "property": "language", + "value": "JavaScript" + }, + { + "operator": "=", + "property": "language", + "value": "React" + }, + { + "operator": "=", + "property": "language", + "value": "GoLang" + } + ] + } + }, + { + "identifier": "hasTeam", + "title": "Has a Team", + "level": "Gold", + "query": { + "combinator": "and", + "conditions": [ + { + "operator": "isNotEmpty", + "property": "$team" + } + ] + } + } + ] + } +] \ No newline at end of file