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

Task/rhoaieng 12667 tech debt cleanup duplicate code in pipelines co #3297

Conversation

Gkrumbach07
Copy link
Member

https://issues.redhat.com/browse/RHOAIENG-12667

Description

Fixes duplicate code in pipelines based on the output of

npx jscpd . --ignore "**/*.spec.*,**/__tests__/**" -r html --ignore-pattern "import.*from\s*'.*'" -l 20 --pattern "**/pipelines/**"

I choose 20 because anything smaller was not worth creating shared components. There are some still in the 20 line range but those could not be created into shared components or it was unnatural to make them into a shared component. At 30 lines, all duplication was removed.

How Has This Been Tested?

Test each area of duplication. they are separated by commit.

  1. Import pipeline and import pipeline version modal
  2. pipeline run table toolbar (search dropdown)
    • can be seen in compare runs, compare runs manage runs, and run list page
  3. pipeline active runs table empty state and compare runs manage runs empty state
  4. larger breadcrumbs in pipelines
  5. experiment active and archived loading error

Test Impact

make sure tests still pass

Request review criteria:

Self checklist (all need to be checked):

  • The developer has manually tested the changes and verified that the changes work
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has added tests or explained why testing cannot be added (unit or cypress tests for related changes)

If you have UI changes:

  • Included any necessary screenshots or gifs if it was a UI change.
  • Included tags to the UX team if it was a UI/UX change.

After the PR is posted & before it merges:

  • The developer has tested their solution on a cluster by using the image produced by the PR to main

@DaoDaoNoCode
Copy link
Member

@Gkrumbach07 Can you fix the cypress test?

@Gkrumbach07 Gkrumbach07 force-pushed the task/RHOAIENG-12667--tech-debt-cleanup-duplicate-code-in-pipelines-co branch from 94b538d to ea2516c Compare October 7, 2024 20:03
Copy link

codecov bot commented Oct 7, 2024

Codecov Report

Attention: Patch coverage is 95.80838% with 7 lines in your changes missing coverage. Please review.

Project coverage is 84.80%. Comparing base (82d4f12) to head (ea2516c).
Report is 26 commits behind head on main.

Files with missing lines Patch % Lines
...ts/pipelines/content/import/PipelineImportBase.tsx 95.16% 3 Missing ⚠️
...s/pipelines/content/import/PipelineImportModal.tsx 95.23% 1 Missing ⚠️
...ines/content/import/PipelineVersionImportModal.tsx 95.23% 1 Missing ⚠️
...bal/pipelines/PipelineVersionDetailsBreadcrumb.tsx 83.33% 1 Missing ⚠️
...pelines/PipelineVersionRecurringRunsBreadcrumb.tsx 83.33% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3297      +/-   ##
==========================================
+ Coverage   84.77%   84.80%   +0.02%     
==========================================
  Files        1308     1314       +6     
  Lines       29251    29203      -48     
  Branches     7937     7915      -22     
==========================================
- Hits        24798    24765      -33     
+ Misses       4453     4438      -15     
Files with missing lines Coverage Δ
...nes/content/compareRuns/CompareRunTableToolbar.tsx 76.92% <ø> (-7.70%) ⬇️
...nes/content/experiments/ExperimentLoadingError.tsx 100.00% <100.00%> (ø)
...pts/pipelines/content/import/useImportModalData.ts 100.00% <100.00%> (ø)
...ines/content/tables/pipelineRun/EmptyRunsState.tsx 100.00% <100.00%> (ø)
...ent/tables/pipelineRun/PipelineRunTableToolbar.tsx 100.00% <100.00%> (ø)
...tables/pipelineRun/PipelineRunTableToolbarBase.tsx 100.00% <100.00%> (ø)
...lines/global/experiments/ActiveExperimentsList.tsx 100.00% <100.00%> (ø)
...nes/global/experiments/ArchivedExperimentsList.tsx 100.00% <100.00%> (ø)
.../global/experiments/compareRuns/ManageRunsPage.tsx 84.21% <ø> (+2.39%) ⬆️
...global/experiments/compareRuns/ManageRunsTable.tsx 100.00% <ø> (ø)
... and 11 more

... and 7 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 82d4f12...ea2516c. Read the comment docs.

@pnaik1
Copy link
Contributor

pnaik1 commented Oct 15, 2024

@Gkrumbach07 , everything looks good except the breadcrumb separation of pipeline and pipeline version

Screenshot 2024-10-15 at 6 50 22 PM

Copy link
Contributor

@jpuzz0 jpuzz0 left a comment

Choose a reason for hiding this comment

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

Tested locally. The areas mentioned work as expected. Code changes look good as well.

@jpuzz0
Copy link
Contributor

jpuzz0 commented Oct 15, 2024

@Gkrumbach07 , everything looks good except the breadcrumb separation of pipeline and pipeline version

Screenshot 2024-10-15 at 6 50 22 PM

@Gkrumbach07 at first I wasn't seeing this but now I am. To be clear, this occurs when creating a run via the row action of the pipelines table, not from the runs list. There are different experiences here that lead to a different set of breadcrumbs.

@jpuzz0 jpuzz0 self-requested a review October 15, 2024 15:20
@jpuzz0 jpuzz0 removed the lgtm label Oct 15, 2024
@Gkrumbach07 Gkrumbach07 force-pushed the task/RHOAIENG-12667--tech-debt-cleanup-duplicate-code-in-pipelines-co branch from 0e0fd81 to 09f885b Compare October 15, 2024 16:57
@openshift-ci openshift-ci bot added the lgtm label Oct 15, 2024
@Gkrumbach07
Copy link
Member Author

/approve

Copy link
Contributor

openshift-ci bot commented Oct 15, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Gkrumbach07, jpuzz0

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-merge-bot openshift-merge-bot bot merged commit c771767 into opendatahub-io:main Oct 15, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants