Skip to content

Conversation

@zsbahtiar
Copy link

@zsbahtiar zsbahtiar commented Jan 7, 2025

Submit for issue #26219
/claim #26219

Screenshot 2025-01-07 at 10 57 15 PM
Screenshot 2025-01-07 at 10 41 00 PM

Screen.Recording.2025-01-08.at.1.17.14.AM.mov

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jan 7, 2025
@github-actions github-actions bot added the modifies/templates This PR modifies the template files label Jan 7, 2025
@pull-request-size pull-request-size bot added size/M and removed size/S labels Jan 7, 2025
@github-actions github-actions bot added modifies/go Pull requests that update Go code modifies/frontend labels Jan 7, 2025
@zsbahtiar zsbahtiar changed the title [WIP] feat(runs_list): add button delete workflow run feat(runs_list): add button delete workflow run Jan 7, 2025
@zsbahtiar
Copy link
Author

/claim #26219

@zsbahtiar zsbahtiar mentioned this pull request Jan 7, 2025
Copy link
Contributor

@Frankkkkk Frankkkkk left a comment

Choose a reason for hiding this comment

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

Thanks for the WIP, IMHO it still needs some little changes, but it looks great and useful :)

@wxiaoguang
Copy link
Contributor

It needs to be "almost" complete for #24256 & #26275 (comment)

@yp05327
Copy link
Contributor

yp05327 commented Jan 8, 2025

UI can be something like this:
image

@zsbahtiar
Copy link
Author

hi all thanks for feedback, i willl check after work

@zsbahtiar
Copy link
Author

UI can be something like this: image

make sure, we can select the workflow run except running and waiting workflow status? @yp05327 @wxiaoguang @Frankkkkk

@wxiaoguang
Copy link
Contributor

UI can be something like this:

make sure, we can select the workflow run except running and waiting workflow status? @yp05327 @wxiaoguang @Frankkkkk

select the workflow run except running and waiting workflow status

Ideally, yes

But I won't say it is a must in this PR, we should make the basic logic right before the UI work (the UI work needs more frontend skills and time to make it right)

Copy link
Contributor

@wxiaoguang wxiaoguang left a comment

Choose a reason for hiding this comment

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

we should make the basic logic right #33138 (comment)

But I do not think the logic is complete.

It needs to be "almost" complete for #24256 & #26275 (comment)

Are all of them implemented? At least it needs some tests, otherwise the code will break in the future.

I think it's not right, it makes A user could delete B user's action.
#33138 (comment)

It seems that A user could still delete B's actions, the code lacks permission check. Correct me if I was wrong.

@zsbahtiar
Copy link
Author

we should make the basic logic right #33138 (comment)

But I do not think the logic is complete.

It needs to be "almost" complete for #24256 & #26275 (comment)

Are all of them implemented? At least it needs some tests, otherwise the code will break in the future.

I think it's not right, it makes A user could delete B user's action.
#33138 (comment)

It seems that A user could still delete B's actions, the code lacks permission check. Correct me if I was wrong.

yah the first im skip about the restriction, but try to add in this commit: 05af60b

i will try for create the test, i hope can create the test

@zsbahtiar
Copy link
Author

zsbahtiar commented Jan 9, 2025

hi all im already done add the test 8c742ab can you check? thanks
@wxiaoguang @Frankkkkk
image

@zsbahtiar zsbahtiar requested a review from wxiaoguang January 9, 2025 02:00
@pull-request-size pull-request-size bot added size/XL and removed size/L labels Jan 9, 2025
jobIDs, taskIDs []int64
taskLogFileNames []string
)
eg.Go(func() error {
Copy link
Contributor

Choose a reason for hiding this comment

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

The database operations should be done in one transaction, but not in "errgroup goroutine".

)
eg.Go(func() error {
var err error
actionRuns, err = actions_model.GetRunsByIDsAndTriggerUserID(ctx, req.ActionIDs, ctx.Doer.ID)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why use Doer.ID here? For example: user A is admin, an ActionRun is not created by them, then user A can't delete that ActionRun?

fileName = filepath.Join(setting.AppWorkPath, setting.AppDataPath, dirNameActionLog, taskLogFileName)
}

if err := os.Remove(fileName); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

IIRC there is a "storage" for Action logs, they could be in S3 (ObjectStorage) but not on filesystem

@ghost
Copy link

ghost commented Jan 9, 2025

I really like the progress on this pull request and I think this will be a very useful addition.

If I could make one suggestion, it would be to make the Delete Workflow button less prominent. I would either use an icon or go the GitHub route with the ellipsis button. I made a quick mockup (the ellipsis button would then open a small context menu with the Delete Workflow button as text).

suggestions

GitHub Example (preferred):
github

@lunny
Copy link
Member

lunny commented May 11, 2025

This will be replaced by #34337

@lunny lunny closed this May 13, 2025
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Aug 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. modifies/frontend modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants