Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strictnullchecks 1 #1140

Merged
merged 39 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
05a7d4f
reduced nullable errors from 500ish files to 268 files
Richard87 Nov 19, 2024
eee5b2f
reduced nullable errors from 500ish files to 260 files
Richard87 Nov 19, 2024
7970dd9
Merge branch 'refs/heads/master' into strictnullchecks-1
Richard87 Nov 22, 2024
853c438
reduced nullable errors from 500ish files to errors to 170 errors in …
Richard87 Nov 22, 2024
838f2f4
fix status badges types
Richard87 Nov 25, 2024
c9c59de
fix pipeline runs types
Richard87 Nov 25, 2024
fee8a86
fix active application overview
Richard87 Nov 25, 2024
85c3095
fix active job-overview
Richard87 Nov 25, 2024
8220978
fix environment cards
Richard87 Nov 25, 2024
96fbe8b
fix most other errors
Richard87 Nov 25, 2024
862d199
fix create-job-form
Richard87 Nov 25, 2024
73683a6
fix react-async types
Richard87 Nov 25, 2024
36654b6
fix default value
Richard87 Nov 26, 2024
c200d72
map strict checks that are still falining (strictFunctionTypes and n…
Richard87 Nov 27, 2024
ef27613
enforce strictFunctionTypes (mostly)
Richard87 Nov 27, 2024
f5468ee
enforce strictFunctionTypes (mostly)
Richard87 Nov 27, 2024
ff1a0a9
enforce strictFunctionTypes, cleanup config
Richard87 Nov 27, 2024
d17e93b
wip noImplicitAny
Richard87 Nov 27, 2024
725a5a1
Merge branch 'master' into strictnullchecks-1
Richard87 Nov 27, 2024
306abbc
remove prop types
Richard87 Nov 27, 2024
f3f3069
enfore no implicit any
Richard87 Nov 27, 2024
b7a6143
enfore no implicit any
Richard87 Nov 27, 2024
b361096
revert changes to proxy
Richard87 Nov 28, 2024
1ab2b72
bugfix config local
Richard87 Nov 28, 2024
37875d9
Add forwardRef to externalLink, fix mergeconflic
Richard87 Nov 28, 2024
1b5f478
fix ExternalLink icon type
Richard87 Nov 28, 2024
dcd4c7a
fix ExternalLink icon type
Richard87 Nov 28, 2024
eb14912
fix ExternalLink icon type
Richard87 Nov 28, 2024
0a9e370
update description
Richard87 Nov 28, 2024
4091de2
update logic in restart job/batchjob
Richard87 Nov 28, 2024
91af1f3
fix valid regex and branch name
Richard87 Nov 28, 2024
a281544
let type of genericStatusBadge be undefined
Richard87 Nov 28, 2024
fb32416
fix external dns certificates logic
Richard87 Nov 28, 2024
1c680bf
fix dev test, simplify logic
Richard87 Nov 28, 2024
ea0985a
fix dev test, simplify logic
Richard87 Nov 28, 2024
d0a2c4e
remove unneed ts-expect-error
Richard87 Nov 28, 2024
a423ac0
Update src/store/ms-graph-api.ts
Richard87 Dec 2, 2024
005e16d
Update src/store/ms-graph-api.ts
Richard87 Dec 2, 2024
a837316
replace replica.created with replica.startTIme
Richard87 Dec 2, 2024
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
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ gen-scan-api:
gen-log-api:
npm run "apigen:log"

.PHONY: gen-local-radix-log-api
gen-local-radix-log-api:
OVERRIDE_RADIX_LOG_API_SWAGGER_URL=http://localhost:8003/swagger/doc.json npm run "apigen:log"

.PHONY: gen-service-now-api
gen-service-now-api:
npm run "apigen:service-now"
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ services:
- radix
ports:
- "8000:8000" # In prod, this is served on port 443
depends_on:
- auth-state

# for use with development
auth-state:
Expand Down
24 changes: 20 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@
"test": "vitest watch",
"test:no-watch": "vitest run",
"test:coverage": "vitest --coverage",
"lint": "biome check",
"lint": "biome check && tsc --noEmit --skipLibCheck",
"lint-fix": "biome check --write",
"lint-ts": "tsc --noEmit --skipLibCheck",
"lint:watch": "watch --color -n 1 biome lint --colors=force",
"lint-ts:watch": "tsc --noEmit --skipLibCheck --watch",
"lint-strict": "tsc --noEmit --skipLibCheck --strictNullChecks",
"deps": "npm run deps:license && npm run deps:stale",
"deps:license": "node scripts/deps-license-check.js",
"deps:stale": "node scripts/deps-stale-check.js",
Expand All @@ -40,9 +39,8 @@
"date-fns": "^4.1.0",
"http-status-codes": "^2.3.0",
"jdenticon": "^3.3.0",
"lodash": "^4.17.21",
"lodash-es": "^4.17.21",
"nanoid": "^5.0.7",
"prop-types": "^15.8.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-google-charts": "^4.0.7",
Expand All @@ -63,7 +61,7 @@
"@remix-run/web-fetch": "^4.4.2",
"@rtk-query/codegen-openapi": "^1.2.0",
"@testing-library/react": "^16.0.1",
"@types/lodash": "^4.17.9",
"@types/lodash-es": "^4.17.9",
"@types/react": "^18.3.10",
"@types/react-dom": "^18.3.0",
"@types/react-router-dom": "^5.3.3",
Expand Down
2 changes: 1 addition & 1 deletion radixconfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ spec:
CLUSTER_EGRESS_IPS: undefined # Comma separated list of IPs of all Public IP Prefixes assigned to the ClusterType (production, playground, development)
CLUSTER_INGRESS_IPS: undefined # Comma separated list of IPs of all Public IP Prefixes assigned to the ClusterType (production, playground, development)
OAUTH2_AUTHORITY: "https://login.microsoftonline.com/3aa4a235-b6e2-48d5-9195-7fcf05b459b0"
SERVICENOW_PROXY_SCOPES: "1b4a22f1-d4a1-4b6a-81b2-fd936daf1786/Application.Read"
SERVICENOW_PROXY_SCOPES: "1b4a22f1-d4a1-4b6a-81b2-fd936daf1786/Application.Read" # scopes must be seperated by comma
CLUSTER_OIDC_ISSUER_URL: ""
CMDB_CI_URL: "https://equinor.service-now.com/selfservice?id=form&table=cmdb_ci_spkg&sys_id={CIID}"
secrets:
Expand Down
8 changes: 0 additions & 8 deletions src/components/alert/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { clsx } from 'clsx';
import * as PropTypes from 'prop-types';
import type { FunctionComponent, PropsWithChildren, ReactNode } from 'react';

import './style.css';
Expand Down Expand Up @@ -36,10 +35,3 @@ export const Alert: FunctionComponent<PropsWithChildren<AlertProps>> = ({
)}
</div>
);

Alert.propTypes = {
children: PropTypes.node,
actions: PropTypes.node,
className: PropTypes.string,
type: PropTypes.oneOf<AlertType>(['info', 'success', 'warning', 'danger']),
};
14 changes: 0 additions & 14 deletions src/components/alerting/alerting-actions.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { Button } from '@equinor/eds-core-react';
import * as PropTypes from 'prop-types';

import './style.css';
import type { AlertingConfig } from '../../store/radix-api';

Expand Down Expand Up @@ -66,15 +64,3 @@ export const AlertingActions = ({
</div>
);
};

AlertingActions.propTypes = {
isSaving: PropTypes.bool.isRequired,
isEdit: PropTypes.bool.isRequired,
config: PropTypes.object.isRequired as PropTypes.Validator<AlertingConfig>,

onSave: PropTypes.func.isRequired,
onCancel: PropTypes.func.isRequired,
onEdit: PropTypes.func.isRequired,
onEnable: PropTypes.func.isRequired,
onDisable: PropTypes.func.isRequired,
};
5 changes: 0 additions & 5 deletions src/components/alerting/alerting-overview.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Icon, Typography } from '@equinor/eds-core-react';
import { check_circle_outlined, warning_outlined } from '@equinor/eds-icons';
import * as PropTypes from 'prop-types';
import { Fragment, type FunctionComponent } from 'react';
import type { AlertingConfig } from '../../store/radix-api';

Expand Down Expand Up @@ -34,7 +33,3 @@ export const AlertingConfigStatus: FunctionComponent<{
</>
);
};

AlertingConfigStatus.propTypes = {
config: PropTypes.object.isRequired as PropTypes.Validator<AlertingConfig>,
};
13 changes: 8 additions & 5 deletions src/components/alerting/buildEditConfig.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { cloneDeep } from 'lodash';
import { cloneDeep } from 'lodash-es';
import type {
AlertingConfig,
ReceiverConfigMap,
UpdateAlertingConfig,
UpdateReceiverConfigSecretsMap,
} from '../../store/radix-api';

const buildReceiverSecrets = (receviers: ReceiverConfigMap) => {
const secretsConfig = {};
const secretsConfig: UpdateReceiverConfigSecretsMap = {};
if (!receviers) {
return secretsConfig;
}
Expand All @@ -25,8 +26,10 @@ export const buildEditConfig = (
config: AlertingConfig
): UpdateAlertingConfig => {
return {
alerts: cloneDeep(config.alerts),
receivers: cloneDeep(config.receivers),
receiverSecrets: buildReceiverSecrets(config.receivers),
alerts: config.alerts ? cloneDeep(config.alerts) : [],
receivers: config.receivers ? cloneDeep(config.receivers) : {},
receiverSecrets: config.receivers
? buildReceiverSecrets(config.receivers)
: {},
};
};
9 changes: 0 additions & 9 deletions src/components/alerting/edit-alerting.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { TextField } from '@equinor/eds-core-react';
import * as PropTypes from 'prop-types';
import type {
ChangeEvent,
Dispatch,
Expand Down Expand Up @@ -37,11 +36,3 @@ export const UpdateSlackReceivers: FunctionComponent<{
))}
</>
);

UpdateSlackReceivers.propTypes = {
alertingConfig: PropTypes.object
.isRequired as PropTypes.Validator<AlertingConfig>,
changedReceivers: PropTypes.object
.isRequired as PropTypes.Validator<ChangedReceivers>,
setChangedReceivers: PropTypes.func.isRequired,
};
11 changes: 1 addition & 10 deletions src/components/alerting/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Icon, Typography } from '@equinor/eds-core-react';
import { info_circle } from '@equinor/eds-icons';
import * as PropTypes from 'prop-types';
import { useState } from 'react';

import { AlertingActions } from './alerting-actions';
Expand Down Expand Up @@ -36,7 +35,7 @@ export const Alerting = ({
{}
);
const onSave = async () => {
const config: UpdateAlertingConfig = buildEditConfig(alertingConfig);
const config = buildEditConfig(alertingConfig);
Object.entries(changedReceivers).forEach(([receiver, url]) => {
config.receiverSecrets[receiver] = { slackConfig: { webhookUrl: url } };
});
Expand Down Expand Up @@ -88,11 +87,3 @@ export const Alerting = ({
</div>
);
};

Alerting.propTypes = {
isSaving: PropTypes.bool.isRequired,
alertingConfig: PropTypes.object.isRequired,
enableAlerting: PropTypes.func.isRequired,
updateAlerting: PropTypes.func.isRequired,
disableAlerting: PropTypes.func.isRequired,
};
10 changes: 0 additions & 10 deletions src/components/app-config-ad-groups/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import { AuthenticatedTemplate } from '@azure/msal-react';
import { Typography } from '@equinor/eds-core-react';
import * as PropTypes from 'prop-types';

import { ADGroups, type HandleAdGroupsChangeCB } from '../graph/adGroups';

import './style.css';

interface Props {
Expand Down Expand Up @@ -36,10 +33,3 @@ export const AppConfigAdGroups = ({
</AuthenticatedTemplate>
</div>
);

AppConfigAdGroups.propTypes = {
labeling: PropTypes.string.isRequired,
adGroups: PropTypes.arrayOf(PropTypes.string),
isDisabled: PropTypes.bool,
onChange: PropTypes.func.isRequired,
};
15 changes: 9 additions & 6 deletions src/components/app-config-ci/ci-popover.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
import { Popover, Typography } from '@equinor/eds-core-react';
import { type FunctionComponent, useEffect } from 'react';
import { useEffect } from 'react';

import type { Application } from '../../store/service-now-api';
import { configVariables } from '../../utils/config';
import { ExternalLink } from '../link/external-link';

export interface ConfigurationItemPopoverProps {
open?: boolean;
open: boolean;
onClose: () => unknown;
anchorEl: HTMLElement;
anchorEl?: HTMLElement;
configurationItem: Application;
}

function urlStringForCI(id: string): string {
return configVariables.CMDB_CI_URL.replace(/{CIID}/g, encodeURIComponent(id));
}

export const ConfigurationItemPopover: FunctionComponent<
ConfigurationItemPopoverProps
> = ({ open, onClose, anchorEl, configurationItem }) => {
export const ConfigurationItemPopover = ({
open,
onClose,
anchorEl,
configurationItem,
}: ConfigurationItemPopoverProps) => {
const externalUrl = urlStringForCI(configurationItem.id);

useEffect(() => {
Expand Down
46 changes: 0 additions & 46 deletions src/components/app-config-ci/ci-select.tsx

This file was deleted.

Loading