-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: individual support for manual checks and exceptions (#85)
* feat: individual support for manual checks and exceptions
- Loading branch information
1 parent
ee11070
commit 5165fa6
Showing
8 changed files
with
155 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# Splunk AppInspect action | ||
|
||
This action runs Splunk's AppInspect CLI against a provided a directory of a Splunk App. | ||
It fails if the result contains any failures. | ||
This action runs Splunk's AppInspect CLI against a provided directory of Splunk App. | ||
It fails if the result contains any failures or manual checks are not vetted. | ||
|
||
The (json) result will be written to the file specified with [`result-file`](#result-file). | ||
This can be uploaded for later viewing to use in another step/job using [`actions/upload-artifact@v2`](https://github.com/marketplace/actions/upload-a-build-artifact). | ||
|
@@ -29,35 +29,58 @@ Appinspect tags to exclude | |
|
||
`required`: `false` | ||
|
||
### `app_vetting` | ||
Path to app vetting yaml file. Used only if `manual` in `included_tags` | ||
### `appinspect_manual_checks` | ||
Path to file which contains list of manual checks | ||
|
||
`default`: `.app-vetting.yaml` | ||
`required`: `false` | ||
`default`: `.appinspect.manualcheck.yaml` | ||
|
||
### `appinspect_expected_failures` | ||
Path to file which contains list of expected appinspect failures | ||
|
||
`required`: `false` | ||
`default`: `.appinspect.expect.yaml` | ||
|
||
### `manual_check_markdown` | ||
Path for generated file with markdown for manual checks. Used only if `manual` in `included_tags` | ||
Path to generated file with markdown for manual checks | ||
|
||
`required`: `false` | ||
`default`: `manual_check_markdown.txt` | ||
|
||
### `appinspect_expected_failures` | ||
Path to generated file with markdown for expected appinspect failures | ||
|
||
`required`: `false` | ||
`default`: `expected_failure_markdown.txt` | ||
|
||
## Outputs | ||
|
||
### `status`: | ||
|
||
`pass|fail` | ||
|
||
## Using manual tag | ||
Running `appinspect-cli-action` with `manual` tag in `included_tags` detects checks that need to be verified manually and tests if all of them were already reviewed - if not the action will fail. | ||
### Manual checks review | ||
To see checks to be verified inspect the `result_file` from `appinspect-cli-action` run with manual tag. Verify manual checks and mark them as reviewed by adding them one by one into `.app-vetting.yaml`, ex: | ||
To see checks to be verified, inspect the `result_file` from `appinspect-cli-action`. Verify manual checks and mark them as reviewed by adding them one by one into `.appinspect.manualcheck.yaml`, ex: | ||
```yml | ||
name_of_manual_check_1: | ||
comment: 'your comment' | ||
name_of_manual_check_2: | ||
comment: 'your comment' | ||
``` | ||
please note that names of validated manual checks should be aligned with those from `result_file` and your comment can't be empty. | ||
Please note that names of validated manual checks should be aligned with those from `result_file` and your comment can't be empty. | ||
|
||
### Failure checks review | ||
To mark Failures as expected, add them into `.appinspect.expect.yaml` with proper comment containing ticket id of ADDON/APPCERT project associated with the exception, ex: | ||
```yml | ||
name_of_exception_1: | ||
comment: 'ADDON-123: your comment' | ||
name_of_exception_2: | ||
comment: 'APPCERT-123: your comment' | ||
``` | ||
Please note that your comment can't be empty, it must include ticket id of ADDON/APPCERT project associated with the exception and the names of exceptions should be aligned with those from `result_file`. | ||
|
||
### Running the job | ||
When `appinspect-cli-action` is called with `manual` tag, it scans the package with Splunk's AppInspect CLI and searches for manual checks. In the next step, action compares `results_file` with `.app-vetting.yaml` if any check wasn't reviewed and isn't in `.app-vetting.yaml` then the job fails. | ||
When `appinspect-cli-action` is called, it scans the package with Splunk's AppInspect CLI. If there are any failures observed then action compares `results_file` with `.appinspect.expect.yaml`. If that failure isn't present in `.appinspect.expect.yaml` or it does not contain an appropriate comment(containing ADDON/APPCERT ticket id associated with the exception) then the job fails with proper failure reason. In the next step, action compares `results_file` with `.appinspect.manualcheck.yaml`. If any manual check wasn't reviewed by addon developer and isn't in `.appinspect.manualcheck.yaml` then the job fails. | ||
|
||
## Example usage | ||
|
||
|
@@ -66,20 +89,26 @@ When `appinspect-cli-action` is called with `manual` tag, it scans the package w | |
with: | ||
app_path: 'test' | ||
``` | ||
### Downloading manual checks markdown | ||
If the comparison is successful then a markdown consisting a table with manual check names and comments is generated. It can be uploaded to artifacts. | ||
### Downloading markdowns | ||
If the comparison is successful then a markdown consisting a table with check names and comments is generated. It can be uploaded to artifacts. | ||
```yml | ||
- uses: actions/checkout@v2 | ||
- uses: splunk/[email protected] | ||
with: | ||
app_path: 'test' | ||
included_tags: manual | ||
included_tags: {appinspect-tags-to-include} | ||
manual_check_markdown: manual_check_markdown.txt | ||
expected_failure_markdown: expected_failure_markdown.txt | ||
- name: upload-manual-check-markodown | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: manual_check_markdown.txt | ||
path: manual_check_markdown.txt | ||
- name: upload-expected_failure-markodown | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: expected_failure_markdown.txt | ||
path: expected_failure_markdown.txt | ||
``` | ||
The markdown is ready to paste into confluence, by: | ||
`Edit -> Insert more content -> Markup`, change insert type to `Markdown` and paste the contents of the file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.