This repository has been archived by the owner on Nov 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
addb962
commit 2cee93b
Showing
11 changed files
with
15,701 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains 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 @@ | ||
module.exports = require('@backstage/cli/config/eslint-factory')(__dirname); |
This file contains 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,5 @@ | ||
# @internal/backstage-plugin-catalog-backend-module-autogov-processor | ||
|
||
The autogov-processor backend module for the catalog plugin. | ||
|
||
_This plugin was created through the Backstage CLI_ |
This file contains 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,94 @@ | ||
{ | ||
"name": "@liatrio/backstage-plugin-catalog-backend-module-autogov-processor", | ||
"description": "The autogov-processor backend module for the catalog plugin.", | ||
"version": "1.2.0", | ||
"main": "src/index.ts", | ||
"types": "src/index.ts", | ||
"license": "Apache-2.0", | ||
"private": true, | ||
"publishConfig": { | ||
"access": "public", | ||
"main": "dist/index.cjs.js", | ||
"types": "dist/index.d.ts" | ||
}, | ||
"backstage": { | ||
"role": "backend-plugin-module", | ||
"pluginId": "catalog-backend-module-autogov-processor", | ||
"pluginPackages": [], | ||
"pluginPackage": [] | ||
}, | ||
"scripts": { | ||
"start": "backstage-cli package start", | ||
"build": "backstage-cli package build", | ||
"lint": "backstage-cli package lint", | ||
"test": "backstage-cli package test", | ||
"clean": "backstage-cli package clean", | ||
"prepack": "backstage-cli package prepack", | ||
"postpack": "backstage-cli package postpack" | ||
}, | ||
"dependencies": { | ||
"@backstage/backend-plugin-api": "^1.0.0", | ||
"@backstage/catalog-model": "^1.7.0", | ||
"@backstage/config": "^1.2.0", | ||
"@backstage/integration": "^1.15.1", | ||
"@backstage/plugin-catalog-node": "^1.13.1", | ||
"@backstage/types": "^1.1.1", | ||
"node-fetch": "2" | ||
}, | ||
"devDependencies": { | ||
"@backstage/backend-test-utils": "^1.0.0", | ||
"@backstage/cli": "^0.27.1", | ||
"@types/node-fetch": "2" | ||
}, | ||
"files": [ | ||
"dist" | ||
], | ||
"configSchema": { | ||
"$schema": "https://backstage.io/schema/config-v1", | ||
"title": "@liatrio/backend-module-autogov-processor", | ||
"type": "object", | ||
"properties": { | ||
"github": { | ||
"type": "object", | ||
"description": "GitHub configuration", | ||
"properties": { | ||
"resultsFile": { | ||
"type": "object", | ||
"description": "Autogov results file configuration", | ||
"properties": { | ||
"allowOverride": { | ||
"type": "boolean", | ||
"description": "Whether to allow override of default results file location", | ||
"default": false | ||
}, | ||
"default": { | ||
"type": "string", | ||
"description": "Default name for the results file", | ||
"default": "results" | ||
} | ||
} | ||
}, | ||
"requireAnnotation": { | ||
"type": "boolean", | ||
"description": "Whether to require annotations for processing", | ||
"default": true | ||
}, | ||
"entityKinds": { | ||
"type": "array", | ||
"description": "Array of entity kinds to process", | ||
"default": [ | ||
"component" | ||
] | ||
}, | ||
"entityTypes": { | ||
"type": "array", | ||
"description": "Array of entity types to process", | ||
"default": [ | ||
"website" | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
backstage-plugin-autogov-processor-backend/src/constants.ts
This file contains 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 @@ | ||
export const AUTOGOV_STATUS_FILE_ANNOTATION = 'liatrio.com/autogov-result-file'; | ||
export const AUTOGOV_STATUS_ANNOTATION = | ||
'liatrio.com/autogov-latest-release-status'; | ||
|
||
export enum AUTOGOV_STATUSES { | ||
PASSED = 'PASSED', | ||
FAILED = 'FAILED', | ||
N_A = 'N/A', | ||
ERROR = 'ERROR', | ||
} | ||
|
||
export enum AUTOGOV_STATUS_WEIGHT { | ||
PASSED = 1, | ||
FAILED = 2, | ||
N_A = 3, | ||
UNKNOWN = 4, | ||
} |
This file contains 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,9 @@ | ||
/***/ | ||
/** | ||
* The autogov-processor backend module for the catalog plugin. | ||
* | ||
* @packageDocumentation | ||
*/ | ||
|
||
export { catalogModuleAutogovProcessor as default } from './module'; | ||
export * from './constants'; |
This file contains 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 @@ | ||
import { | ||
coreServices, | ||
createBackendModule, | ||
} from '@backstage/backend-plugin-api'; | ||
import { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node/alpha'; | ||
import { AutogovProcessor } from './processor'; | ||
|
||
export const catalogModuleAutogovProcessor = createBackendModule({ | ||
pluginId: 'catalog', | ||
moduleId: 'autogov-processor', | ||
register(reg) { | ||
reg.registerInit({ | ||
deps: { | ||
catalog: catalogProcessingExtensionPoint, | ||
config: coreServices.rootConfig, | ||
logger: coreServices.logger, | ||
}, | ||
async init({ catalog, config, logger }) { | ||
logger.info('Initializing Autogov Processor'); | ||
catalog.addProcessor( | ||
AutogovProcessor.fromConfig(config, { | ||
logger, | ||
}), | ||
); | ||
}, | ||
}); | ||
}, | ||
}); |
Oops, something went wrong.