Skip to content

Commit e7f7166

Browse files
committed
Updates - we may have to YOLO push this to get it to work for the first time
1 parent 026ee10 commit e7f7166

File tree

3 files changed

+10240
-10225
lines changed

3 files changed

+10240
-10225
lines changed

.github/workflows/qodana-check-duplicatedcode.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,24 +33,19 @@ jobs:
3333
with:
3434
tool-cache: false
3535
large-packages: false
36-
- name: Test ls command
37-
run: ls $GITHUB_WORKSPACE
38-
- name: test more
39-
run: ls $GITHUB_WORKSPACE/qodana-configs
40-
- name: test more more
41-
run: ls $GITHUB_WORKSPACE/qodana-configs/duplicated-code
42-
- name: test more more more
43-
run: cat $GITHUB_WORKSPACE/qodana-configs/duplicated-code/qodana.yaml
44-
- name: test more more more more
45-
run: cd $GITHUB_WORKSPACE/qodana-configs/duplicated-code && pwd
4636
- name: 'Qodana Scan'
4737
uses: JetBrains/[email protected]
4838
env:
4939
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
5040
with:
41+
# --config points to the DuplicatedCode-only Qodana config
42+
# --baseline points to the DuplicatedCode baseline to ensure that only new DuplicatedCode changes are found
43+
# --baseline-include-absent will make this test fail if duplicated code from the baseline is remediated, which calls for a rebaselining.
5144
args:
5245
--config,${{ github.workspace }}/qodana-configs/duplicated-code/qodana.yaml,--baseline,${{ github.workspace }}/qodana-configs/duplicated-code/qodana.sarif.json,--baseline-include-absent
5346
cache-default-branch-only: true
47+
# pr-mode off means that the whole repo should be checked for duplicate code, instead of just copy/pastes within the PR
48+
pr-mode: false
5449
- uses: github/codeql-action/upload-sarif@v3
5550
with:
5651
sarif_file: ${{ runner.temp }}/qodana/results/qodana.sarif.json
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Duplicated Code Check
2+
3+
This check only runs the Qodana DuplicatedCode check and should post duplicated code to [Github PRs](../../.github/workflows/qodana-check-duplicatedcode.yml).
4+
5+
This code currently incorporates a [baseline file](qodana.sarif.json), so existing duplicated code won't fail CI.
6+
* As of July 2025, the GitHub Action will also trigger a failure if duplicates are _removed_ from the baseline, which should trigger a rebaselining.
7+
8+
## Updating the Baseline File
9+
* Locally: run the "Try Code Analysis with Qodana" action
10+
* Temporarily overwrite the full repo's `qodana.yaml` by pasting in the contents of this job's [`qodana.yaml`](qodana.yaml) file
11+
* After the job finishes, in the "Problems" panel:
12+
* Click "Server-Side Analysis" to view the Qodana output
13+
* Click the Globe icon to view the output in the browser
14+
* In the browser:
15+
* Click the "Select All" checkbox over the problem table
16+
* Click "Move selected to baseline"
17+
* In the IDE:
18+
* Overwrite the `qodana.sarif.json` file in this directory with the generated `qodana.sarif.json`
19+
* `git checkout qodana.yaml` to restore the full `qodana.yaml` config
20+
* Commit this `qodana.sarif.json` file along with your updated code

0 commit comments

Comments
 (0)