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

feat(release): trigger release form #911

Merged
merged 4 commits into from
Mar 18, 2024

Conversation

abhinandan13jan
Copy link
Contributor

@abhinandan13jan abhinandan13jan commented Mar 8, 2024

Fixes

https://issues.redhat.com/browse/HAC-5665
https://issues.redhat.com/browse/HAC-5666
https://issues.redhat.com/browse/HAC-5667

Description

Trigger release base form + add a bug Modal

Screenshot 2024-03-18 at 3 25 49 PM Screenshot 2024-03-18 at 6 11 21 PM ![ezgif com-resize](https://github.com/openshift/hac-dev/assets/24852534/7794c429-7c2a-4d96-8067-7a6f13300291)

Type of change

  • Feature
  • Bugfix
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

Screen shots / Gifs for design review

Screenshot 2024-03-08 at 7 53 24 PM Screenshot 2024-03-08 at 7 57 07 PM

How to test or reproduce?

  1. Create a release Plan oc apply -f releasePlan.yaml
apiVersion: appstudio.redhat.com/v1alpha1
kind: ReleasePlan
metadata:
 labels:
   release.appstudio.openshift.io/auto-release: 'true'
 name: sre-production 
 namespace: abhindas-tenant 
spec:
 application: devfile-sample
 target: managed-workspace 
  1. Go to Releases from sideNav -> ReleasePlan List -> Trigger Release plan action
  2. Fill up the form and open Network Tab.
  3. Check that the Release object is created successfully

Browser conformance:

  • Chrome
  • Firefox
  • Safari
  • Edge

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 8, 2024
@abhinandan13jan abhinandan13jan changed the title [WIP] Trigger release form feat(release): trigger release form Mar 12, 2024
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 12, 2024
@abhinandan13jan abhinandan13jan changed the title feat(release): trigger release form [WIP]feat(release): trigger release form Mar 12, 2024
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 12, 2024
@abhinandan13jan abhinandan13jan changed the title [WIP]feat(release): trigger release form feat(release): trigger release form Mar 12, 2024
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 12, 2024
Copy link

codecov bot commented Mar 12, 2024

Codecov Report

Attention: Patch coverage is 85.90604% with 42 lines in your changes are missing coverage. Please review.

Project coverage is 85.88%. Comparing base (440184a) to head (46254c2).
Report is 9 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #911      +/-   ##
==========================================
- Coverage   85.95%   85.88%   -0.07%     
==========================================
  Files         613      627      +14     
  Lines       15773    16135     +362     
  Branches     4460     4550      +90     
==========================================
+ Hits        13558    13858     +300     
- Misses       2075     2136      +61     
- Partials      140      141       +1     
Files Coverage Δ
...rc/components/ImportForm/utils/validation-utils.ts 100.00% <100.00%> (ø)
.../TriggerRelease/AddIssueSection/ComponentField.tsx 100.00% <100.00%> (ø)
.../TriggerRelease/AddIssueSection/StatusDropdown.tsx 100.00% <100.00%> (ø)
...ReleasePlan/TriggerRelease/ReleasePlanDropdown.tsx 100.00% <100.00%> (ø)
...ce/ReleasePlan/TriggerRelease/SnapshotDropdown.tsx 100.00% <100.00%> (ø)
.../ReleasePlan/TriggerRelease/TriggerReleaseForm.tsx 100.00% <100.00%> (ø)
...ReleaseService/ReleasePlan/releaseplan-actions.tsx 92.30% <100.00%> (+0.64%) ⬆️
...ared/components/empty-state/FilteredEmptyState.tsx 100.00% <100.00%> (ø)
src/types/coreBuildService.ts 100.00% <ø> (ø)
...Plan/TriggerRelease/AddIssueSection/UploadDate.tsx 88.88% <88.88%> (ø)
... and 7 more

... and 20 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 440184a...46254c2. Read the comment docs.

}) => {
const [isModalOpen, setIsModalOpen] = React.useState(false);
const [isTimePickerOpen, setIsTimePickerOpen] = React.useState(false);
const dateRef = React.useRef(null);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is this dataRef being used?

Comment on lines 45 to 48
if (dateRef && dateRef.current && dateRef.current.isCalendarOpen) {
dateRef.current.toggleCalendar(false, event.key);
} else if (isTimePickerOpen) {
setIsTimePickerOpen(false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dataRef and isTimePickerOpen are not being used anywhere

Comment on lines +137 to +146
<Table
aria-label="Simple table"
variant="compact"
borders
className="pf-v5-u-m-0 pf-v5-u-p-0"
>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use the Table component that we use everywhere in list pages?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FieldArray, arrayHelper & index doesn't work properly with our ../shared/Table, using standard patternfly table


return (
<Form>
<div ref={formRef}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formRef not being used anywhere

Comment on lines 66 to 67
e.preventDefault(), handleSubmit();
modalToggle();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e.preventDefault();
handleSubmit();
modalToggle();


return (
<FieldArray
name="components"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this value should be the name coming from props

Comment on lines 29 to 31
// edit
// ? await editReleasePlan(releasePlan, values, workspace, true)
// : await createReleasePlan(values, namespace, workspace, true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove these comments

releasePlan: rp,
snapshot,
data: {
advisory: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be releaseNotes

Comment on lines +81 to +83
cves,
issues,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

talk to errata team to figure out if bugs/cves should be under references

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no update yet from errata team. I am using fields as per the latest conversation. I see the object is being created with the correct values in releaseNotes.
Maybe the errata team should remap the values in their API end or file a bug with all the changes they request as there is no document/link provided thus far

};

export type ReleaseSpec = {
snapshot: string;
releasePlan: string;
data?: {
advisory?: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change advisory to releaseNotes

Comment on lines 49 to 58
releasePlan: rp,
snapshot,
cves,
topic,
labels: labelPairs,
description,
solution,
issues,
synopsis,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reference field is there in form but not used here

@sahil143
Copy link
Contributor

sahil143 commented Mar 18, 2024

@abhinandan13jan Everything looks good! Just one small change required. Please add - in table if a field value is not present

image

Comment on lines 6 to 7
{ key: 'inProgress', value: 'In progress' },
{ key: 'closed', value: 'Closed' },
{ key: 'resolved', value: 'Resolved' },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shows the status of the bug: Resolved, Unresolved.

As per Design docs, its Resolved or Unresolved but currently I see the below options, was this changed later on ? If yes then closed and resolved seems confusing.

image

isBug ? issueTableColumnClass.bugUrl : issueTableColumnClass.bugUrl
}
>
<Truncate content={issue.url} />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

URL field accepts any random text, shouldn't we add url validation while adding a bug fix info ?

Screenshot 2024-03-18 at 2 26 20 PM

<StackItem>
<InputField data-test="bug-url" label="URL" name="url" required />
</StackItem>
<StackItem>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Date picker field is missing "Last updated" title.

image

id: `trigger-releaseplan-${obj.metadata.name}`,
cta: {
href: `/application-pipeline/release/workspaces/${workspace}/release-plan/trigger`,
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add access check review to see if the user has access to create a release, if not disable the action with tooltip ?


const TriggerReleasePlanPage: React.FC<React.PropsWithChildren<unknown>> = () => {
const accessReviewResources: AccessReviewResources = [
{ model: ReleasePlanModel, verb: 'create' },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be ReleaseModel?

Suggested change
{ model: ReleasePlanModel, verb: 'create' },
{ model: ReleaseModel, verb: 'create' },

@abhinandan13jan
Copy link
Contributor Author

@sahil143 @karthikjeeyar updated
Screenshot 2024-03-18 at 6 11 21 PM
Screenshot 2024-03-18 at 3 25 49 PM

Copy link
Contributor

@karthikjeeyar karthikjeeyar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 18, 2024
Copy link
Contributor

openshift-ci bot commented Mar 18, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abhinandan13jan, karthikjeeyar

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 18, 2024
@sahil143
Copy link
Contributor

/lgtm

@sahil143
Copy link
Contributor

/retest

1 similar comment
@abhinandan13jan
Copy link
Contributor Author

/retest

Copy link
Contributor

openshift-ci bot commented Mar 18, 2024

@abhinandan13jan: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@rohitkrai03 rohitkrai03 merged commit cc55262 into openshift:main Mar 18, 2024
5 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants