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

Results page redesign, final part #209

Merged
merged 82 commits into from
Jul 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
f8ad928
Initial prototype of redesigned results page
mgrabovsky Sep 15, 2022
936cc9d
Change fake email address
mgrabovsky Jan 25, 2023
6c7a096
Add TODOs for fake data
mgrabovsky Jan 25, 2023
44aa908
Refactor for readability
mgrabovsky Jan 25, 2023
db45877
Test suites accordion experiment
mgrabovsky Jan 25, 2023
bb2c288
Persist drawer size across sessions
mgrabovsky Jan 25, 2023
16b1743
Don't show border under last test case
mgrabovsky Jan 26, 2023
fd797ae
Move all header components into separate module
mgrabovsky Jan 27, 2023
21fe8fe
Prepare for loading real-world data
mgrabovsky Feb 1, 2023
e2dbaa4
Utility function for timestamp formatting
mgrabovsky Feb 14, 2023
96e1e7a
Display more real information
mgrabovsky Feb 14, 2023
0623945
Adjust styles to match across tabs
mgrabovsky Feb 14, 2023
4b311e9
Load data for user-specified artifact
mgrabovsky Feb 14, 2023
0ca7fde
Show related advisories
mgrabovsky Feb 15, 2023
1bea8d4
Refactor for generality
mgrabovsky Feb 16, 2023
9bfa215
Display real test results
mgrabovsky Feb 16, 2023
64b5964
Persist drawer size across sessions
mgrabovsky Jan 25, 2023
11690e6
Make sure all test results are listed
mgrabovsky Mar 1, 2023
e073218
Factor out function to extract re-run URL
mgrabovsky Mar 2, 2023
a1c4ad4
Make re-run buttons work
mgrabovsky Mar 2, 2023
2a10998
Introduce function to extract docs URL from general state
mgrabovsky Mar 2, 2023
b104fc4
Make documentation links work
mgrabovsky Mar 2, 2023
02bf8d8
Make action links work in drawer
mgrabovsky Mar 2, 2023
d2d3117
Add TODOs for query params parsing
mgrabovsky Mar 6, 2023
127222c
Support more status icons
mgrabovsky Mar 8, 2023
a55699b
Upgrade for React Router v6
mgrabovsky Mar 23, 2023
daa0a96
Support module builds
mgrabovsky Mar 23, 2023
20322ca
Support permalinks for tests
mgrabovsky Mar 27, 2023
4f33bd8
Show waivers in drawer
mgrabovsky Mar 27, 2023
58556bb
Show team name in results table
mgrabovsky Mar 30, 2023
fa1f557
More space after status icon
mgrabovsky Apr 13, 2023
294d4ec
Show message from CI for errored tests
mgrabovsky Apr 13, 2023
fdc21dc
Start factoring out contact info widget
mgrabovsky Apr 13, 2023
553e922
Load contact info from custom metadata
mgrabovsky May 2, 2023
16c0587
More natural contact info
mgrabovsky May 9, 2023
443c618
Export ArchitectureLabel component for reuse
mgrabovsky Jun 27, 2023
2e5f1c4
Display real test suites with phases etc.
mgrabovsky Jun 29, 2023
e1a7aa6
Make waive button component accept testcase name
mgrabovsky Jul 12, 2023
a7d3c79
Support waiving from new results page
mgrabovsky Jul 12, 2023
be89a3c
Remove 'waived' from valid test statuses
mgrabovsky Jul 12, 2023
223ebf2
Refactor DetailsDrawer component
mgrabovsky Jul 13, 2023
6033221
Display known issues correctly
mgrabovsky Jul 13, 2023
59253a8
Add Errata automation tab
mgrabovsky Jul 13, 2023
70331e3
Move new results page to the /artifact/... route
mgrabovsky Jul 13, 2023
aa19bf6
Separate links by a bullet
mgrabovsky Jul 13, 2023
5f8ccd9
Show test case description from custom metadata
mgrabovsky Jul 13, 2023
9b8b433
Show correct artifact type in header
mgrabovsky Jul 14, 2023
9cfb3d3
More utility functions for artifacts
mgrabovsky Jul 18, 2023
2b8debf
Use unique IDs for keys where possible
mgrabovsky Jul 18, 2023
0e8d8a6
Use reusable waive button component
mgrabovsky Jul 19, 2023
5a77a98
Support all artifact types
mgrabovsky Jul 19, 2023
ff1be62
Add function to convert ISO 8601 timestamp to our format
mgrabovsky Jul 19, 2023
c883a88
Generalize and reuse TagsList component
mgrabovsky Jul 19, 2023
bf1b747
Fix waiving on new results page
mgrabovsky Jul 20, 2023
b3330d7
Consistent spacing across pages
mgrabovsky Jul 20, 2023
ff58b4c
Refactor props for simplicity
mgrabovsky Jul 20, 2023
195f989
Display dependencies between tests
mgrabovsky Jul 20, 2023
a2696b0
Show test dependencies
mgrabovsky Jul 21, 2023
8fc1152
Make waiver widget expandable to save space
mgrabovsky Jul 21, 2023
a5486ec
Consistent spacing betwen buttons in drawer panel
mgrabovsky Jul 21, 2023
e39b419
Reuse existing componets for test suites
mgrabovsky Jul 21, 2023
98c72dc
Show dependencies only for non-passing tests
mgrabovsky Jul 21, 2023
29e1f9c
Dispense with a couple of TODOs
mgrabovsky Jul 21, 2023
55b2472
Display dynamic title on new results page
mgrabovsky Jul 21, 2023
1bcb28c
Split out contact widget into separate file
mgrabovsky Jul 24, 2023
8b71a51
Load contact info for missing tests dynamically
mgrabovsky Jul 24, 2023
4e99395
Allow external links to optionally have an icon
mgrabovsky Jul 24, 2023
ef43eff
Show alert if no contact is available for test
mgrabovsky Jul 24, 2023
5f888c6
Show basic test metadata from Greenwave & UMB message
mgrabovsky Jul 24, 2023
05a8d64
Fix test selection dataflow
mgrabovsky Jul 24, 2023
8092cd4
Show UMB thread ID in metadata tab
mgrabovsky Jul 26, 2023
dcd9fa5
Link to logs and run details in Results tab
mgrabovsky Jul 26, 2023
b4147d5
Expand failed test suites atuomatically
mgrabovsky Jul 26, 2023
df621c6
Introduce function to get local artifact subpath
mgrabovsky Jul 26, 2023
d83d708
Basic search results redesign
mgrabovsky Jul 26, 2023
24f6af6
Implement pagination for search results
mgrabovsky Jul 26, 2023
0598bac
Minor refactoring of SearchToolbar
mgrabovsky Jul 26, 2023
e7920a2
Refactor new artifacts list component
mgrabovsky Jul 26, 2023
912582d
Implement multi-artifact view
mgrabovsky Jul 26, 2023
6fa2555
Use correct URL for artifact external link
mgrabovsky Jul 26, 2023
ac6920e
Remove backlink from header
mgrabovsky Jul 26, 2023
0e0f38e
Take care of remaining TODOs
mgrabovsky Jul 26, 2023
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
15 changes: 15 additions & 0 deletions package-lock.json

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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"react-redux": "^8.1.1",
"react-router-dom": "^6.11.2",
"react-scripts": "5.0.1",
"react-use-localstorage": "^3.5.3",
"redux": "^4.2.1",
"typescript": "^5.1.3",
"uuid": "^9.0.0",
Expand All @@ -51,7 +52,7 @@
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"test": "TZ=Europe/Prague react-scripts test",
"eslint": "eslint .",
"eject": "react-scripts eject"
},
Expand Down
13 changes: 6 additions & 7 deletions src/actions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ import * as authSlice from '../slices/authSlice';
import * as filtersSlice from '../slices/filtersSlice';
import * as gatingTestsFormSlice from '../slices/gatingTestsFormSlice';
import * as waiveSlice from '../slices/waiveSlice';
import { Artifact, PayloadRPMBuildType, StateType } from '../artifact';
import { Artifact, PayloadRPMBuildType } from '../artifact';
import { greenwave } from '../config';
import WaiverdbNewMutation from '../mutations/WaiverdbNew';
import { db_field_from_atype, getTestcaseName } from '../utils/artifactUtils';
import { db_field_from_atype } from '../utils/artifactUtils';

export const cleanseGatingFormState = () => gatingTestsFormSlice.cleanse();

Expand Down Expand Up @@ -130,7 +130,7 @@ export const fetchUser = () => {

export const createWaiver = (
artifact: Artifact | undefined,
state: StateType | undefined,
testcase: string | undefined,
) => {
return async (dispatch: AppDispatch, getState: GetState) => {
const { displayName, nameID } = getState().auth;
Expand All @@ -146,7 +146,7 @@ export const createWaiver = (
);
return;
}
dispatch(waiveSlice.createWaiver({ artifact, state }));
dispatch(waiveSlice.createWaiver({ artifact, testcase }));
};
};

Expand All @@ -167,8 +167,8 @@ export const submitWaiver = (reason: string, client: ApolloClient<object>) => {
* get NVR, for modules we need to convert it to 'brew' like form
*/
let waiveError: string;
const { artifact, state } = getState().waive;
if (_.isNil(_.get(artifact, 'payload.nvr')) || _.isNil(state)) {
const { artifact, testcase } = getState().waive;
if (_.isNil(_.get(artifact, 'payload.nvr')) || _.isNil(testcase)) {
return;
}
// NOTE: We know that artifact.payload is not null thanks to the check at the
Expand All @@ -190,7 +190,6 @@ export const submitWaiver = (reason: string, client: ApolloClient<object>) => {
if (artifactType === 'brew-build' && nvr.match(/.*-container-.*/)) {
artifactType = 'redhat-container-image';
}
let testcase: string = getTestcaseName(state);
const product_version = greenwave.decision.product_version(
nvr,
artifactType,
Expand Down
4 changes: 2 additions & 2 deletions src/actions/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*/

import { AlertVariant } from '@patternfly/react-core';
import { Artifact, StateType } from '../artifact';

Check warning on line 22 in src/actions/types.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

'StateType' is defined but never used. Allowed unused vars must match /^_/u
import React from 'react';

export const SST_PAGE = 'SST_PAGE';
Expand Down Expand Up @@ -57,7 +57,7 @@
export interface IStateWaiver {
artifact?: Artifact;
reason: string;
state?: StateType;
testcase?: string;
timestamp?: number;
waiveError: string;
}
Expand Down Expand Up @@ -105,8 +105,8 @@
}

export interface CreateWaiverPayload {
state: StateType | undefined;
artifact: Artifact | undefined;
testcase: string | undefined;
}

export interface SubmitWaiverPayload {
Expand Down
72 changes: 44 additions & 28 deletions src/artifact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*/

import _ from 'lodash';
import { BrokerMessagesType, EtaBrokerMessagesType } from './types';
import { BrokerMessagesType, EtaBrokerMessagesType, Metadata } from './types';

export type ComposeArtifactType = 'productmd-compose';
export type ContainerImageArtifactType = 'redhat-container-image';
Expand Down Expand Up @@ -103,27 +103,39 @@ export function isArtifactRPM(artifact: Artifact): artifact is ArtifactRPM {
artifact.type === 'koji-build-cs'
);
}

export function isArtifactMBS(artifact: Artifact): artifact is ArtifactMBS {
return artifact.type === 'redhat-module';
}

export function isArtifactCompose(
artifact: Artifact,
): artifact is ArtifactCompose {
return artifact.type === 'productmd-compose';
}

export function isArtifactRedhatContainerImage(
artifact: Artifact,
): artifact is ArtifactContainerImage {
return artifact.type === 'redhat-container-image';
}

export function isStateKai(state: StateType): state is StateKaiType {
return _.has(state, 'kai_state');
}

export type PayloadsType =
| PayloadComposeBuildType
| PayloadMBSBuildType
| PayloadRPMBuildType;
export function isArtifactScratch(artifact: Artifact): boolean {
if (
isArtifactRedhatContainerImage(artifact) ||
isArtifactMBS(artifact) ||
isArtifactRPM(artifact)
) {
return artifact.payload.scratch;
}
return false;
}

export type PayloadsType = Artifact['payload'];

export interface ArtifactBase {
_id: string;
Expand Down Expand Up @@ -201,6 +213,15 @@ export type GreenwaveRequirementType = {
item: { type: ArtifactType; identifier: string };
};

export type GreenwaveRequirementOutcome =
| 'INFO'
| 'ERROR'
| 'PASSED'
| 'FAILED'
| 'RUNNING'
| 'NOT_APPLICABLE'
| 'NEEDS_INSPECTION';

/**
* Based on documentation from:
* https://pagure.io/greenwave/blob/master/f/greenwave/api_v1.py
Expand Down Expand Up @@ -228,24 +249,25 @@ export type GreenwaveRequirementType = {
export type GreenwaveResultType = {
data: {
brew_task_id: string[];
category: string[];
ci_email: string[];
ci_irc: string[];
ci_name: string[];
ci_team: string[];
ci_url: string[];
component: string[];
issuer: string[];
category?: string[];
ci_docs?: string[];
ci_email?: string[];
ci_irc?: string[];
ci_name?: string[];
ci_team?: string[];
ci_url?: string[];
component?: string[];
issuer?: string[];
item: string[];
log: string[];
log?: string[];
msg_id: string[];
publisher_id: string[];
rebuild: string[];
publisher_id?: string[];
rebuild?: string[];
scratch: string[];
system_os: string[];
system_provider: string[];
arch: string[];
seconds_taken: string[];
system_os?: string[];
system_provider?: string[];
arch?: string[];
seconds_taken?: string[];
type: ArtifactType[];
};
groups: string[];
Expand All @@ -258,14 +280,7 @@ export type GreenwaveResultType = {
* https://pagure.io/fedora-ci/messages/blob/master/f/mappings/results/brew-build.test.complete.yaml#_3
* https://pagure.io/fedora-ci/messages/blob/master/f/mappings/results/brew-build.test.error.yaml#_3
*/
outcome:
| 'INFO'
| 'ERROR'
| 'PASSED'
| 'FAILED'
| 'RUNNING'
| 'NOT_APPLICABLE'
| 'NEEDS_INSPECTION';
outcome: GreenwaveRequirementOutcome;
/**
* ref_url - always run.url, for old and new mapping:
* https://github.com/release-engineering/resultsdb-updater/blob/master/resultsdbupdater/utils.py#L343
Expand Down Expand Up @@ -401,6 +416,7 @@ export interface KaiErrataToolAutomationStateType {

export type StateKaiType = {
broker_msg_body: BrokerMessagesType;
custom_metadata?: Metadata;
kai_state: KaiStateType;
};

Expand Down
Loading
Loading