Skip to content

Commit dcad440

Browse files
Merge branch 'main' into samgst/bump-252
2 parents 72e7805 + b8b79ac commit dcad440

File tree

8 files changed

+90
-12
lines changed

8 files changed

+90
-12
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type" : "bugfix",
3+
"description" : "change to use promptStickyCard to for image verification notification"
4+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Qodana - Duplicated Code
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ main, feature/** ]
7+
pull_request:
8+
branches: [ '**' ]
9+
10+
concurrency:
11+
group: ${{ github.workflow }}${{ github.event.pull_request.number || github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
qodana:
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: read
19+
# PR check
20+
checks: write
21+
# PR comments
22+
pull-requests: write
23+
# SARIF upload
24+
security-events: write
25+
steps:
26+
- uses: actions/checkout@v4
27+
with:
28+
ref: ${{ github.event.pull_request.head.sha }}
29+
fetch-depth: 0
30+
- name: Maximize Build Space
31+
if: runner.os == 'Linux'
32+
uses: jlumbroso/free-disk-space@main
33+
with:
34+
tool-cache: false
35+
large-packages: false
36+
- name: 'Qodana Scan'
37+
uses: JetBrains/[email protected]
38+
env:
39+
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
40+
with:
41+
# --config points to the DuplicatedCode-only Qodana config
42+
args:
43+
--config,qodana-configs/duplicated-code/qodana.yaml
44+
cache-default-branch-only: true
45+
# pr-mode off means that the whole repo should be checked for duplicate code, instead of just copy/pastes within the PR
46+
pr-mode: false
47+
- uses: github/codeql-action/upload-sarif@v3
48+
with:
49+
sarif_file: ${{ runner.temp }}/qodana/results/qodana.sarif.json

.github/workflows/qodana-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
tool-cache: false
3535
large-packages: false
3636
- name: 'Qodana Scan'
37-
uses: JetBrains/qodana-action@v2024.2.3
37+
uses: JetBrains/qodana-action@v2025.1.1
3838
env:
3939
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
4040
with:

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/toolwindow/AmazonQPanel.kt

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,15 @@ class AmazonQPanel(val project: Project, private val scope: CoroutineScope) : Di
173173
0
174174
)
175175

176-
val errorJson = OBJECT_MAPPER.writeValueAsString(errorMessages)
177-
browserInstance.jcefBrowser.cefBrowser.executeJavaScript(
178-
"window.handleNativeNotify('$errorJson')",
179-
browserInstance.jcefBrowser.cefBrowser.url,
180-
0
181-
)
176+
if (errorMessages.isNotEmpty()) {
177+
val errorJson = OBJECT_MAPPER.writeValueAsString(errorMessages)
178+
browserInstance.jcefBrowser.cefBrowser.executeJavaScript(
179+
"window.handleNativeNotify('$errorJson')",
180+
browserInstance.jcefBrowser.cefBrowser.url,
181+
0
182+
)
183+
}
184+
182185
dtde.dropComplete(true)
183186
} else {
184187
dtde.dropComplete(false)

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/webview/Browser.kt

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,19 @@ class Browser(parent: Disposable, private val webUri: URI, val project: Project)
175175
176176
window.handleNativeNotify = function(errorMessages) {
177177
const messages = JSON.parse(errorMessages);
178-
messages.forEach(msg => {
179-
qChat.notify({
180-
content: msg
181-
})
182-
});
178+
let message = messages.join('\n');
179+
qChat.updateStore(qChat.getSelectedTabId(), {
180+
promptInputStickyCard: {
181+
messageId: 'image-verification-banner',
182+
header: {
183+
icon: 'warning',
184+
iconStatus: 'warning',
185+
body: '### Invalid Image',
186+
},
187+
body: message,
188+
canBeDismissed: true,
189+
},
190+
})
183191
};
184192
}
185193
</script>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
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).
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 1.0
2+
linter: jetbrains/qodana-jvm-community:latest
3+
projectJDK: "21"
4+
bootstrap: ./gradlew :plugin-core:sdk-codegen:generateSdks :plugin-core:jetbrains-community:generateTelemetry :plugin-toolkit:jetbrains-rider:generateModels
5+
exclude:
6+
- name: All
7+
dot-net:
8+
solution: ReSharper.AWS.sln
9+
include:
10+
- name: DuplicatedCode

qodana.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,4 @@ include:
6161
- name: SimplifiableServiceRetrieving
6262
- name: QuickFixGetFamilyNameViolation
6363
- name: TokenSetInParserDefinition
64+
- name: DuplicatedCode

0 commit comments

Comments
 (0)