Skip to content
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

#99 - Allow any entity scoring (Breaking changes) #132

Merged
merged 11 commits into from
Dec 14, 2022
11 changes: 11 additions & 0 deletions .changeset/poor-pillows-roll.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
'@oriflame/backstage-plugin-score-card': minor
---

Allow any entity to be scored.

BREAKING CHANGES:

- `SystemScore` is renamed to `EntityScore` (and in a similar fashion all other `System*` components)
- `systemEntityName` in `EntityScore` is replaced by `entityRef`
- URL path to json files is changed from `{jsonDataUrl}/{systemEntityName}.json` to `{jsonDataUrl}/{entity-namespace}/{entity-kind}/{entity-name}.json`
7 changes: 7 additions & 0 deletions packages/app/src/components/catalog/EntityPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,13 @@ const apiPage = (
</Grid>
</Grid>
</EntityLayout.Route>
<EntityLayout.Route path="/score" title="Score">
<Grid container spacing={3} alignItems="stretch">
<Grid item xs={12}>
<EntityScoreCardContent />
</Grid>
</Grid>
</EntityLayout.Route>
</EntityLayout>
);

Expand Down
14 changes: 7 additions & 7 deletions plugins/score-card/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@ Welcome to the score-card plugin! Main idea behind it comes from a need to someh

### ScoreBoardPage

Page that displays list of systems and their scores.
Page that displays list of entities and their scores.

![Score board](./docs/.assets/score-board.png)

### ScoreCardTable

Table that displays list of systems and their scores.
Table that displays list of entities and their scores.

![Score card table](./docs/.assets/score-card-table.png)

| Props | type | Description | Default |
|---------|--------|--------------------|------------------------|
| `title` | string | Title of the table | System scores overview |
| Props | type | Description | Default |
|---------|--------|--------------------|--------------------------|
| `title` | string | Title of the table | Entities scores overview |

### ScoreCard

Displays detail for one system and it's scoring. You may use it in entity detail page in the catalog.
Displays detail for one entity and its scoring. You may use it in entity detail page in the catalog.

![Score Card](./docs/.assets/score-card.png)

Expand Down Expand Up @@ -58,7 +58,7 @@ Also the server providing the data needs to have correctly configured CORS polic
All configuration options:

- `jsonDataUrl`[optional]: url for the JSON data client, see [ScoringDataJsonClient](#scoringdatajsonclient).
- `wikiLinkTemplate`: the template for the link to the wiki. You may use any existing properties from the `SystemScoreEntry`, e.g. `"https://TBD/XXX/_wiki/wikis/XXX.wiki/{id}"`.
- `wikiLinkTemplate`: the template for the link to the wiki. You may use any existing properties from the `EntityScoreEntry`, e.g. `"https://TBD/XXX/_wiki/wikis/XXX.wiki/{id}"`.

### How to use the plugin

Expand Down
65 changes: 54 additions & 11 deletions plugins/score-card/sample-data/all.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,61 @@
[
{
"systemEntityName": "non-valid-system",
"systemTier": "B",
"SystemDataConfidentiality": "Public",
"entityRef": {
"kind": "api",
"name": "api.foo"
},
"scorePercent": 50,
"scoreLabel": "Yellow",
"scoringReviewDate": "2022-01-01T08:00:00Z",
jvilimek marked this conversation as resolved.
Show resolved Hide resolved
"scoreSuccess": "almost-failure",
"areaScores": [
{
"title": "Code",
"scorePercent": 100,
"scoreLabel": "Green",
"scoreSuccess": "success"
},
{
"title": "Documentation",
"scorePercent": 25,
"scoreLabel": "Red",
"scoreSuccess": "failure"
},
{
"title": "Operations",
"scorePercent": 100,
"scoreLabel": "Green",
"scoreSuccess": "success"
},
{
"title": "Quality",
"scorePercent": 50,
"scoreLabel": "Yellow",
"scoreSuccess": "almost-failure"
},
{
"title": "Security",
"scorePercent": 50,
"scoreLabel": "Yellow",
"scoreSuccess": "almost-failure"
}
]
},
{
"entityRef": {
"kind": "system",
"name": "non-valid-system"
},
"generatedDateTimeUtc": "2021-07-22 10:00",
"scorePercent": 20,
"scoreSuccess": "failure",
"scoringReviewer": "n/a"
},
{
"systemEntityName": "audio-playback",
"systemTier": "A",
"SystemDataConfidentiality": "Confidential",
"SystemDataSensitivity": ["PII", "Sensitive-PII"],
"entityRef": {
"kind": "system",
"name": "audio-playback"
},
"generatedDateTimeUtc": "2021-07-22 10:00",
"scorePercent": 57,
"scoringReviewer": "Guest",
Expand Down Expand Up @@ -317,10 +360,10 @@
]
},
{
"systemEntityName": "podcast",
"systemTier": "A",
"SystemDataConfidentiality": "Confidential",
"SystemDataSensitivity": ["PII", "Sensitive-PII"],
"entityRef": {
"kind": "system",
"name": "podcast"
},
"generatedDateTimeUtc": "2021-07-22 10:00",
"scorePercent": 57,
"scoreLabel": "C",
Expand Down
Loading