Skip to content
This repository was archived by the owner on Dec 3, 2019. It is now read-only.

Commit 9dce099

Browse files
Merge pull request #142 from justaprogrammer/more-docs
More documentation
2 parents a698522 + 6868db2 commit 9dce099

File tree

7 files changed

+70
-13
lines changed

7 files changed

+70
-13
lines changed

docs/contributing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
1. Create a GitHub app
55

66
## Running Web Application
7-
1. [TODO Add Web Application instructions]
7+
1. [TODO: Add Web Application instructions]
88

99
## Running Integration Tests
1010

docs/customizing.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Customizing
2+
3+
**Build Cross Check** is designed as a shortcut to allow anyone to create a [Check Run](https://developer.github.com/v3/checks/) from their build process. Check Runs are always created with a status of Completed.
4+
5+
## Schema
6+
7+
The data structure and rules mimic the [Create Check Run](https://developer.github.com/v3/checks/runs/#create-a-check-run) operation in the GitHub Api.
8+
9+
### CreateCheckRun <sub><sup>[src](https://github.com/justaprogrammer/BCC-Core/blob/master/src/BCC.Core/Model/CheckRunSubmission/CreateCheckRun.cs)</sup></sub>
10+
11+
- name (string, required) - The name of the Check Run
12+
- title (string, required) - The title of the Check Run
13+
- summary (string, required) - The summary of the Check Run, supports Markdown
14+
- text (string) - The details of the Check Run, supports Markdown
15+
- conclusion: success, failure, neutral, cancelled, timedOut, actionRequired (enum, required)
16+
- annotations (array[Annotation])
17+
- images (array[CheckRunImage])
18+
- startedAt (string, required)
19+
- completedAt (string, required)
20+
21+
### Annotation <sub><sup>[src](https://github.com/justaprogrammer/BCC-Core/blob/master/src/BCC.Core/Model/CheckRunSubmission/Annotation.cs)</sup></sub>
22+
23+
- filename (string, required)
24+
- startLine (number, required)
25+
- endLine (number, required)
26+
- annotationLevel: notice, warning, failure (enum, required)
27+
- caption (string)
28+
29+
### CheckRunImage <sub><sup>[src](https://github.com/justaprogrammer/BCC-Core/blob/master/src/BCC.Core/Model/CheckRunSubmission/CheckRunImage.cs)</sup></sub>
30+
31+
- imageUrl (string, required)
32+
- alt (string, required)
33+
- caption (string)
34+
35+
## Example Data
36+
37+
Here is the output generated by **BCC-MSBuildLog** for [this](https://github.com/justaprogrammer/TestConsoleApp1/pull/1) Pull Request of `justaprogrammer/TestConsoleApp1`, our test application. It was used to generate [this](https://github.com/justaprogrammer/TestConsoleApp1/pull/1/checks?check_run_id=36879070) Check Run.
38+
39+
```
40+
{
41+
'name': 'MSBuild Log',
42+
'title': '0 errors - 1 warning',
43+
'summary': '- [TestConsoleApp1/Program.cs(13)](https://github.com/justaprogrammer/TestConsoleApp1/tree/815aa7a3051cc0d0ae6c6c2c89cba125e8027d86/TestConsoleApp1/Program.cs#L13) **Warning - CS0219** The variable \'hello\' is assigned but its value is never used\r\n',
44+
'text': null,
45+
'conclusion': 'success',
46+
'annotations': [{
47+
'filename': 'TestConsoleApp1/Program.cs',
48+
'checkWarningLevel': 'warning',
49+
'title': 'CS0219: TestConsoleApp1/Program.cs(13)',
50+
'rawDetails': null,
51+
'message': 'The variable 'hello' is assigned but its value is never used',
52+
'startLine': 13,
53+
'endLine': 13
54+
}
55+
],
56+
'images': null,
57+
'startedAt': '2018-12-07T08:39:22.5858425-05:00',
58+
'sompletedAt': '2018-12-07T08:39:22.6347882-05:00'
59+
}
60+
61+
```

docs/integrating.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,4 @@ This example is based on AppVeyor, but this will work from any CI system. For mo
4646
- IF NOT "%BCC_TOKEN%x"=="x" BCCSubmission -i checkrun.json -h %APPVEYOR_REPO_COMMIT% -t %BCC_TOKEN%
4747
```
4848
49-
1. Enjoy your warnings and errors.
50-
51-
### Custom Check Run Data
52-
53-
### More coming soon...
49+
1. Enjoy your warnings and errors.

docs/readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
## Table of Contents
44

55
1. [Integrating](integrating.md)
6+
1. [Customizing](customizing.md)
67
1. [Contributing](contributing.md)

src/BCC.Web.Tests/Util/FakerHelpers.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public static class FakerHelpers
3131
filename: f.System.FileName(),
3232
startLine: lineNumber,
3333
endLine: lineNumber,
34-
checkWarningLevel: f.PickRandom<CheckWarningLevel>(),
34+
annotationLevel: f.PickRandom<AnnotationLevel>(),
3535
message: f.Lorem.Word())
3636
{
3737
Title = f.Random.Words(3)

src/BCC.Web/BCC.Web.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<ItemGroup>
1414
<PackageReference Include="AspNet.Security.OAuth.GitHub" Version="2.0.0" />
15-
<PackageReference Include="BCC-Core" Version="0.1.6" />
15+
<PackageReference Include="BCC-Core" Version="0.1.7" />
1616
<PackageReference Include="BuildBundlerMinifier" Version="2.8.391" />
1717
<PackageReference Include="Castle.Core" Version="4.3.1" />
1818
<PackageReference Include="GitHubJwt" Version="0.0.3" />

src/BCC.Web/Services/GitHub/GitHubAppModelService.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
using MoreLinq.Extensions;
77
using Octokit;
88
using CheckRun = BCC.Web.Models.GitHub.CheckRun;
9-
using CheckWarningLevel = BCC.Core.Model.CheckRunSubmission.CheckWarningLevel;
109

1110
namespace BCC.Web.Services.GitHub
1211
{
@@ -193,13 +192,13 @@ public async Task<string> GetRepositoryFileAsync(string owner, string repository
193192

194193
private static CheckAnnotationLevel GetCheckWarningLevel(Annotation annotation)
195194
{
196-
switch (annotation.CheckWarningLevel)
195+
switch (annotation.AnnotationLevel)
197196
{
198-
case CheckWarningLevel.Notice:
197+
case AnnotationLevel.Notice:
199198
return CheckAnnotationLevel.Notice;
200-
case CheckWarningLevel.Warning:
199+
case AnnotationLevel.Warning:
201200
return CheckAnnotationLevel.Warning;
202-
case CheckWarningLevel.Failure:
201+
case AnnotationLevel.Failure:
203202
return CheckAnnotationLevel.Failure;
204203
default:
205204
throw new ArgumentOutOfRangeException();

0 commit comments

Comments
 (0)