Skip to content

Add endpoint deleting workflow run #34337

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

Merged
merged 57 commits into from
May 13, 2025
Merged

Conversation

NorthRealm
Copy link
Contributor

@NorthRealm NorthRealm commented May 1, 2025

Add endpoint deleting workflow run
Resolves #26219

/claim #26219

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label May 1, 2025
@github-actions github-actions bot added modifies/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code labels May 1, 2025
@NorthRealm NorthRealm marked this pull request as ready for review May 2, 2025 10:22
@github-actions github-actions bot added modifies/translation modifies/templates This PR modifies the template files labels May 3, 2025
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.

Overall LGTM.

@ChristopherHX would you like to take a look if you have time?

Thank you all.

@NorthRealm NorthRealm requested a review from ChristopherHX May 13, 2025 17:54
@NorthRealm
Copy link
Contributor Author

Test is failing 😕

@NorthRealm
Copy link
Contributor Author

At line 587 ctx.JSONError(ctx.Tr("error.not_found"))
Return 400 or 404?

@wxiaoguang
Copy link
Contributor

Test is failing 😕

Because now we use JSONError for error messages, then the error message will be correctly displayed on the UI

@ChristopherHX
Copy link
Contributor

At line 587 ctx.JSONError(ctx.Tr("error.not_found"))
Return 400 or 404?

I assume 400 is correct here like in

ctx.JSONError(ctx.Tr("error.not_found"))

@NorthRealm
Copy link
Contributor Author

At line 587 ctx.JSONError(ctx.Tr("error.not_found"))
Return 400 or 404?

I assume 400 is correct here like in

ctx.JSONError(ctx.Tr("error.not_found"))

I mean for that line, should use ctx.JSONError 400, or something else for 404?
But yeah whatever. Good for UI display.

@wxiaoguang
Copy link
Contributor

wxiaoguang commented May 13, 2025

I added JSONErrorNotFound in 8012a7e , I think it will be useful in the future.

And frontend code works with any 40x code:

image

Copy link
Contributor

@ChristopherHX ChristopherHX left a comment

Choose a reason for hiding this comment

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

LGTM

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels May 13, 2025
@wxiaoguang wxiaoguang enabled auto-merge (squash) May 13, 2025 18:47
@NorthRealm
Copy link
Contributor Author

Hey @wxiaoguang
After this pr gets finished, backport to 1.24?

@wxiaoguang
Copy link
Contributor

wxiaoguang commented May 13, 2025

After this pr gets finished, backport to 1.24?

Personally I think (usually) no, because it is a feature-like change (a lot of code changes).

But if many users & contributors & maintainers would like to backport, we could try. So it depends IMO.

@wxiaoguang wxiaoguang merged commit 1e2f351 into go-gitea:main May 13, 2025
26 checks passed
zjjhot added a commit to zjjhot/gitea that referenced this pull request May 14, 2025
* giteaofficial/main:
  [skip ci] Updated translations via Crowdin
  Add endpoint deleting workflow run (go-gitea#34337)
  Fix remove org user failure on mssql (go-gitea#34449)
  Fix repo broken check (go-gitea#34444)
  Fix comment textarea scroll issue in Firefox (go-gitea#34438)
  Fix releases sidebar navigation link (go-gitea#34436)
@NorthRealm NorthRealm deleted the delete-run-1 branch May 14, 2025 05:29
lunny pushed a commit that referenced this pull request May 14, 2025
hantang pushed a commit to qundao/mirror-forgejo that referenced this pull request Jun 17, 2025
## Checklist

- [x] go to the last cherry-pick PR (forgejo/forgejo#7965) to figure out how far it went: [gitea@9d4ebc1f2c](go-gitea/gitea@9d4ebc1)
- [x] cherry-pick and open PR (forgejo/forgejo#8040)
- [ ] have the PR pass the CI
- end-to-end (specially important if there are actions related changes)
  - [ ] add `run-end-to-end` label
  - [ ] check the result
- [ ] write release notes
- [ ] assign reviewers
- [ ] 48h later, last call
- merge 1 hour after the last call

## Legend

- ❓ - No decision about the commit has been made.
- 🍒 - The commit has been cherry picked.
- ⏩ - The commit has been skipped.
- 💡 - The commit has been skipped, but should be ported to Forgejo.
- ✍️ - The commit has been skipped, and a port to Forgejo already exists.

## Commits

- 🍒 [`gitea`](go-gitea/gitea@50d9565) -> [`forgejo`](https://codeberg.org/forgejo/forgejo/commit/c3e6eab73235ac189ca3a36ce2b8ea8d8ad82c81) Add sort option recentclose for issues and pulls ([gitea#34525](go-gitea/gitea#34525))

## TODO

- 💡 [`gitea`](go-gitea/gitea@d5bbaee) Retain issue sort type when a keyword search is introduced ([gitea#34559](go-gitea/gitea#34559))
  UI: Small bat might be nice. Test needed? Do we've frontend tests covering the search?
------
- 💡 [`gitea`](go-gitea/gitea@82ea238) Always use an empty line to separate the commit message and trailer ([gitea#34512](go-gitea/gitea#34512))
  Needs merge
------
- 💡 [`gitea`](go-gitea/gitea@74858dc) Fix line-button issue after file selection in file tree ([gitea#34574](go-gitea/gitea#34574))
  Frontend: Makes it sense to pick/port ui logic in *.ts files?
------
- 💡 [`gitea`](go-gitea/gitea@7149c9c) Fix doctor deleting orphaned issues attachments ([gitea#34142](go-gitea/gitea#34142))
  Doctor: seems useful.
------
- 💡 [`gitea`](go-gitea/gitea@0cec4b8) Fix actions skipped commit status indicator ([gitea#34507](go-gitea/gitea#34507))
  Actions: Might benefit from additional tests.
------
- 💡 [`gitea`](go-gitea/gitea@4cb0c64) Add "View workflow file" to Actions list page ([gitea#34538](go-gitea/gitea#34538))
  Actions: Needs tests
------
- 💡 [`gitea`](go-gitea/gitea@b0936f4) Do not mutate incoming options to RenderUserSearch and SearchUsers ([gitea#34544](go-gitea/gitea#34544))
  Nice refactoring but needs manual merge.
------
- 💡 [`gitea`](go-gitea/gitea@498088c) Add webhook assigning test and fix possible bug ([gitea#34420](go-gitea/gitea#34420))
  Integrationtest has conflicts needs merge.
------
- 💡 [`gitea`](go-gitea/gitea@24a5105) Fix possible nil description of pull request when migrating from CodeCommit ([gitea#34541](go-gitea/gitea#34541))
  Is this relevant to forgejo? Did not find the place to apply this small change.
------
- 💡 [`gitea`](go-gitea/gitea@688da55) Split GetLatestCommitStatus as two functions ([gitea#34535](go-gitea/gitea#34535))
  Merge required.
------
- 💡 [`gitea`](go-gitea/gitea@ab96912) Don't display error log when .git-blame-ignore-revs doesn't exist ([gitea#34457](go-gitea/gitea#34457))
  Unsure wheter this affects forgejo. Tests missing.
------
- 💡 [`gitea`](go-gitea/gitea@11ee7ff) fix: return 201 Created for CreateVariable API responses ([gitea#34517](go-gitea/gitea#34517))
  Actions: This is marked as breaking the api. Pls think about whether this breaking change iss needed & how this impact api-version-increase.
  The corresponding clinet change can be found here: https://gitea.com/gitea/go-sdk/pulls/713/files
------
- 💡 [`gitea`](go-gitea/gitea@9b295e9) Actions list ([gitea#34530](go-gitea/gitea#34530))
  Actions: Regression from go-gitea/gitea#34337 Part of https://codeberg.org/forgejo/forgejo/pulls/7909
------

## Skipped

- ⏩ [`gitea`](go-gitea/gitea@bb6377d) [skip ci] Updated translations via Crowdin
------
- ⏩ [`gitea`](go-gitea/gitea@07d802a) [skip ci] Updated translations via Crowdin
------
- ⏩ [`gitea`](go-gitea/gitea@c6e2093) Clean up "file-view" related styles ([gitea#34558](go-gitea/gitea#34558))

  - gitea ui specific specific
------
- ⏩ [`gitea`](go-gitea/gitea@9f10885) Refactor commit reader ([gitea#34542](go-gitea/gitea#34542))

  - gitea refactor specific
------

<details>
<summary><h2>Stats</h2></summary>

<br>

Between [`gitea@9d4ebc1f2c`](go-gitea/gitea@9d4ebc1) and [`gitea@d5bbaee64e`](go-gitea/gitea@d5bbaee), **18** commits have been reviewed. We picked **1**, skipped **4**, and decided to port **13**.

</details>

Co-authored-by: Markus Amshove <[email protected]>
Co-authored-by: Lunny Xiao <[email protected]>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8040
Reviewed-by: Earl Warren <[email protected]>
Co-authored-by: Michael Jerger <[email protected]>
Co-committed-by: Michael Jerger <[email protected]>
saschazepter pushed a commit to saschazepter/forgejo that referenced this pull request Jun 27, 2025
## Checklist

- [x] go to the last cherry-pick PR (forgejo/forgejo#7804) to figure out how far it went: [gitea@a2024953c5](go-gitea/gitea@a202495)
- [x] cherry-pick and open PR (forgejo/forgejo#7909)
- [ ] have the PR pass the CI
- end-to-end (specially important if there are actions related changes)
  - [ ] add `run-end-to-end` label
  - [ ] check the result
- [ ] write release notes
- [ ] assign reviewers
- [ ] 48h later, last call
- merge 1 hour after the last call

## Legend

- ❓ - No decision about the commit has been made.
- 🍒 - The commit has been cherry picked.
- ⏩ - The commit has been skipped.
- 💡 - The commit has been skipped, but should be ported to Forgejo.
- ✍️ - The commit has been skipped, and a port to Forgejo already exists.

## Commits

- 🍒 [`gitea`](go-gitea/gitea@e92c4f1) -> [`forgejo`](https://codeberg.org/forgejo/forgejo/commit/56fa2caef32c4b0e5017f4b09188ad1dfc8d3603) Add missing setting load in dump-repo command ([gitea#34479](go-gitea/gitea#34479))
- 🍒 [`gitea`](go-gitea/gitea@7b518bc) -> [`forgejo`](https://codeberg.org/forgejo/forgejo/commit/6e5299606a1bd42cb45ed472a84ba797cf2fa790) Change "rejected" to "changes requested" in 3rd party PR review notification ([gitea#34481](go-gitea/gitea#34481))

## TODO

- 💡 [`gitea`](go-gitea/gitea@9723810) Fix url validation in webhook add/edit API ([gitea#34492](go-gitea/gitea#34492))
  Relevant input validation but test needs more backport.
------
- 💡 [`gitea`](go-gitea/gitea@59df03b) Fix get / delete runner to use consistent http 404 and 500 status ([gitea#34480](go-gitea/gitea#34480))
  It may be relevant to Forgejo as well
------
- 💡 [`gitea`](go-gitea/gitea@1e2f351) Add endpoint deleting workflow run ([gitea#34337](go-gitea/gitea#34337))
  Actions, it would be worth having in Forgejo as well.
------
- 💡 [`gitea`](go-gitea/gitea@5cb4cbf) Fix repo broken check ([gitea#34444](go-gitea/gitea#34444))
  Check wether this is relevant to us, port if yes.
------
- 💡 [`gitea`](go-gitea/gitea@355e9a9) Add a webhook push test for dev branch ([gitea#34421](go-gitea/gitea#34421))
  Enhances webhook integration tests.
------
- 💡 [`gitea`](go-gitea/gitea@34281bc) Fix bug webhook milestone is not right. ([gitea#34419](go-gitea/gitea#34419))
  Testcode diverged, port required.
------
- 💡 [`gitea`](go-gitea/gitea@780e92e) Only git operations should update `last changed` of a repository ([gitea#34388](go-gitea/gitea#34388))
  Port required, would benefit from additional tests.
------
- 💡 [`gitea`](go-gitea/gitea@b07e039) When updating comment, if the content is the same, just return and not update the databse ([gitea#34422](go-gitea/gitea#34422))
  Codebase diverged, port required.
------
- 💡 [`gitea`](go-gitea/gitea@71a1187) Fix incorrect divergence cache after switching default branch ([gitea#34370](go-gitea/gitea#34370))
  Depends on previous gitea changes, port needed.
------
- 💡 [`gitea`](go-gitea/gitea@4c611bf) Add a button editing action secret ([gitea#34348](go-gitea/gitea#34348))
  This is an interesting feature and it has tests as well. Feature request covering this: https://codeberg.org/forgejo/forgejo/issues/7882
------
- 💡 [`gitea`](go-gitea/gitea@2fbc8f9) Fix LFS file not stored in LFS when uploaded/edited via API or web UI ([gitea#34367](go-gitea/gitea#34367))
  Our code diverged - pls. check relevance & maybe port.
------
- 💡 [`gitea`](go-gitea/gitea@020e774) feat: add label 'state' to metric 'gitea_users' ([gitea#34326](go-gitea/gitea#34326))
  Adjust our existing tests while porting this.
------

## Skipped

- ⏩ [`gitea`](go-gitea/gitea@ec10c6b) [skip ci] Updated translations via Crowdin
------
- ⏩ [`gitea`](go-gitea/gitea@d89eed9) Fix edithook api can not update package, status and workflow_job events ([gitea#34495](go-gitea/gitea#34495))

  - gitea actions specific specific
------
- ⏩ [`gitea`](go-gitea/gitea@b6c0667)  Add R-HNF to the TRANSLATORS file ([gitea#34494](go-gitea/gitea#34494))

  - gitea translators update specific
------
- ⏩ [`gitea`](go-gitea/gitea@6fbf0e6) nix flake update ([gitea#34476](go-gitea/gitea#34476))

  - gitea dependency update specific
------
- ⏩ [`gitea`](go-gitea/gitea@c24f4b3) Add migrations tests ([gitea#34456](go-gitea/gitea#34456))
------
- ⏩ [`gitea`](go-gitea/gitea@bf338bb) Fix project board view ([gitea#34470](go-gitea/gitea#34470))

  - gitea ui specific specific
------
- ⏩ [`gitea`](go-gitea/gitea@319d03f) [skip ci] Updated translations via Crowdin
------
- ⏩ [`gitea`](go-gitea/gitea@dd500ce) Fix Workflow run Not Found page ([gitea#34459](go-gitea/gitea#34459))

  - gitea actions specific specific
------
- ⏩ [`gitea`](go-gitea/gitea@b6bf128) [skip ci] Updated translations via Crowdin
------
- ⏩ [`gitea`](go-gitea/gitea@a0595ad) Fix remove org user failure on mssql ([gitea#34449](go-gitea/gitea#34449))
------
- ⏩ [`gitea`](go-gitea/gitea@b5fd3e7) Fix comment textarea scroll issue in Firefox ([gitea#34438](go-gitea/gitea#34438))

  - gitea ui specific specific
------
- ⏩ [`gitea`](go-gitea/gitea@4011e22) Fix releases sidebar navigation link ([gitea#34436](go-gitea/gitea#34436))

  - gitea ui specific specific
------
- ⏩ [`gitea`](go-gitea/gitea@0902d42) [skip ci] Updated translations via Crowdin
------
- ⏩ [`gitea`](go-gitea/gitea@4a98ab0) Remove legacy template helper functions ([gitea#34426](go-gitea/gitea#34426))

  - gitea specific specific
------
- ⏩ [`gitea`](go-gitea/gitea@9b8609e) Fix GetUsersByEmails ([gitea#34423](go-gitea/gitea#34423))

  - gitea specific specific
------
- ⏩ [`gitea`](go-gitea/gitea@0f63a5e) [skip ci] Updated translations via Crowdin
------
- ⏩ [`gitea`](go-gitea/gitea@ad27144) Fix a bug when uploading file via lfs ssh command ([gitea#34408](go-gitea/gitea#34408))
  :skiP: present with PR #7752
------
- ⏩ [`gitea`](go-gitea/gitea@8b16ab7) Merge and tweak markup editor expander CSS ([gitea#34409](go-gitea/gitea#34409))

  - gitea ui specific specific
------
- ⏩ [`gitea`](go-gitea/gitea@2ecd73d) Bump `@github/relative-time-element` to v4.4.8 ([gitea#34413](go-gitea/gitea#34413))

  - gitea dependency update specific
------
- ⏩ [`gitea`](go-gitea/gitea@179068f) Refactor commit message rendering and fix bugs ([gitea#34412](go-gitea/gitea#34412))

  - gitea ui specific specific
------
- ⏩ [`gitea`](go-gitea/gitea@44aadc3) [skip ci] Updated translations via Crowdin
------
- ⏩ [`gitea`](go-gitea/gitea@f63822f) Fix autofocus behavior ([gitea#34397](go-gitea/gitea#34397))

  - gitea ui specific specific
------
- ⏩ [`gitea`](go-gitea/gitea@82071ee) [skip ci] Updated translations via Crowdin
------
- ⏩ [`gitea`](go-gitea/gitea@bbfc21e) Fix "The sidebar of the repository file list does not have a fixed height #34298" ([gitea#34321](go-gitea/gitea#34321))

  - gitea ui specific specific
------
- ⏩ [`gitea`](go-gitea/gitea@dd886d7) Update JS and PY dependencies ([gitea#34391](go-gitea/gitea#34391))

  - gitea dependency update specific
------
- ⏩ [`gitea`](go-gitea/gitea@2a660b4) Upgrade go-github v61 -> v71 ([gitea#34385](go-gitea/gitea#34385))

  - gitea dependency update specific
------
- ⏩ [`gitea`](go-gitea/gitea@6bd8fe5) Bump `@github/relative-time-element` to v4.4.7 ([gitea#34384](go-gitea/gitea#34384))

  - gitea dependency update specific
------

<details>
<summary><h2>Stats</h2></summary>

<br>

Between [`gitea@a2024953c5`](go-gitea/gitea@a202495) and [`gitea@ec10c6ba5a`](go-gitea/gitea@ec10c6b), **41** commits have been reviewed. We picked **2**, skipped **27**, and decided to port **12**.

</details>

Co-authored-by: Sebastian Weigand <[email protected]>
Co-authored-by: Lunny Xiao <[email protected]>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7909
Reviewed-by: Earl Warren <[email protected]>
Co-authored-by: Michael Jerger <[email protected]>
Co-committed-by: Michael Jerger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🙋 Bounty claim lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files modifies/translation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Delete workflow runs
6 participants