Skip to content

Commit 0b2fb63

Browse files
authored
Include docfx & changelog in dev process (#528)
* Include docfx & changelog in dev process * Scan containers only for main branch and release branches * Add Vulnerability Scanning Signed-off-by: Victor Chang <vicchang@nvidia.com>
1 parent 33bfb38 commit 0b2fb63

File tree

3 files changed

+31
-9
lines changed

3 files changed

+31
-9
lines changed

.github/pull_request_template.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ A few sentences describing the changes proposed in this pull request.
1313
- [ ] Breaking change (fix or new feature that would cause existing functionality to change).
1414
- [ ] New tests added to cover the changes.
1515
- [ ] All tests passed locally.
16-
- [ ] [Documentation comments](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/documentation-comments) included/updated.
17-
- [ ] User guide updated.
18-
- [ ] I have updated the changelog
16+
- [ ] [Documentation comments](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/xmldoc/) included/updated.
17+
- [ ] [User guide updated](../docs).
18+
- [ ] I have updated the [changelog](../docs/changelog.md)

.github/workflows/build.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ jobs:
9090

9191
- name: Dockle Container Scanner
9292
uses: erzz/dockle-action@v1
93-
if: ${{ contains(github.ref, 'refs/heads/main') || contains(github.head_ref, 'release') }}
93+
if: ${{ contains(github.ref, 'refs/heads/main') || contains(github.head_ref, 'release/') }}
9494
with:
9595
image: ${{ fromJSON(steps.meta.outputs.json).tags[0] }}
9696
report-format: sarif
@@ -100,28 +100,28 @@ jobs:
100100
# Disable upload due to bug https://github.com/erzz/dockle-action/issues/18
101101
# - name: Upload Dockle SARIF Report
102102
# uses: github/codeql-action/upload-sarif@v2
103-
# if: ${{ contains(github.ref, 'refs/heads/main') || contains(github.head_ref, 'release') }}
103+
# if: ${{ contains(github.ref, 'refs/heads/main') || contains(github.head_ref, 'release/') }}
104104
# with:
105105
# sarif_file: dockle-report.sarif
106106

107107
- name: Trivy Vulnerability Scanner
108108
uses: aquasecurity/trivy-action@master
109-
if: ${{ contains(github.ref, 'refs/heads/main') || contains(github.head_ref, 'release') }}
109+
if: ${{ contains(github.ref, 'refs/heads/main') || contains(github.head_ref, 'release/') }}
110110
with:
111111
image-ref: ${{ fromJSON(steps.meta.outputs.json).tags[0] }}
112112
format: 'sarif'
113113
output: 'trivy-results.sarif'
114114

115115
- name: Upload Trivy SARIF Report
116116
uses: github/codeql-action/upload-sarif@v2
117-
if: ${{ contains(github.ref, 'refs/heads/main') || contains(github.head_ref, 'release') }}
117+
if: ${{ contains(github.ref, 'refs/heads/main') || contains(github.head_ref, 'release/') }}
118118
with:
119119
sarif_file: 'trivy-results.sarif'
120120

121121
- name: Anchore Container Scan
122122
id: anchore-scan
123123
uses: anchore/scan-action@v3.3.0
124-
if: ${{ contains(github.ref, 'refs/heads/main') || contains(github.head_ref, 'release') }}
124+
if: ${{ contains(github.ref, 'refs/heads/main') || contains(github.head_ref, 'release/') }}
125125
with:
126126
image: ${{ fromJSON(steps.meta.outputs.json).tags[0] }}
127127
fail-build: true
@@ -130,7 +130,7 @@ jobs:
130130

131131
- name: Upload Anchore Scan SARIF Report
132132
uses: github/codeql-action/upload-sarif@v2
133-
if: ${{ contains(github.ref, 'refs/heads/main') || contains(github.head_ref, 'release') }}
133+
if: ${{ contains(github.ref, 'refs/heads/main') || contains(github.head_ref, 'release/') }}
134134
with:
135135
sarif_file: ${{ steps.anchore-scan.outputs.sarif }}
136136
token: ${{ secrets.GITHUB_TOKEN }}

CONTRIBUTING.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,18 @@ If your package is on the Amber list please make a maintainer aware and let them
138138
139139
If your package is on the Red list you will have to look for another package that achieves the same aim with a more permissive license.
140140
141+
142+
##### Vulnerability Scanning
143+
144+
The [Build](.github/workflows/build.yml) CI worklfow builds & publishes container images to [GitHub Packages](https://github.com/orgs/Project-MONAI/packages?repo_name=monai-deploy-workflow-manager).
145+
The CI workflow also performs container scanning using [Trivy](https://github.com/marketplace/actions/aqua-security-trivy#using-trivy-with-github-code-scanning), [Dockle](https://github.com/marketplace/actions/dockle-action), and [Anchore](https://github.com/marketplace/actions/anchore-container-scan) for the `main` branch and the `release/*` branches.
146+
147+
If any vulnerability is discovered without any mitigation or is false positive, please open a new GitHub issue to track the vulnerability before adding to the allowlists:
148+
149+
- Trivy: `.trivyignore`, include URL to the GitHub issue as comment
150+
151+
Once a vulnerability is mitigated or fixed, update the allowlists to remove it.
152+
141153
#### Test Projects
142154

143155
All C# projects reside in their directory, including a `Tests/` subdirectory.
@@ -154,11 +166,21 @@ MONAI Deploy Workflow Manager functionality has plenty of unit tests from which
154166

155167
Documentation for MONAI Deploy Workflow Manager is located at `docs/` and requires [DocFX](https://dotnet.github.io/docfx/) to build.
156168

169+
- *docs/index.md*: documentation landing page
170+
- *docs/setup/*: component installation & configuration pages
171+
- *docs/api/rest*: RESTful APIs
172+
173+
Note: *docfx* generated C# APIs based on [XML documentation comments](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/xmldoc/) written in the source code.
174+
To configure which C# projects to include in the documentation, edit the **metadata>src>files** section in the *docs/docfx.json* file.
175+
157176
Please follow the [instructions](https://dotnet.github.io/docfx/tutorial/docfx_getting_started.html#2-use-docfx-as-a-command-line-tool) to install Mono and download the DocFX command-line tool to build the documentation.
158177

159178
```bash
160179
[path-to]/docfx.exe docs/docfx.json
161180
```
181+
##### Updating Changelog
182+
183+
The changelog is located in `docs/changelog.md` and should be updated for every release to include new features, bug fixes and breaking changes.
162184

163185
#### Automatic code formatting
164186

0 commit comments

Comments
 (0)