-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Give organisation members access to organisation feeds #33508
Conversation
Hmm yes ..... I guess it does need tests (and yes it's not that easy to write one ......) 🤣 |
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
+}
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the tests should work without any problem now.
Thank you! |
* 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
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:
