konveyor / tackle2-ui

Tackle (2nd generation) UI component.
Apache License 2.0
8 stars 43 forks source link

:ghost: Update check for running analysis / cancel analysis #1885

Closed ibolton336 closed 5 months ago

ibolton336 commented 7 months ago

This PR narrows down the check for analysis tasks that are cancellable. Also the logic is updated and flipped for "disabling" the creation of a new analysis task. Analysis tasks should be creatable when there are no states for tasks outside of "succeeded" or "failed". This will future proof against any other additional task states that may be added in the future. The "scheduled" state was just added for 0.4 & is the motivation behind this PR ( as requested by @jortel )

codecov[bot] commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 42.22%. Comparing base (b654645) to head (30ad160). Report is 171 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1885 +/- ## ========================================== + Coverage 39.20% 42.22% +3.01% ========================================== Files 146 170 +24 Lines 4857 5450 +593 Branches 1164 1363 +199 ========================================== + Hits 1904 2301 +397 - Misses 2939 3133 +194 - Partials 14 16 +2 ``` | [Flag](https://app.codecov.io/gh/konveyor/tackle2-ui/pull/1885/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=konveyor) | Coverage Δ | | |---|---|---| | [client](https://app.codecov.io/gh/konveyor/tackle2-ui/pull/1885/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=konveyor) | `42.22% <ø> (+3.01%)` | :arrow_up: | | [server](https://app.codecov.io/gh/konveyor/tackle2-ui/pull/1885/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=konveyor) | `?` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=konveyor#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

sjd78 commented 6 months ago
  • Update this logic to account for new states added to task engine on backend API side

Is this PR dependent on a hub PR getting merged? If yes, please reference the PR or hub issue in the PR description.

ibolton336 commented 5 months ago

Is this PR dependent on a hub PR getting merged? If yes, please reference the PR or hub issue in the PR description.

Description updated with more context! Could not find a specific hub PR for this. @sjd78

rszwajko commented 5 months ago

@ibolton336 integration tests fail because they cannot delete an application

  AssertionError: Timed out retrying after 8000ms: expected '<button#analyze-application.pf-v5-c-button.pf-m-primary.pf-m-disabled>' to be 'enabled'
      at Analysis.startAnalysis (cypress/e2e/models/migration/applicationinventory/analysis.ts:199:43)
      (...)

No elements in the current DOM matched your query:

  > cy.get(span.pf-v5-c-menu__item-text).contains(Delete)
(...)
  From Your Spec Code:
      at clickItemInKebabMenu (cypress/utils/utils.ts:657:57)
      at Application.delete (cypress/e2e/models/migration/applicationinventory/application.ts:254:29)