Skip to content

Commit

Permalink
Oriflame#99 - Allow any entity scoring (Breaking changes) (Oriflame#132)
Browse files Browse the repository at this point in the history
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`

Signed-off-by: T0RAT0RA <stephane.reiss@gmail.com>
  • Loading branch information
T0RAT0RA authored Dec 14, 2022
1 parent 398f28d commit ec3991d
Show file tree
Hide file tree
Showing 23 changed files with 566 additions and 168 deletions.
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",
"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

0 comments on commit ec3991d

Please sign in to comment.