Give organisation members access to organisation feeds#33508
Merged
Conversation
Contributor
Hmm yes ..... I guess it does need tests (and yes it's not that easy to write one ......) 🤣 |
Author
|
Can I get some help with the unit tests? I am receiving the following error but don't understand what is going wrong. Adding a unit test from another package to the feed package fixes the issue, but I have absolutely no idea why. It doesn't even seem to execute before the other tests. diff --git a/routers/web/feed/profile_test.go b/routers/web/feed/profile_test.go
index 84e6a82c35..50dc7abc8c 100644
--- a/routers/web/feed/profile_test.go
+++ b/routers/web/feed/profile_test.go
@@ -8,6 +8,7 @@ import (
"code.gitea.io/gitea/models/unittest"
user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/routers/web/feed"
+ "code.gitea.io/gitea/routers/web/org"
"code.gitea.io/gitea/services/contexttest"
"github.com/stretchr/testify/assert"
@@ -38,3 +39,9 @@ func TestCheckGetOrgFeedsAsNonOrgMember(t *testing.T) {
feed.ShowUserFeedAtom(ctx)
assert.NotContains(t, resp.Body.String(), "<entry>") // Should not contain any entries
}
+
+func TestAddingThisTestFixesTheIssue(t *testing.T) {
+ unittest.PrepareTestEnv(t)
+ ctx, _ := contexttest.MockContext(t, "user2/-/projects/4/4")
+ org.CheckProjectColumnChangePermissions(ctx) // <- removing this line makes all tests fail
+}
|
wxiaoguang
approved these changes
Mar 15, 2025
wxiaoguang
left a comment
Contributor
There was a problem hiding this comment.
I think the tests should work without any problem now.
lunny
approved these changes
Mar 15, 2025
Author
Thank you! |
zjjhot
added a commit
to zjjhot/gitea
that referenced
this pull request
Mar 17, 2025
* giteaofficial/main: (23 commits) [skip ci] Updated translations via Crowdin Update tool dependencies (go-gitea#33907) Move hooks function to gitrepo and reduce expose repopath (go-gitea#33890) Replace text-align classes with tailwind (go-gitea#33905) Simplify secure context check (go-gitea#33906) Update JS and PY deps, misc tweaks (go-gitea#33903) Refactor functions to reduce repopath expose (go-gitea#33892) Move git references checking to gitrepo packages to reduce expose of repository path (go-gitea#33891) [skip ci] Updated translations via Crowdin Add missing translation (go-gitea#33900) Give organisation members access to organisation feeds (go-gitea#33508) Add lock for a repository pull mirror (go-gitea#33876) Fix cannot delete runners via the modal dialog (go-gitea#33895) Add file tree to file view page (go-gitea#32721) [skip ci] Updated translations via Crowdin Feature: Ephemeral action runners (go-gitea#33570) Add abstraction layer to delete repository from disk (go-gitea#33879) Make SearchMode have default value and add comments (go-gitea#33863) Fix maven panic when no package exists (go-gitea#33888) Add old svg class name to git entry icon (go-gitea#33884) ... # Conflicts: # templates/repo/wiki/revision.tmpl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently the organisation feed only includes items for public repositories (for non-administrators). This pull requests adds notifications from private repositories to the organisation-feed (for accounts that have access to the organisation).
Feed-items only get shown for repositories where the users team(s) should have access to, this filtering seems to get done by some existing code.
Needs some tests, but am unsure where/how to add them.
Before:

After:
