Skip to content

Commit

Permalink
onboard to automated consumer testing
Browse files Browse the repository at this point in the history
Signed-off-by: Austin Sullivan <ausulliv@redhat.com>
  • Loading branch information
wise-king-sullyman committed Oct 10, 2023
1 parent bc0fe72 commit d8c733f
Show file tree
Hide file tree
Showing 19 changed files with 58 additions and 34 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/ci-actions.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
name: CI

on:
push:
branches:
- main
- "v[0-9]+.[0-9]+.[0-9]+"
- "release-*"
pull_request:
branches:
- main
Expand All @@ -31,7 +26,7 @@ jobs:
run: ./scripts/verify_lock.mjs

- name: Install
run: npm clean-install --ignore-scripts
run: npm install --ignore-scripts

- name: Lint sources
run: npm run lint
Expand Down
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@dnd-kit/sortable": "^7.0.2",
"@hookform/resolvers": "^2.9.11",
"@hot-loader/react-dom": "^17.0.2",
"@migtools/lib-ui": "^9.0.3",
"@pf-consumer-testing/lib-ui": "1.0.1",
"@patternfly/patternfly": "^5.0.2",
"@patternfly/react-charts": "^7.1.0",
"@patternfly/react-code-editor": "^5.1.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from "react";
import { useSessionStorage } from "@migtools/lib-ui";
import { useSessionStorage } from "@pf-consumer-testing/lib-ui";
import {
FilterCategory,
FilterValue,
Expand Down Expand Up @@ -56,7 +56,7 @@ export const serializeFilterUrlParams = <TFilterCategoryKey extends string>(
};

export const deserializeFilterUrlParams = <
TFilterCategoryKey extends string
TFilterCategoryKey extends string,
>(serializedParams: {
filters?: string | null;
}): Partial<Record<TFilterCategoryKey, FilterValue>> => {
Expand All @@ -69,7 +69,7 @@ export const deserializeFilterUrlParams = <

export const useFilterUrlParams = <
TFilterCategoryKey extends string,
TURLParamKeyPrefix extends string = string
TURLParamKeyPrefix extends string = string,
>({
urlParamKeyPrefix,
}: IExtraArgsForURLParamHooks<TURLParamKeyPrefix> = {}): IFilterState<TFilterCategoryKey> => {
Expand Down
13 changes: 8 additions & 5 deletions client/src/app/hooks/table-controls/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { TableProps } from "@patternfly/react-table";
import { ISelectionStateArgs, useSelectionState } from "@migtools/lib-ui";
import {
ISelectionStateArgs,
useSelectionState,
} from "@pf-consumer-testing/lib-ui";
import { DisallowCharacters, KeyWithValueType } from "@app/utils/type-utils";
import {
IFilterStateArgs,
Expand Down Expand Up @@ -38,7 +41,7 @@ export interface ITableControlCommonArgs<
TItem,
TColumnKey extends string,
TSortableColumnKey extends TColumnKey,
TFilterCategoryKey extends string = string
TFilterCategoryKey extends string = string,
> extends IFilterStateArgs<TItem, TFilterCategoryKey>,
ISortStateArgs<TSortableColumnKey>,
IPaginationStateArgs {
Expand All @@ -54,7 +57,7 @@ export interface ITableControlCommonArgs<
// - Extra args needed for useTableControlUrlParams and each concern-specific use*UrlParams hook
// - Does not require any state or query values in scope
export interface IExtraArgsForURLParamHooks<
TURLParamKeyPrefix extends string = string
TURLParamKeyPrefix extends string = string,
> {
urlParamKeyPrefix?: DisallowCharacters<TURLParamKeyPrefix, ":">;
}
Expand All @@ -75,7 +78,7 @@ export type IUseLocalTableControlStateArgs<
TItem,
TColumnKey extends string,
TSortableColumnKey extends TColumnKey,
TFilterCategoryKey extends string = string
TFilterCategoryKey extends string = string,
> = ITableControlCommonArgs<
TItem,
TColumnKey,
Expand All @@ -99,7 +102,7 @@ export interface IUseTableControlPropsArgs<
TItem,
TColumnKey extends string,
TSortableColumnKey extends TColumnKey,
TFilterCategoryKey extends string = string
TFilterCategoryKey extends string = string,
> extends ITableControlCommonArgs<
TItem,
TColumnKey,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useSelectionState } from "@migtools/lib-ui";
import { useSelectionState } from "@pf-consumer-testing/lib-ui";
import {
getLocalFilterDerivedState,
useFilterState,
Expand Down
2 changes: 1 addition & 1 deletion client/src/app/layout/SidebarApp/SidebarApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { LayoutTheme } from "../LayoutUtils";
import { checkAccess } from "@app/utils/rbac-utils";
import keycloak from "@app/keycloak";

import { useLocalStorage } from "@migtools/lib-ui";
import { useLocalStorage } from "@pf-consumer-testing/lib-ui";
import { LocalStorageKey } from "@app/Constants";
import { FEATURES_ENABLED } from "@app/FeatureFlags";
import { OptionWithValue, SimpleSelect } from "@app/components/SimpleSelect";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from "react";
import { Tag, TagCategory } from "@app/api/models";
import { LabelCustomColor } from "@migtools/lib-ui";
import { LabelCustomColor } from "@pf-consumer-testing/lib-ui";
import { COLOR_HEX_VALUES_BY_NAME } from "@app/Constants";

export const getTagCategoryFallbackColor = (category?: TagCategory) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import { LabelGroup } from "@patternfly/react-core";
import { LabelCustomColor } from "@migtools/lib-ui";
import { LabelCustomColor } from "@pf-consumer-testing/lib-ui";

import { COLOR_HEX_VALUES_BY_NAME } from "@app/Constants";
import type { Archetype, TagCategory, Tag } from "@app/api/models";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import { AxiosError } from "axios";
import { useTranslation } from "react-i18next";
import { useSelectionState } from "@migtools/lib-ui";
import { useSelectionState } from "@pf-consumer-testing/lib-ui";

import {
Button,
Expand Down
2 changes: 1 addition & 1 deletion client/src/app/pages/controls/tags/tags.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import { AxiosError } from "axios";
import { useTranslation } from "react-i18next";
import { useSelectionState } from "@migtools/lib-ui";
import { useSelectionState } from "@pf-consumer-testing/lib-ui";
import {
Button,
ButtonVariant,
Expand Down
2 changes: 1 addition & 1 deletion client/src/app/pages/dependencies/dependencies.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
TableRowContentWithControls,
} from "@app/components/TableControls";
import { useFetchDependencies } from "@app/queries/dependencies";
import { useSelectionState } from "@migtools/lib-ui";
import { useSelectionState } from "@pf-consumer-testing/lib-ui";
import { getHubRequestParams } from "@app/hooks/table-controls";
import { DependencyAppsDetailDrawer } from "./dependency-apps-detail-drawer";
import { useSharedAffectedApplicationFilterCategories } from "../issues/helpers";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useTranslation } from "react-i18next";
import { Toolbar, ToolbarContent, ToolbarItem } from "@patternfly/react-core";
import { Table, Tbody, Td, Th, Thead, Tr } from "@patternfly/react-table";
import spacing from "@patternfly/react-styles/css/utilities/Spacing/spacing";
import { useSelectionState } from "@migtools/lib-ui";
import { useSelectionState } from "@pf-consumer-testing/lib-ui";
import { AnalysisDependency } from "@app/api/models";
import {
getHubRequestParams,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
} from "@patternfly/react-core";
import { useTranslation } from "react-i18next";
import { Table, Tbody, Td, Th, Thead, Tr } from "@patternfly/react-table";
import { useSelectionState } from "@migtools/lib-ui";
import { useSelectionState } from "@pf-consumer-testing/lib-ui";

import { ConditionalRender } from "@app/components/ConditionalRender";
import { AppPlaceholder } from "@app/components/AppPlaceholder";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from "react";
import { Table, Thead, Tr, Th, Tbody, Td } from "@patternfly/react-table";
import { useSelectionState } from "@migtools/lib-ui";
import { useSelectionState } from "@pf-consumer-testing/lib-ui";
import { TableURLParamKeyPrefix } from "@app/Constants";
import { AnalysisFileReport } from "@app/api/models";
import { useFetchIncidents } from "@app/queries/issues";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,8 @@ import {
} from "@patternfly/react-core";
import { Table, Tbody, Td, Th, Thead, Tr } from "@patternfly/react-table";
import spacing from "@patternfly/react-styles/css/utilities/Spacing/spacing";
import { useSelectionState } from "@migtools/lib-ui";
import {
AnalysisFileReport,
AnalysisAppReport,
AnalysisIssue,
} from "@app/api/models";
import { useSelectionState } from "@pf-consumer-testing/lib-ui";
import { AnalysisFileReport, AnalysisIssue } from "@app/api/models";
import {
getHubRequestParams,
useTableControlProps,
Expand Down
2 changes: 1 addition & 1 deletion client/src/app/pages/issues/issues-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
import spacing from "@patternfly/react-styles/css/utilities/Spacing/spacing";
import textStyles from "@patternfly/react-styles/css/utilities/Text/text";
import CubesIcon from "@patternfly/react-icons/dist/esm/icons/cubes-icon";
import { useSelectionState } from "@migtools/lib-ui";
import { useSelectionState } from "@pf-consumer-testing/lib-ui";

import { AppPlaceholder } from "@app/components/AppPlaceholder";
import { OptionWithValue, SimpleSelect } from "@app/components/SimpleSelect";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import React, { useEffect, useState } from "react";
import { useSelectionState, ISelectionState } from "@migtools/lib-ui";
import {
useSelectionState,
ISelectionState,
} from "@pf-consumer-testing/lib-ui";
import { Application } from "@app/api/models";

interface IApplicationSelectionContext extends ISelectionState<Application> {
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

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

27 changes: 27 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:base"],
"enabledManagers": ["npm"],
"rangeStrategy": "bump",
"includeForks": true,
"packageRules": [
{
"packagePatterns": ["*"],
"excludePackagePatterns": ["@patternfly/*"],
"enabled": false
},
{
"datasources": ["npm"],
"packagePatterns": ["@patternfly/*"],
"excludePackageNames": ["@patternfly/documentation-framework", "@patternfly/patternfly-a11y"],
"groupName": "patternfly",
"followTag": "prerelease"
},
{
"datasources": ["npm"],
"matchPackageNames": ["@patternfly/documentation-framework", "@patternfly/patternfly-a11y"],
"groupName": "patternfly",
"followTag": "latest"
}
]
}

0 comments on commit d8c733f

Please sign in to comment.