Commit Graph

21 Commits

Author SHA1 Message Date
Patrik Oldsberg 59a9309536 remove usage of @ts-ignore
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2022-01-18 11:19:01 +01:00
Fredrik Adelöw 5333451def Got rid of the last brace-typed and hyphen-less params etc
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2022-01-10 09:48:12 +01:00
Otto Sichert b23bc7f9c3 Change default port of backend to 7007 due to MacOS Control Center update
Signed-off-by: Otto Sichert <git@ottosichert.de>
2021-11-18 16:45:57 +01:00
Patrik Oldsberg 36e67d2f24 more strict error type checking in most packages and backend plugins
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2021-10-17 15:09:05 +02:00
Jonah Back 6956ae1547 fix: add check for existence of lines in jacoco converter
Signed-off-by: Jonah Back <jonah@jonahback.com>
2021-10-07 13:36:59 -07:00
Patrik Oldsberg 8142a8ecb2 packages,plugins: add package documentation
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2021-09-14 18:47:53 +02:00
Fredrik Adelöw 923491eece run prettier formatting
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2021-08-09 11:54:38 +02:00
Fredrik Adelöw a88073c29a Update copyright headers
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2021-06-18 20:26:42 +02:00
Patrik Oldsberg 05c98f1f79 Merge branch 'master' into add-support-for-plugin-specific-db 2021-06-15 17:49:50 +02:00
Fredrik Adelöw 3108ff7bfd Make yarn dev for backends respect the PLUGIN_PORT env var
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2021-06-14 14:46:19 +02:00
Minn Soe 5a3ce34072 refactor: migrate from deprecated database manager
Changes:
- Swaps out `SingleConnectionDatabaseManager` to `DatabaseManager`
  across the repo.
- Updates `backend-test-utils` to generate test plugin names prefixed
  with db to satisfy plugin naming constraint, e.g. 0 becomes db0.

Signed-off-by: Minn Soe <contributions@minn.io>
2021-06-10 11:14:40 +01:00
alde d0addca860 [code-coverage] fix so tests work in windows
Use path.resolve, and trim end of scmFiles

Signed-off-by: alde <r.dybeck@gmail.com>
2021-04-21 13:14:57 -04:00
Fredrik Adelöw 87a82498b9 final fixup
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2021-04-21 13:30:21 +02:00
alde 7f521339b9 fix test fixture
Signed-off-by: alde <r.dybeck@gmail.com>
2021-04-21 12:58:20 +02:00
alde d4b2b0869d use getEntitySourceLocation in CoverageUtils
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2021-04-21 12:58:19 +02:00
alde 9132deaa76 fix file content explorer, use getEntitySourceLocation
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2021-04-21 12:58:19 +02:00
alde 07768e8b9e use theme colors for trend icons
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2021-04-21 12:58:18 +02:00
alde 5813a89427 fix types in frontend api client
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2021-04-21 12:58:18 +02:00
alde bf02f21eb9 Address minor code style comments
move code out of `converter/index.ts`.

change Converter to be an interface.

remove unused function

remove commented out import

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2021-04-21 12:58:18 +02:00
alde 0e57ec3f91 Update URLs to be more consistent
GET  /report?entity=<ref>

POST /report?entity=<ref>&coverageType=<cobertura|jacoco>

GET  /history?entity=<ref>

GET  /file-content?entity=<ref>&path=<filepath>

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2021-04-21 12:58:18 +02:00
alde e7d2fb93f0 Create code-coverage plugin
In order to use this plugin, you must set the
`backstage.io/code-coverage` annotation on your entity.

```yaml
backstage.io/code-coverage: enabled
```

There's a feature to only include files that are in SCM in the coverage
report, this is helpful to not count generated files for example. To
enable this set the `backstage.io/code-coverage` annotation to
`scm-only`.

```yaml
backstage.io/code-coverage: scm-only
```

The backend plugin provides API endpoints for submitting code-coverage
reports. Currently jacoco and cobertura are supported. These reports
are normalized to a json format that is stored in the database.

```json
// curl -X POST -H "Content-Type:text/xml" -d @cobertura.xml "localhost:7000/api/code-coverage/Component/default/entity-name?coverageType=cobertura"
{
    "links": [
        {
            "href": "http://localhost:7000/api/code-coverage/Component/default/entity-name",
            "rel": "coverage"
        }
    ]
}
```

It also provides some additional API endpoints:
* Viewing the latest report
* Viewing a more condensed history of code coverage values
* Retrieving file contents from source-control, used by the UI

Provides a graph of code coverage change over time, as well as a file
view where you can see the highlighted lines.

Co-authored-by: nissayeva <natashaaay@gmail.com>
Signed-off-by: alde <r.dybeck@gmail.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2021-04-21 12:58:18 +02:00