Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
aab33a9
chore(apps): fix comparison between inconvertible types
ArtieReus Mar 20, 2026
bd48d41
chore(apps): fix comparison between inconvertible types
ArtieReus Mar 20, 2026
8f6bdc1
chore(apps): fix implicit operand conversion
ArtieReus Mar 20, 2026
107d0f6
fix(apps): remove redundant conditional expressions
ArtieReus Mar 20, 2026
b6fc2be
fix(apps): remove useless expressions and fix zustand set call syntax
ArtieReus Mar 20, 2026
ffed9be
fix(apps): remove duplicate namespace property in teams store
ArtieReus Mar 20, 2026
3a8decd
fix(apps): declare errMsg as local variable in parseError function
ArtieReus Mar 20, 2026
294e306
fix(greenhouse): remove unused variable in JSON validation function
ArtieReus Mar 20, 2026
aab5f34
chore(ci): adds changeset
ArtieReus Mar 20, 2026
76bd615
chore(apps): fix link
ArtieReus Mar 20, 2026
6391841
chore(supernova): fix lint
ArtieReus Mar 20, 2026
979f8d6
chore(ui): fix test
ArtieReus Mar 20, 2026
1e24eb6
chore(supernova): fix comparation
ArtieReus Mar 20, 2026
76847c2
chore(ci): adapt changeset
ArtieReus Mar 20, 2026
f23e024
Merge branch 'main' into artie-fix-more-codeql-findings
ArtieReus Mar 20, 2026
57a5689
Merge branch 'main' into artie-fix-more-codeql-findings
ArtieReus Mar 23, 2026
4759643
Merge branch 'main' into artie-fix-more-codeql-findings
ArtieReus Mar 23, 2026
636c97e
Merge branch 'main' into artie-fix-more-codeql-findings
ArtieReus Mar 23, 2026
ab21fa5
chore(supernova): remove as
ArtieReus Mar 24, 2026
ccee003
Merge branch 'main' into artie-fix-more-codeql-findings
ArtieReus Mar 24, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/beige-ravens-find.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@cloudoperators/juno-ui-components": patch
"@cloudoperators/juno-app-greenhouse": patch
"@cloudoperators/juno-app-supernova": patch
"@cloudoperators/juno-app-doop": patch
---

Resolves all CodeQL static analysis warnings to improve code quality, reliability, and maintainability. These fixes address potential bugs, redundant code, and anti-patterns detected by automated code scanning.
3 changes: 1 addition & 2 deletions apps/doop/src/components/Highlighter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,7 @@ const Highlighter = () => {
React.useEffect(() => {
const observers = createObservers((mutations: any) => {
for (const mutation of mutations) {
// @ts-expect-error TS(2367) FIXME: This condition will always return 'false' since th... Remove this comment to see the full error message
if (!mutation.type === "childList") continue
if (mutation.type !== "childList") continue

// ignore changes to search nodes
const addedOrRemovedNodes = Array.from(mutation.addedNodes).concat(Array.from(mutation.removedNodes))
Expand Down
2 changes: 1 addition & 1 deletion apps/doop/src/lib/filterViolations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const filterByActiveFilters = (violationGroups: any[], clusterIdentities: any[],
true
)
)
found = found && constraint.violation_groups?.length > 0
found = (constraint.violation_groups?.length ?? 0) > 0
}

// ############ CLUSTER FILTERS ############
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import { useClusterApi } from "../hooks/useClusterApi"

const ClusterEdit: React.FC<any> = () => {
const clusterInEdit = useStore((state: any) => state.clusterInEdit)
clusterInEdit?.spec
const setClusterInEdit = useStore((state: any) => state.setClusterInEdit)

const [submitMessage, setSubmitResultMessage] = React.useState<ResultMessage>({ message: "", ok: false })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ export const OptionInput: React.FC<OptionInputProps> = (props: OptionInputProps)
const [errortext, setErrorText] = useState<string>("")

const handleJsonValidation = (value: string) => {
let object
try {
object = JSON.parse(value)
JSON.parse(value)
} catch (e) {
setValid(false)
setErrorText("Invalid JSON")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ export default () =>
currentTeam: "",
defaultTeam: "",
teamMemberships: [],
// @ts-expect-error TS(1117): An object literal cannot have multiple properties ... Remove this comment to see the full error message
namespace: "",

actions: {
initialize: (endpoint: any, token: any, namespace: any, userGroup: any) =>
Expand Down
5 changes: 1 addition & 4 deletions apps/greenhouse/src/lib/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,15 @@
*/

export const parseError = (error: any) => {
let errMsg: string
if (error?.message) {
// @ts-expect-error TS(2304): Cannot find name 'errMsg'.
errMsg = error?.message
try {
// @ts-expect-error TS(2304): Cannot find name 'errMsg'.
errMsg = JSON.parse(error?.message).msg
} catch (error) {
console.debug(error)
}
// @ts-expect-error TS(2304): Cannot find name 'errMsg'.
} else errMsg = error.toString()
// @ts-expect-error TS(2304): Cannot find name 'errMsg'.
return errMsg
}

Expand Down
2 changes: 1 addition & 1 deletion apps/supernova/src/components/alerts/AlertStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const AlertStatus = ({ alert }: any) => {

return (
<div className="cursor-default">
{alert && <span>{alert?.status?.state}</span>}
{alert?.status?.state && <span>{alert.status.state}</span>}
{inhibitor && (
<div className="text-xs mt-2">
<Stack direction="vertical">
Expand Down
18 changes: 10 additions & 8 deletions apps/supernova/src/lib/createFiltersSlice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,20 @@ const parsePredefinedFilters = (predefinedFilters: any[]): FilterState["predefin
}

const parseInitialFilters = (
initialFilters: Record<string, string[]>,
initialFilters: Record<string, string[]> | null | undefined,
filterLabels: string[]
): Record<string, string[]> => {
if (!initialFilters) return {}

if (typeof initialFilters !== "object" || initialFilters === null) {
if (typeof initialFilters !== "object" || Array.isArray(initialFilters)) {
console.warn("[supernova]::parseInitialFilters: initialFilters object is not an object")
return {}
}

const validatedFilters: Record<string, string[]> = initialFilters

// Check if all values are arrays
initialFilters = Object.entries(initialFilters).reduce((acc: any, [key, value]) => {
const filteredByType = Object.entries(validatedFilters).reduce((acc: Record<string, string[]>, [key, value]) => {
if (Array.isArray(value)) {
acc[key] = value // valid key-value pair
} else {
Expand All @@ -87,25 +89,25 @@ const parseInitialFilters = (
}, {})

// Check if all keys are in filterLabelValues
if (!Object.keys(initialFilters).every((key) => filterLabels.includes(key))) {
if (!Object.keys(filteredByType).every((key) => filterLabels.includes(key))) {
console.warn(
"[supernova]::parseInitialFilters: Some keys of the initialFilters object are not valid filter labels. They must be configured as filterLabels first. Using only valid keys."
)

// filter out the keys that are not in filterLabels, return the rest
// this will ensure that at least the valid keys are used as initial filters
const filtered = Object.keys(initialFilters)
const filtered = Object.keys(filteredByType)
.filter((key) => filterLabels.includes(key))
.reduce((obj, key) => {
.reduce<Record<string, string[]>>((obj, key) => {
return {
...obj,
[key]: initialFilters[key],
[key]: filteredByType[key],
}
}, {})
return filtered
}

return initialFilters
return filteredByType
}

const parseActivePredefinedFilter = (predefinedFilters: any): string | null => {
Expand Down
18 changes: 10 additions & 8 deletions apps/supernova/src/lib/createSilencesSlice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,16 @@ const createSilencesSlice: (options?: Record<string, any>) => StateCreator<AppSt

setSilences: ({ items }) => {
if (!items) return
;(set((state: any) => ({
silences: {
...state.silences,
items: items,
updatedAt: Date.now(),
},
})),
false)
set(
(state: any) => ({
silences: {
...state.silences,
items: items,
updatedAt: Date.now(),
},
}),
false
)
},

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,12 @@ describe("ComboBox", () => {
await waitFor(() =>
render(
<AppShellProvider shadowRoot={false}>
<ComboBox id="My Id" />
<ComboBox id="my-id" />
</AppShellProvider>
)
)
expect(screen.getByRole("combobox")).toBeInTheDocument()
expect(screen.getByRole("combobox")).toHaveAttribute("id", "My Id")
expect(screen.getByRole("combobox")).toHaveAttribute("id", "my-id")
})

test("renders the id of the ComboBox input as the for attribute of the label", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ describe("Message component", () => {
})

test("renders the component with all provided props", () => {
render(<Message data-testid="my-message" id="My shiny little Message" />)
expect(screen.getByTestId("my-message")).toHaveAttribute("id", "My shiny little Message")
render(<Message data-testid="my-message" id="my-shiny-little-message" />)
expect(screen.getByTestId("my-message")).toHaveAttribute("id", "my-shiny-little-message")
})
})

Expand Down
4 changes: 2 additions & 2 deletions packages/ui-components/src/components/Toast/Toast.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ describe("Toast", () => {
})

test("renders all props as passed", () => {
render(<Toast data-testid="my-toast" id="My shiny little Message" />)
expect(screen.getByTestId("my-toast")).toHaveAttribute("id", "My shiny little Message")
render(<Toast data-testid="my-toast" id="my-shiny-little-message" />)
expect(screen.getByTestId("my-toast")).toHaveAttribute("id", "my-shiny-little-message")
})
})
Loading