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

Disable actions for deleted workflows #2671

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

midigofrank
Copy link
Collaborator

@midigofrank midigofrank commented Nov 14, 2024

Description

This PR disables the workflow edit form whenever a deleted workflow is opened. The save and run form for manual runs is also disabled.

It also adds the restriction on the retry logic. Only un-deleted workflows can be retried.

Closes #2170

Validation steps

In order to test this, you'll need an existing workflow with some workorders and runs.

  1. Delete the workflow
  2. Go to the runs page. Try retrying a run/workorder for the deleted workorder.
    • When you try retrying individually, you'll get an error saying Runs for deleted workflows cannot be retried.
    • When you retry in bulk, you'll see that a certain number was discarded because the workflow was disabled/deleted
  3. Click to inspect one of the steps for that run. You'll see that the job inspector has the action buttons (save/retry) disabled. The whole workflow form is disabled, you cannot even modify the job name

AI Usage

Please disclose how you've used AI in this work (it's cool, we just want to know!):

  • Code generation (copilot but not intellisense)
  • Learning or fact checking
  • Strategy / design
  • Optimisation / refactoring
  • Translation / spellchecking / doc gen
  • Other
  • I have not used AI

You can read more details in our Responsible AI Policy

Pre-submission checklist

  • I have performed a self-review of my code.
  • I have implemented and tested all related authorization policies. (e.g., :owner, :admin, :editor, :viewer)
  • I have updated the changelog.
  • I have ticked a box in "AI usage" in this PR

@midigofrank midigofrank self-assigned this Nov 14, 2024
@midigofrank midigofrank force-pushed the disable-actions-for-deleted-workflows branch from 87d9dba to 7102870 Compare November 14, 2024 11:05
Copy link

codecov bot commented Nov 15, 2024

Codecov Report

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

Project coverage is 91.07%. Comparing base (7fe5798) to head (d88134e).

Files with missing lines Patch % Lines
lib/lightning_web/live/workflow_live/edit.ex 88.88% 5 Missing ⚠️
lib/lightning_web/live/run_live/index.ex 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2671      +/-   ##
==========================================
- Coverage   91.09%   91.07%   -0.02%     
==========================================
  Files         331      331              
  Lines       11609    11642      +33     
==========================================
+ Hits        10575    10603      +28     
- Misses       1034     1039       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@midigofrank midigofrank marked this pull request as ready for review November 15, 2024 05:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: New Issues
Development

Successfully merging this pull request may close these issues.

Deleted workflows remain editable and re-runnable
1 participant