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

fix(KONFLUX-6512): restore allow input CVE for release #97

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const CVEFormContent: React.FC<CVEFormContentProps> = ({ modalToggle }) => {
</TextContent>
</StackItem>
<StackItem>
<InputField data-test="cve-issue-id" label="CVE ID" name="id" required />
<InputField data-test="cve-issue-id" label="CVE ID" name="key" required />
Copy link
Contributor

Choose a reason for hiding this comment

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

Why label is ID and name is key?

Copy link
Contributor Author

@JoaoPedroPP JoaoPedroPP Feb 3, 2025

Choose a reason for hiding this comment

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

Nice question. Looking at the history of this file in the HAC repository I found this PR#944. There you can find the ticket KFLUXUI-120(KFLUXBUGS-1203) and I understood that is was a design change that replace key for id. However to record the CVE in konflux release the correct schema field name is key. In this case I choose to preserve design and change only the field name to the correct name.

</StackItem>
<StackItem>
<ComponentField name="components" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('CVEFormContent', () => {

it('should show correct values', () => {
formikRenderer(<CVEFormContent modalToggle={null} />, {
id: 'CVE-120',
key: 'CVE-120',
components: [
{ name: 'a', packages: ['p1', 'p2', 'p3'] },
{ name: 'b', packages: ['p1', 'p2', 'p3'] },
Expand All @@ -37,7 +37,7 @@ describe('CVEFormContent', () => {

it('should render component fields ', async () => {
formikRenderer(<CVEFormContent modalToggle={null} />, {
id: 'CVE-120',
key: 'CVE-120',
components: [
{ name: 'a', packages: ['p1', 'p2', 'p3'] },
{ name: 'b', packages: ['p1', 'p2', 'p3'] },
Expand All @@ -52,7 +52,7 @@ describe('CVEFormContent', () => {

it('should remove component fields ', () => {
formikRenderer(<CVEFormContent modalToggle={null} />, {
id: 'CVE-120',
key: 'CVE-120',
components: [
{ name: 'a', packages: ['p1', 'p2', 'p3'] },
{ name: 'b', packages: ['p1', 'p2', 'p3'] },
Expand Down Expand Up @@ -80,7 +80,7 @@ describe('CVEFormContent', () => {

it('should render multiple packages ', () => {
formikRenderer(<CVEFormContent modalToggle={null} />, {
id: 'CVE-120',
key: 'CVE-120',
components: [
{ name: 'a', packages: ['p1', 'p2', 'p3'] },
{ name: 'b', packages: ['p3', 'p4', 'p3'] },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ describe('triggerReleasePlan', () => {
topic: 'topic of release',
references: 'references',
issues: [
{ id: 'RHTAP-5560', summary: 'summary1', url: 'test-url' },
{ id: 'RHTAP-5561', summary: 'summary2', url: 'test-url2' },
{ id: 'RHTAP-5562', summary: 'summary3', url: 'test-url2' },
{ key: 'RHTAP-5560', summary: 'summary1', url: 'test-url' },
{ key: 'RHTAP-5561', summary: 'summary2', url: 'test-url2' },
{ key: 'RHTAP-5562', summary: 'summary3', url: 'test-url2' },
],
labels: [],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export enum ReleasePipelineLocation {

const getIssues = (issues): { id: string; source: string }[] => {
return issues?.map((issue) => {
return { id: issue.id, source: issue.url };
return { id: issue.key, source: issue.url };
});
};

Expand Down