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

Delete repos of org when purge delete user #27273

Merged
merged 9 commits into from
Oct 19, 2023
Merged

Conversation

JakobDev
Copy link
Contributor

Fixes https://codeberg.org/forgejo/forgejo/issues/1514

I had to remove RenameOrganization to avoid circular import.

We should really add some foreign keys to the database.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Sep 26, 2023
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Sep 26, 2023
@github-actions github-actions bot added the modifies/api This PR adds API routes or modifies them label Sep 26, 2023
lunny
lunny previously requested changes Sep 26, 2023
Copy link
Member

@lunny lunny left a comment

Choose a reason for hiding this comment

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

@GiteaBot GiteaBot added lgtm/blocked A maintainer has reservations with the PR and thus it cannot be merged and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Sep 26, 2023
services/user/user.go Outdated Show resolved Hide resolved
services/org/org.go Outdated Show resolved Hide resolved
services/repository/delete.go Outdated Show resolved Hide resolved
@pull-request-size pull-request-size bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 3, 2023
services/org/org.go Show resolved Hide resolved
@JakobDev
Copy link
Contributor Author

Bump

@6543
Copy link
Member

6543 commented Oct 16, 2023

could you resolve the conflicts please?

done

@6543 6543 added this to the 1.22.0 milestone Oct 16, 2023
@pull-request-size pull-request-size bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 16, 2023
services/org/org.go Show resolved Hide resolved
routers/web/org/setting.go Show resolved Hide resolved
@6543
Copy link
Member

6543 commented Oct 16, 2023

haha that dependency cycle got me 😅

@6543 6543 requested a review from lunny October 16, 2023 17:30
@6543 6543 removed the lgtm/blocked A maintainer has reservations with the PR and thus it cannot be merged label Oct 16, 2023
@6543
Copy link
Member

6543 commented Oct 16, 2023

hmm ci fail looks related

2023/10/16 20:13:21 ...es/repository/lfs.go:74:GarbageCollectLFSMetaObjectsForRepo() [E] Unable to open git repository <Repository 1:user2/repo1>: no such file or directory
--- FAIL: TestGarbageCollectLFSMetaObjects (0.03s)
    lfs_test.go:43: 
        	Error Trace:	/home/runner/work/gitea/gitea/services/repository/lfs_test.go:43
        	Error:      	Received unexpected error:
        	            	no such file or directory
        	Test:       	TestGarbageCollectLFSMetaObjects
    lfs_test.go:47: 
        	Error Trace:	/home/runner/work/gitea/gitea/services/repository/lfs_test.go:47
        	Error:      	Target error should be in err chain:
        	            	expected: "LFS Meta object does not exist"
        	            	in chain: 
        	Test:       	TestGarbageCollectLFSMetaObjects
FAIL
coverage: 22.8% of statements

@JakobDev what do you think

@GiteaBot GiteaBot added the lgtm/blocked A maintainer has reservations with the PR and thus it cannot be merged label Oct 17, 2023
@pull-request-size pull-request-size bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 17, 2023
@JakobDev
Copy link
Contributor Author

The test is now fixed. It was caused by a Bug in TestGarbageCollectLFSMetaObjects. This tests needs the Repos, but don't call a function to make sure the Repos exists.

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/blocked A maintainer has reservations with the PR and thus it cannot be merged labels Oct 19, 2023
@6543 6543 enabled auto-merge (squash) October 19, 2023 12:47
@6543 6543 added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Oct 19, 2023
@6543 6543 merged commit 3dc0c96 into go-gitea:main Oct 19, 2023
24 checks passed
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Oct 19, 2023
@JakobDev JakobDev deleted the orgdelete branch October 19, 2023 13:18
6543 added a commit that referenced this pull request Oct 19, 2023
@JakobDev
Copy link
Contributor Author

This should be backported to 1.21

@6543 6543 added the backport/v1.21 This PR should be backported to Gitea 1.21 label Oct 19, 2023
@GiteaBot
Copy link
Collaborator

I was unable to create a backport for 1.21. @JakobDev, please send one manually. 🍵

go run ./contrib/backport 27273
...  // fix git conflicts if any
go run ./contrib/backport --continue

@GiteaBot GiteaBot added the backport/manual No power to the bots! Create your backport yourself! label Oct 19, 2023
@6543 6543 added the type/bug label Oct 19, 2023
zjjhot added a commit to zjjhot/gitea that referenced this pull request Oct 20, 2023
* upstream/main:
  Adapt `.changelog.yml` to new labeling system (go-gitea#27701)
  Update and add new eslint plugins (go-gitea#27698)
  Show total TrackedTime on issue/pull/milestone lists (go-gitea#26672)
  Add doctor dbconsistency fix to delete repos with no owner (go-gitea#27290)
  Delete repos of org when purge delete user (go-gitea#27273)
  Fix required checkboxes in issue forms (go-gitea#27592)
  Upgrade xorm (go-gitea#27673)
  [docs] Add note that PROTOCOL config is case-sensitive (go-gitea#25685)
  Remove network call on `make clean` (go-gitea#27689)
  Add unit tests for action runner token (go-gitea#27670)
  Typos fixed in documentation files (go-gitea#27687)
6543 pushed a commit to 6543-forks/gitea that referenced this pull request Oct 22, 2023
Fixes https://codeberg.org/forgejo/forgejo/issues/1514

I had to remove `RenameOrganization` to avoid circular import.

We should really add some foreign keys to the database.
@6543 6543 added the backport/done All backports for this PR have been created label Oct 22, 2023
@6543
Copy link
Member

6543 commented Oct 22, 2023

-> #27728

lunny pushed a commit that referenced this pull request Nov 1, 2023
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Jan 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/done All backports for this PR have been created backport/manual No power to the bots! Create your backport yourself! backport/v1.21 This PR should be backported to Gitea 1.21 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 size/L Denotes a PR that changes 100-499 lines, ignoring generated files. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants