1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-08-04 17:35:21 +02:00

fix: load OldMilestone based on OldMilestoneID, not MilestoneID (#8330)

Fixes #8329

## Checklist

The [contributor guide](https://forgejo.org/docs/next/contributor/) contains information that will be helpful to first time contributors. There also are a few [conditions for merging Pull Requests in Forgejo repositories](https://codeberg.org/forgejo/governance/src/branch/main/PullRequestsAgreement.md). You are also welcome to join the [Forgejo development chatroom](https://matrix.to/#/#forgejo-development:matrix.org).

### Tests

- I added test coverage for Go changes...
  - [ ] in their respective `*_test.go` for unit tests.
  - [x] in the `tests/integration` directory if it involves interactions with a live Forgejo server.

### Documentation

- [x] I did not document these changes and I do not expect someone else to do it.

### Release notes

- [ ] I do not want this change to show in the release notes.
- [x] I want the title to show in the release notes with a link to this pull request.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8330
Reviewed-by: Robert Wolff <mahlzahn@posteo.de>
Co-authored-by: floss4good <floss4good@disroot.org>
Co-committed-by: floss4good <floss4good@disroot.org>
This commit is contained in:
floss4good 2025-06-29 12:08:03 +02:00 committed by Earl Warren
parent 2160741221
commit 920f6d24d2
3 changed files with 70 additions and 10 deletions

View file

@ -102,11 +102,35 @@ func TestIssueCommentChangeMilestone(t *testing.T) {
[]string{"user1 removed this from the milestone2 milestone"},
[]string{"/user1", "/user2/repo1/milestone/2"})
// Deleted milestone
// Added milestone that in the meantime was deleted
testIssueCommentChangeEvent(t, htmlDoc, "2003",
"octicon-milestone", "User One", "/user1",
[]string{"user1 added this to the (deleted) milestone"},
[]string{"/user1"})
// Modified milestone - from a meantime deleted one to a valid one
testIssueCommentChangeEvent(t, htmlDoc, "2004",
"octicon-milestone", "User One", "/user1",
[]string{"user1 modified the milestone from (deleted) to milestone1"},
[]string{"/user1", "/user2/repo1/milestone/1"})
// Modified milestone - from a valid one to a meantime deleted one
testIssueCommentChangeEvent(t, htmlDoc, "2005",
"octicon-milestone", "User One", "/user1",
[]string{"user1 modified the milestone from milestone1 to (deleted)"},
[]string{"/user1", "/user2/repo1/milestone/1"})
// Modified milestone - from a meantime deleted one to a meantime deleted one
testIssueCommentChangeEvent(t, htmlDoc, "2006",
"octicon-milestone", "User One", "/user1",
[]string{"user1 modified the milestone from (deleted) to (deleted)"},
[]string{"/user1"})
// Removed milestone that in the meantime was deleted
testIssueCommentChangeEvent(t, htmlDoc, "2007",
"octicon-milestone", "User One", "/user1",
[]string{"user1 removed this from the (deleted) milestone"},
[]string{"/user1"})
}
func TestIssueCommentChangeProject(t *testing.T) {