The stryker dashboard (https://dashboard.stryker-mutator.io) supports now hosts your full html report (although it is not fully advertised yet). We should implement this in Stryker, Stryker.NET and Stryker4s.
We can use this issue to discuss and align design choices across Stryker, Stryker.NET, and Stryker4s.
I'll keep this original post up to date with current design decisions.
Changelog
18-11
- Don't enforce the version name to be url encoded. You can use
/ instead of %2F.
13-11
- Remove "mutation-score-only-reports" again fromin the mutation testing report schema, instead allow report upload without object wrapper.
13-11
- Add "mutation-score-only-reports" in the mutation testing report schema
25-10
- Document 'mutation score'-only reports.
21-10
- Use Stryker settings rather than environment variables by default.
- Rename "repository slug" to "project"
- Rename "moduleName" to "module"
- Remove "provider". It is now part of the "project"
- Allow baseUrl to be overridden
Request
You can send a report with an HTTP PUT request, like so:
curl -X PUT \
$BASE_URL$/api/reports/$PROJECT$/$VERSION$ \
-H 'Content-Type: application/json' \
-H 'Host: dashboard.stryker-mutator.io' \
-H 'X-Api-Key: $API_KEY$ \
-d '$REPORT_JSON$'
Multiple results per VERSION are also supported using this url: $BASE_URL$/api/reports/$PROJECT$/$VERSION$?module=$MODULE_NAME$
A report can also contain only a "mutation score" (without the files and mutants). This way, you will have a mutation score badge, but no other information is stored. In that case, the $REPORT_JSON$ should be in the format { "mutationScore": 42 }
The variables here are:
BASE_URL: https://dashboard.stryker-mutator.io for production, https://stryker-dashboard-acceptance.azurewebsites.net/ for acceptance
PROJECT: The name registered with the dashboard. It is in the form of gitProvider/organization/repository. At the moment the dashboard backend only supports github.com as a git provider, but we will also support gitlab.com/bitbucket.org, etc in the future. It can have an indefinite number of levels. Slashes (/) in this name are not escaped. For example github.com/stryker-mutator/stryker-net.
VERSION: the version of the report. This should be filled with the branch name, git tag or git sha (although no validation is done). You can override a report of a specific version, like docker tags. Slashes in the version should not be encoded. For example, it's valid to use "feat/logging".
API_KEY: The API key that you retrieved by enabling the report on the dashboard.stryker-mutator.io website.
REPORT_JSON: A valid report according to the mutation testing report schema, or a mutation score only report in the form of { "mutationScore": 42 }
MODULE: Optional. If you want to store multiple reports for a version, you can use this value to separate them logically. For example, in a mono-repo setup where each package (or project or module) delivers a report.
Reponse
{
"href": "https://dashboard.stryker-mutator.io/reports/github.com/stryker-mutator/stryker-net"
}
The href you can communicate to the end-user.
Implementation suggestion
I think we should try to align on the implementation a bit. That way enabling stryker dashboard reports in your builds is the same across all implementations of Stryker. Current suggestion:
- Enabling the dashboard reporter is done by adding
"dashboard" to the "reporters" configuration.
- Configuring the "project" is done via the
dashboard.project configuration key.
- Configuring the "module is done via the
dashboard.module configuration key.
- Configuring the "version" is done via the
dashboard.version command-line variable. Configuration file might also be useful for consistency, but not encouraged as you will not be able to support different branches.
- Configuring the "baseUrl" is done via the
dashboard.baseUrl configuration key. It defaults to "https://dashboard.stryker-mutator.io".
- Read the API key from the environment variable "STRYKER_DASHBOARD_API_KEY".
- If the "project" and/or "version" setting is missing it might be discovered from the environment variables of the build server. For example: Circle CI, Travis, Azure Devops, Github actions, Gitlab CI.
Open questions:
STRYKER_DASHBOARD_API_KEY: Do we also want to provide it using a command-line variable?
The stryker dashboard (https://dashboard.stryker-mutator.io) supports now hosts your full html report (although it is not fully advertised yet). We should implement this in Stryker, Stryker.NET and Stryker4s.
We can use this issue to discuss and align design choices across Stryker, Stryker.NET, and Stryker4s.
I'll keep this original post up to date with current design decisions.
Changelog
18-11
/instead of%2F.13-11
13-11
25-10
21-10
Request
You can send a report with an HTTP PUT request, like so:
Multiple results per
VERSIONare also supported using this url:$BASE_URL$/api/reports/$PROJECT$/$VERSION$?module=$MODULE_NAME$A report can also contain only a "mutation score" (without the files and mutants). This way, you will have a mutation score badge, but no other information is stored. In that case, the
$REPORT_JSON$should be in the format{ "mutationScore": 42 }The variables here are:
BASE_URL:https://dashboard.stryker-mutator.iofor production,https://stryker-dashboard-acceptance.azurewebsites.net/for acceptancePROJECT: The name registered with the dashboard. It is in the form ofgitProvider/organization/repository. At the moment the dashboard backend only supportsgithub.comas a git provider, but we will also supportgitlab.com/bitbucket.org, etc in the future. It can have an indefinite number of levels. Slashes (/) in this name are not escaped. For examplegithub.com/stryker-mutator/stryker-net.VERSION: the version of the report. This should be filled with the branch name, git tag or git sha (although no validation is done). You can override a report of a specific version, like docker tags. Slashes in the version should not be encoded. For example, it's valid to use "feat/logging".API_KEY: The API key that you retrieved by enabling the report on the dashboard.stryker-mutator.io website.REPORT_JSON: A valid report according to the mutation testing report schema, or a mutation score only report in the form of{ "mutationScore": 42 }MODULE: Optional. If you want to store multiple reports for a version, you can use this value to separate them logically. For example, in a mono-repo setup where each package (or project or module) delivers a report.Reponse
{ "href": "https://dashboard.stryker-mutator.io/reports/github.com/stryker-mutator/stryker-net" }The href you can communicate to the end-user.
Implementation suggestion
I think we should try to align on the implementation a bit. That way enabling stryker dashboard reports in your builds is the same across all implementations of Stryker. Current suggestion:
"dashboard"to the"reporters"configuration.dashboard.projectconfiguration key.dashboard.moduleconfiguration key.dashboard.versioncommand-line variable. Configuration file might also be useful for consistency, but not encouraged as you will not be able to support different branches.dashboard.baseUrlconfiguration key. It defaults to "https://dashboard.stryker-mutator.io".Open questions:
STRYKER_DASHBOARD_API_KEY: Do we also want to provide it using a command-line variable?