Skip to content

Commit

Permalink
added documentation changes
Browse files Browse the repository at this point in the history
  • Loading branch information
MatousJobanek committed Jun 21, 2018
1 parent f3ba0a9 commit 2b6292a
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 18 deletions.
2 changes: 2 additions & 0 deletions docs/fragments/pr-sanitizer.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,7 @@ include::../../pkg/plugin/pr-sanitizer/test_fixtures/github_calls/pr-sanitizer.y

=== Status details

Here, you can find status details description applicable for each state of the `pr-sanitizer` plugin.

include::{asciidoctor-source}/fragments/status/pr-sanitizer/success/pr-sanitizer-success.adoc[leveloffset=1]
include::{asciidoctor-source}/fragments/status/pr-sanitizer/failure/title-verification-failed.adoc[leveloffset=1]
28 changes: 26 additions & 2 deletions docs/fragments/test-keeper.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,8 @@ include::../../pkg/plugin/test-keeper/test_fixtures/github_calls/prs/with_tests/
<1> Defines set of <<file-patterns, file patterns>> which will be used to match files changeset and determine if Pull Requests comes with any changed test files.
<2> These <<file-patterns, file patterns>> will be used against changeset in the Pull Requests to exclude files that don't have to be verified by any test. If only such files exists the check will be marked as "Success" as no tests are expected for such a PR.
<3> Allows you to decide if you want to combine your patterns with predefined defaults (`true` by default).
<4> Sets plugin hint comment message to be added to the Pull Request when no test is found. It can be set either as a relative path or absolute URL to a file that contains a plugin hint and having case insensitive filename `PLUGINNAME_HINT.md` or as an inline string comment. (if nothing is set then a link:https://github.com/arquillian/ike-prow-plugins/tree/master/pkg/plugin/test-keeper/comment_message.go[default message] is used).

IMPORTANT: Both the configuration file and the file with plugin hint are always loaded from the `HEAD` of the Pull Request.
IMPORTANT: The configuration file is always loaded from the `HEAD` of the Pull Request.

==== File patterns [[file-patterns]]

Expand Down Expand Up @@ -81,8 +80,33 @@ test_patterns:
- 'regex{{.*test\.ts[x]?}}'
----

=== Status message

When there is a PR submitted without any test logic changed, then plugin (apart form setting the failure status) adds a comment explaining what is wrong and what the developer/reviewer can do.
If the PR is then either

* updated by a commit that contains a test

or

* updated so it contains only those files which the validation should be skipped for

then the status message in the comment is updated respectively to reflect the latest state of the PR.

==== Custom status message

Any of the status messages can be changed by putting the required custom message to any of the following files:

* `test-keeper_without_tests_message.md` for the case when no test is added
* `test-keeper_with_tests_message.md` for the case when PR is updated by a commit containing a test
* `test-keeper_only_skipped_message.md` for the case when PR is updated so it contains only those files which the validation should be skipped for

IMPORTANT: All of them has to be located in the directory `.ike-prow/`

=== Status details

Here, you can find status details description applicable for each state of the `test-keeper` plugin.

include::{asciidoctor-source}/fragments/status/test-keeper/success/tests-exist.adoc[leveloffset=1]
include::{asciidoctor-source}/fragments/status/test-keeper/success/only-skipped.adoc[leveloffset=1]
include::{asciidoctor-source}/fragments/status/test-keeper/success/keeper-approved-by.adoc[leveloffset=1]
Expand Down
2 changes: 2 additions & 0 deletions docs/fragments/work-in-progress.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,7 @@ include::../../pkg/plugin/work-in-progress/test_fixtures/github_calls/work-in-pr

=== Status details

Here, you can find status details description applicable for each state of the `work-in-progress` plugin.

include::{asciidoctor-source}/fragments/status/work-in-progress/success/wip-success.adoc[leveloffset=1]
include::{asciidoctor-source}/fragments/status/work-in-progress/failure/wip-failed.adoc[leveloffset=1]
16 changes: 0 additions & 16 deletions docs/plugins.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,6 @@ include::../plugins.yaml[tag="external_plugins"]
organization. Be aware however, that adding an external plugin both to the repository and its organization link:https://github.com/kubernetes/test-infra/blob/7de525b1f6943e5d08d9a127b0b668cec404c665/prow/plugins/plugins_test.go#L143[will result in an error].
<2> You can limit events dispatched by hook to your plugin.

==== Creating custom plugin hint messages

Customized comment message can be configured as `plugin hint` to express suggestions regarding the plugin's intented behavior. +
Eg. Configuring `plugin hint` for the `test-keeper` plugin adds comment message to the Pull Request when no test is found.

By default, the custom plugin hint message is loaded from a file `PLUGINNAME_HINT.md` located in `.ike-prow/` directory (if present). The `PLUGINNAME` is a name of the plugin you want to set the custom hint message for, so for example `.ike-prow/test-keeper_hint.md`.
It is also possible to set other location of the hint file or directly the content of the message by editing plugin's configuration file (eg. test-keeper.yaml) and adding the `plugin_hint` property there:

.test-keeper.yaml
[source, yml, indent=0]
----
plugin_hint: plugins/test-keeper_hint.md
----

The `plugin_hint` property can either have an inline string directly written inside of the config file or another file with case insensitive filename PLUGINNAME_HINT.md that contains the hint. The location of the file can be set by either a relative path or an absolute URL.

==== GitHub settings [[gh-settings]]

You will need two secrets to be able to integrate with GitHub. The `config/hmac.token` file should contain the token that
Expand Down

0 comments on commit 2b6292a

Please sign in to comment.