Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
146 commits
Select commit Hold shift + click to select a range
6e0917f
begin work on base subfeatures
GamerGirlandCo Aug 13, 2025
32ca039
add group model
GamerGirlandCo Dec 25, 2024
63b97fc
create GroupList type and methods
GamerGirlandCo Dec 25, 2024
f24f1e6
add `Group` methods and helper functions
GamerGirlandCo Dec 25, 2024
ab82f67
add avatar to group
GamerGirlandCo Dec 28, 2024
a9e3ee5
add `ParentGroup` field and related `LoadParentGroup` method to `Grou…
GamerGirlandCo Dec 28, 2024
817a9f2
add `GroupTeam` and `GroupUnit` structs and helpers
GamerGirlandCo Dec 28, 2024
e5dd5e9
add condition and builder functions to be used when searching for groups
GamerGirlandCo Dec 28, 2024
21526f8
add `OwnerName` field to `Group` struct
GamerGirlandCo Dec 28, 2024
d77e2a6
rename `DisplayName` -> `FullName` for consistency
GamerGirlandCo Dec 28, 2024
227e59d
add `IsPrivate` and `Visibility` fields to `Group` struct
GamerGirlandCo Dec 28, 2024
0ce8b79
add `FindGroupsByCond` helper function
GamerGirlandCo Dec 28, 2024
aa79e1b
fix nonexistent variable reference in `GetGroupByID` function
GamerGirlandCo Dec 28, 2024
ac9892f
add `GroupLink` method to `Group` struct
GamerGirlandCo Dec 28, 2024
ac33856
add helper functions for dealing with group hierarchies
GamerGirlandCo Dec 28, 2024
35c789d
refactor subgroup loading, add method to load only groups accessible …
GamerGirlandCo Dec 28, 2024
639b627
register `GroupTeam` and `GroupUnit` models
GamerGirlandCo Dec 28, 2024
3df182f
add condition and builder functions to be used when searching for groups
GamerGirlandCo Dec 28, 2024
7f74545
changes
GamerGirlandCo Jan 9, 2025
6c85e2f
update group model
GamerGirlandCo Jan 9, 2025
b201600
add `UserOrgTeamPermCond` function
GamerGirlandCo Jan 9, 2025
a3a44c8
add new fields and methods to `GroupTeam` model
GamerGirlandCo Jan 9, 2025
a612627
update group_unit.go
GamerGirlandCo Jan 9, 2025
70f44fa
remove unused parameter from `Group.relAvatarLink` method
GamerGirlandCo Jan 9, 2025
234be4c
[models] update repo model
GamerGirlandCo Jan 9, 2025
33e397a
update repo_permission.go
GamerGirlandCo Jan 9, 2025
061bdbe
add conversion functions for repository groups
GamerGirlandCo Jan 9, 2025
1ad2357
add file with functions relating to organization teams and repo groups
GamerGirlandCo Jan 9, 2025
088cf5c
update `team_list.go`
GamerGirlandCo Jan 9, 2025
ff8b8e3
add group-related url segments to list of reserved usernames
GamerGirlandCo Jan 9, 2025
d17ab88
[models/search-options] add `GroupID` to `SearchRepoOptions`
GamerGirlandCo Jan 9, 2025
590a621
[models/conds] add functions returning builders to help find repos ma…
GamerGirlandCo Jan 10, 2025
5655ea9
[models/conds] update some repo conditions to check for access provid…
GamerGirlandCo Jan 10, 2025
f7077a0
[models] update `GetTeamRepositories` to also return repositories acc…
GamerGirlandCo Jan 10, 2025
bcb4b6f
[services] ensure `OwnerName` field is updated in groups owned by an …
GamerGirlandCo Jan 10, 2025
6c0dbf2
[misc] update avatar utils to handle group avatars
GamerGirlandCo Jan 10, 2025
d4e9803
fix duplicate teams being returned by `GetTeamsWithAccessToGroup`
GamerGirlandCo Jul 20, 2025
3b95289
fix bug where all repos are returned even when `opts.GroupID` == 0
GamerGirlandCo Jul 20, 2025
f6a7ae5
remove unused/redundant `IsPrivate` field from Group struct
GamerGirlandCo Aug 11, 2025
3f9a905
add `UpdateGroup` function
GamerGirlandCo Aug 11, 2025
b9f6946
[services] update `MoveGroupItem` function to set `newPos` to the len…
GamerGirlandCo Aug 11, 2025
69847ef
add missing nil check before `IsErrGroupNotExist` call
GamerGirlandCo Aug 13, 2025
a45142f
add test fixtures
GamerGirlandCo Aug 13, 2025
bce268b
fix `no columns found to update` error when recalculating group access
GamerGirlandCo Aug 13, 2025
e985ca5
add some unit tests for group service
GamerGirlandCo Aug 13, 2025
d75ed6c
fix deadlock caused by differing contexts when retrieving group ances…
GamerGirlandCo Aug 13, 2025
3357767
re-add `PermissionNoAccess` function
GamerGirlandCo Aug 13, 2025
88e4535
add `GroupID` field to `CreateRepoOptions`
GamerGirlandCo Aug 13, 2025
20468e5
fix build error caused by changed function name
GamerGirlandCo Aug 13, 2025
c2d30e0
add `GroupID` and `GroupSortOrder` fields to `Repository` api struct
GamerGirlandCo Aug 13, 2025
cea8af1
fix more build errors
GamerGirlandCo Aug 13, 2025
3e366ed
add api types for groups
GamerGirlandCo Aug 13, 2025
a239b7c
fix a few more build errors
GamerGirlandCo Aug 13, 2025
55cc277
regenerate swagger definitions
GamerGirlandCo Aug 13, 2025
c603713
format files
GamerGirlandCo Aug 13, 2025
e378717
reapply changes wiped out by conflict resolution
GamerGirlandCo Aug 13, 2025
4e6694f
add ownership check when moving repository to a new group
GamerGirlandCo Aug 13, 2025
2ebfa2e
apply simple linting changes
GamerGirlandCo Aug 13, 2025
457044e
apply simple linting changes
GamerGirlandCo Aug 13, 2025
a543cfb
update repo service to check that `GroupID` is owned by the repo owne…
GamerGirlandCo Aug 14, 2025
93d0e6a
move parameters of the `MoveGroup` function into a struct, `MoveGroup…
GamerGirlandCo Aug 14, 2025
9745994
rename tables in group-related query conditions
GamerGirlandCo Aug 14, 2025
fc85f5f
add api routes and functions for repository groups
GamerGirlandCo Aug 14, 2025
6ff1eba
add `doer` parameter to `MoveGroupItem` describing the user trying to…
GamerGirlandCo Aug 14, 2025
947fcb0
update `AccessibleGroupCondition` function to take a minimum `perm.Ac…
GamerGirlandCo Aug 14, 2025
16e7fef
remove bare return
GamerGirlandCo Aug 14, 2025
a8ca76e
run formatter
GamerGirlandCo Aug 14, 2025
e177ce7
move group routes that don't depend on the `org` path parameter out o…
GamerGirlandCo Aug 14, 2025
849fd54
add appropriate swagger definitions
GamerGirlandCo Aug 14, 2025
5a408cf
refactor group creation such that we know the owner ID ahead of time,…
GamerGirlandCo Aug 14, 2025
54fe70a
fix swagger definition references to nonexistent `CreateGroupOption`
GamerGirlandCo Aug 14, 2025
16d5d76
add api routes and functions to get a repository group's subgroups an…
GamerGirlandCo Aug 14, 2025
b71e6de
fix build errors
GamerGirlandCo Aug 14, 2025
fc3112f
fix build and lint errors
GamerGirlandCo Aug 14, 2025
cadaf4a
fix failing tests ?
GamerGirlandCo Aug 14, 2025
6c4d70d
ensure we return early if there was an error loading group units
GamerGirlandCo Aug 16, 2025
c925824
fix bug where `builder.In` cond for groups and teams was not placed i…
GamerGirlandCo Aug 16, 2025
1cf163f
remove `UNIQUE` constraint on `Group.LowerName`
GamerGirlandCo Aug 16, 2025
d7f1cbc
add explicit `TEXT` type to `Group.LowerName` tag
GamerGirlandCo Aug 16, 2025
c3a2641
add/remove more constraints for mssql/mysql compatibility
GamerGirlandCo Aug 16, 2025
b3656c0
rename test fixture files for group units and teams
GamerGirlandCo Aug 16, 2025
b28c4f9
fix more failing tests
GamerGirlandCo Aug 16, 2025
ae7a9d5
add indices to group_id and group_sort_order column
GamerGirlandCo Aug 17, 2025
4eeec9a
add `AvatarURL` field to api groups (in `modules/structs` package)
GamerGirlandCo Aug 16, 2025
2b0e45d
update repository storage layout as per https://github.com/go-gitea/g…
GamerGirlandCo Aug 17, 2025
a93c572
update API routes as well
GamerGirlandCo Aug 17, 2025
a6327b2
fix optional path segments not working out as planned
GamerGirlandCo Aug 18, 2025
5322907
update `FullName` method to show group id if it's non-zero
GamerGirlandCo Aug 18, 2025
f586d41
add group ID column to repository table's unique constraint
GamerGirlandCo Aug 18, 2025
53ff433
add group id segment to repository's `Link` method
GamerGirlandCo Aug 18, 2025
c3aed71
fix broken hooks
GamerGirlandCo Aug 18, 2025
f79fca7
make it more apparent in URLs that a repo is part of a group
GamerGirlandCo Aug 18, 2025
72995d9
fix broken hooks (again)
GamerGirlandCo Aug 18, 2025
f4b2ae3
ensure that repository is moved on disk in `MoveGroupItem` function
GamerGirlandCo Aug 18, 2025
1a7ee73
fix moving items to the root-level (`GroupID` <= 0)
GamerGirlandCo Aug 18, 2025
37f9752
fix bug where a repo's group id and group sort order are zero in API …
GamerGirlandCo Aug 22, 2025
ef8eb1f
ensure visited repo's group owner is the same as the repo's owner, ot…
GamerGirlandCo Aug 22, 2025
b41c031
begin work on base subfeatures
GamerGirlandCo Aug 13, 2025
ec54c6b
begin work on base subfeatures
GamerGirlandCo Aug 13, 2025
ed212b5
begin work on base subfeatures
GamerGirlandCo Aug 13, 2025
df71e2b
ensure we do not display an add button when viewing a group's projects
GamerGirlandCo Aug 13, 2025
7cd3441
add template for creating a new group
GamerGirlandCo Aug 13, 2025
a36d0cd
add templates for group settings page
GamerGirlandCo Aug 13, 2025
ec9ed3c
add template for group selection dropdown
GamerGirlandCo Aug 13, 2025
cc7ffcc
add templates for main group page
GamerGirlandCo Aug 13, 2025
6937b64
create new types for the frontend
GamerGirlandCo Aug 13, 2025
51e35ec
create templates to display a sidebar containing a user's groups in a…
GamerGirlandCo Aug 13, 2025
a1307a8
add structs describing group-related forms
GamerGirlandCo Aug 13, 2025
01e47eb
add sidebar which displays accessible group hierarchy to organization…
GamerGirlandCo Aug 15, 2025
2f70e5c
add drag-and-drop functionality to org group sidebar
GamerGirlandCo Aug 15, 2025
02fefbc
add new styles
GamerGirlandCo Aug 15, 2025
df82d00
add a menu for selecting parent group to repo creation page
GamerGirlandCo Aug 15, 2025
447b11b
add `group_id` field to repo creation forms
GamerGirlandCo Aug 15, 2025
e080e76
add templates for pages to add and manage teams with access to a group
GamerGirlandCo Aug 15, 2025
5482186
add `LoadHeaderCount` function for group pages
GamerGirlandCo Aug 15, 2025
b81c015
make group selection in the new repository form look more hierarchical
GamerGirlandCo Aug 16, 2025
0a735c4
update org home page to show group navigation menu on the right
GamerGirlandCo Aug 16, 2025
880c2bb
add missing class to the group selector in the repo creation form
GamerGirlandCo Aug 16, 2025
318250e
update group homepage template to reflect new file paths
GamerGirlandCo Aug 16, 2025
2e604cf
remove `SafeHTML` calls in group team page template
GamerGirlandCo Aug 16, 2025
88d6c8f
add missing imports to `index-domready.ts`
GamerGirlandCo Aug 16, 2025
9a01d13
inject group-related values in `OrgAssignment`
GamerGirlandCo Aug 16, 2025
8109610
inject group-related values into web context
GamerGirlandCo Aug 16, 2025
146df88
add functions to populate web context with group info where appropriate
GamerGirlandCo Aug 16, 2025
4e89f25
add methods for retrieving nesting depth and generating a left paddin…
GamerGirlandCo Aug 16, 2025
961f55d
remove `Projects` tab from group header menu
GamerGirlandCo Aug 16, 2025
c549a4d
export `GetUnitPerms` from `routers/web/org` package for reuse in fut…
GamerGirlandCo Aug 16, 2025
af3fb23
add group pages to web router
GamerGirlandCo Aug 16, 2025
6232962
add component for searching for teams to add to a group
GamerGirlandCo Aug 16, 2025
590bc85
add ability to search for repository activity based on repo groups
GamerGirlandCo Aug 16, 2025
b0d9af5
inject group id and organization name into dashboard repo list's data…
GamerGirlandCo Aug 16, 2025
aabc526
create templates for group selection menu displayed in organization d…
GamerGirlandCo Aug 16, 2025
e7ddd4b
add group-scoped dashboard pages for issues, pull requests and milest…
GamerGirlandCo Aug 16, 2025
e69b38a
add `sortablejs-vue3` and `object-hash` dependencies
GamerGirlandCo Aug 16, 2025
a9a671e
create vue components to construct reorderable group hierarchy in das…
GamerGirlandCo Aug 16, 2025
f7e37bb
modify DashboardRepoList component to show DashboardRepoGroup instead…
GamerGirlandCo Aug 16, 2025
631151a
fix js/ts linter errors
GamerGirlandCo Aug 16, 2025
d70a6e2
run formatter and fix lint errors
GamerGirlandCo Aug 17, 2025
d688a40
fix another lint error
GamerGirlandCo Aug 17, 2025
d6eb3d5
fix vet errors
GamerGirlandCo Aug 17, 2025
419b5e8
add group breadcrumbs to repo page header
GamerGirlandCo Aug 18, 2025
ad5e0b7
fix some issue/pull URLs in javascript
GamerGirlandCo Aug 18, 2025
27148ed
ensure that only root-level repos are displayed on org homepage
GamerGirlandCo Aug 18, 2025
d599302
use group_service to move groups and repos after dragging and dropping
GamerGirlandCo Aug 18, 2025
db767f1
fix `data-url` in root level group tree sortable
GamerGirlandCo Aug 18, 2025
8185cee
fix bug where group sort order is not updated correctly
GamerGirlandCo Aug 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions cmd/hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ Gitea or set your environment appropriately.`, "")
// the environment is set by serv command
isWiki, _ := strconv.ParseBool(os.Getenv(repo_module.EnvRepoIsWiki))
username := os.Getenv(repo_module.EnvRepoUsername)
groupID, _ := strconv.ParseInt(os.Getenv(repo_module.EnvRepoGroupID), 10, 64)
reponame := os.Getenv(repo_module.EnvRepoName)
userID, _ := strconv.ParseInt(os.Getenv(repo_module.EnvPusherID), 10, 64)
prID, _ := strconv.ParseInt(os.Getenv(repo_module.EnvPRID), 10, 64)
Expand Down Expand Up @@ -254,7 +255,7 @@ Gitea or set your environment appropriately.`, "")
hookOptions.OldCommitIDs = oldCommitIDs
hookOptions.NewCommitIDs = newCommitIDs
hookOptions.RefFullNames = refFullNames
extra := private.HookPreReceive(ctx, username, reponame, hookOptions)
extra := private.HookPreReceive(ctx, username, reponame, groupID, hookOptions)
if extra.HasError() {
return fail(ctx, extra.UserMsg, "HookPreReceive(batch) failed: %v", extra.Error)
}
Expand All @@ -277,7 +278,7 @@ Gitea or set your environment appropriately.`, "")

fmt.Fprintf(out, " Checking %d references\n", count)

extra := private.HookPreReceive(ctx, username, reponame, hookOptions)
extra := private.HookPreReceive(ctx, username, reponame, groupID, hookOptions)
if extra.HasError() {
return fail(ctx, extra.UserMsg, "HookPreReceive(last) failed: %v", extra.Error)
}
Expand Down Expand Up @@ -350,6 +351,7 @@ Gitea or set your environment appropriately.`, "")
pusherID, _ := strconv.ParseInt(os.Getenv(repo_module.EnvPusherID), 10, 64)
prID, _ := strconv.ParseInt(os.Getenv(repo_module.EnvPRID), 10, 64)
pusherName := os.Getenv(repo_module.EnvPusherName)
groupID, _ := strconv.ParseInt(os.Getenv(repo_module.EnvRepoGroupID), 10, 64)

hookOptions := private.HookOptions{
UserName: pusherName,
Expand Down Expand Up @@ -399,7 +401,7 @@ Gitea or set your environment appropriately.`, "")
hookOptions.OldCommitIDs = oldCommitIDs
hookOptions.NewCommitIDs = newCommitIDs
hookOptions.RefFullNames = refFullNames
resp, extra := private.HookPostReceive(ctx, repoUser, repoName, hookOptions)
resp, extra := private.HookPostReceive(ctx, repoUser, repoName, groupID, hookOptions)
if extra.HasError() {
_ = dWriter.Close()
hookPrintResults(results)
Expand All @@ -414,7 +416,7 @@ Gitea or set your environment appropriately.`, "")
if count == 0 {
if wasEmpty && masterPushed {
// We need to tell the repo to reset the default branch to master
extra := private.SetDefaultBranch(ctx, repoUser, repoName, "master")
extra := private.SetDefaultBranch(ctx, repoUser, repoName, groupID, "master")
if extra.HasError() {
return fail(ctx, extra.UserMsg, "SetDefaultBranch failed: %v", extra.Error)
}
Expand All @@ -432,7 +434,7 @@ Gitea or set your environment appropriately.`, "")

fmt.Fprintf(out, " Processing %d references\n", count)

resp, extra := private.HookPostReceive(ctx, repoUser, repoName, hookOptions)
resp, extra := private.HookPostReceive(ctx, repoUser, repoName, groupID, hookOptions)
if resp == nil {
_ = dWriter.Close()
hookPrintResults(results)
Expand All @@ -445,7 +447,7 @@ Gitea or set your environment appropriately.`, "")

if wasEmpty && masterPushed {
// We need to tell the repo to reset the default branch to master
extra := private.SetDefaultBranch(ctx, repoUser, repoName, "master")
extra := private.SetDefaultBranch(ctx, repoUser, repoName, groupID, "master")
if extra.HasError() {
return fail(ctx, extra.UserMsg, "SetDefaultBranch failed: %v", extra.Error)
}
Expand Down Expand Up @@ -513,6 +515,7 @@ Gitea or set your environment appropriately.`, "")
repoName := os.Getenv(repo_module.EnvRepoName)
pusherID, _ := strconv.ParseInt(os.Getenv(repo_module.EnvPusherID), 10, 64)
pusherName := os.Getenv(repo_module.EnvPusherName)
groupID, _ := strconv.ParseInt(os.Getenv(repo_module.EnvRepoGroupID), 10, 64)

// 1. Version and features negotiation.
// S: PKT-LINE(version=1\0push-options atomic...) / PKT-LINE(version=1\n)
Expand Down Expand Up @@ -626,7 +629,7 @@ Gitea or set your environment appropriately.`, "")
}

// 3. run hook
resp, extra := private.HookProcReceive(ctx, repoUser, repoName, hookOptions)
resp, extra := private.HookProcReceive(ctx, repoUser, repoName, groupID, hookOptions)
if extra.HasError() {
return fail(ctx, extra.UserMsg, "HookProcReceive failed: %v", extra.Error)
}
Expand Down
14 changes: 12 additions & 2 deletions models/activities/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"time"

"code.gitea.io/gitea/models/db"
group_model "code.gitea.io/gitea/models/group"
issues_model "code.gitea.io/gitea/models/issues"
"code.gitea.io/gitea/models/organization"
repo_model "code.gitea.io/gitea/models/repo"
Expand Down Expand Up @@ -435,6 +436,7 @@ type GetFeedsOptions struct {
db.ListOptions
RequestedUser *user_model.User // the user we want activity for
RequestedTeam *organization.Team // the team we want activity for
RequestedGroup *group_model.Group // the group we want activity for
RequestedRepo *repo_model.Repository // the repo we want activity for
Actor *user_model.User // the user viewing the activity
IncludePrivate bool // include private actions
Expand Down Expand Up @@ -514,8 +516,16 @@ func ActivityQueryCondition(ctx context.Context, opts GetFeedsOptions) (builder.
if opts.Actor == nil || !opts.Actor.IsAdmin {
cond = cond.And(builder.In("repo_id", repo_model.AccessibleRepoIDsQuery(opts.Actor)))
}

if opts.RequestedRepo != nil {
if opts.RequestedGroup != nil {
cond = cond.And(builder.In("`action`.repo_id",
builder.Select("id").
From("repository").
Where(builder.Or(
builder.In("`repository`.group_id", group_model.ChildGroupCond(opts.RequestedGroup.ID)),
builder.Eq{"`repository`.group_id": opts.RequestedGroup.ID}),
),
))
} else if opts.RequestedRepo != nil {
// repo's actions could have duplicate items, see the comment of NotifyWatchers
// so here we only filter the "original items", aka: user_id == act_user_id
cond = cond.And(
Expand Down
10 changes: 6 additions & 4 deletions models/activities/user_heatmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"context"

"code.gitea.io/gitea/models/db"
group_model "code.gitea.io/gitea/models/group"
"code.gitea.io/gitea/models/organization"
user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/setting"
Expand All @@ -21,15 +22,15 @@ type UserHeatmapData struct {

// GetUserHeatmapDataByUser returns an array of UserHeatmapData
func GetUserHeatmapDataByUser(ctx context.Context, user, doer *user_model.User) ([]*UserHeatmapData, error) {
return getUserHeatmapData(ctx, user, nil, doer)
return getUserHeatmapData(ctx, user, nil, nil, doer)
}

// GetUserHeatmapDataByUserTeam returns an array of UserHeatmapData
func GetUserHeatmapDataByUserTeam(ctx context.Context, user *user_model.User, team *organization.Team, doer *user_model.User) ([]*UserHeatmapData, error) {
return getUserHeatmapData(ctx, user, team, doer)
func GetUserHeatmapDataByUserTeam(ctx context.Context, user *user_model.User, team *organization.Team, group *group_model.Group, doer *user_model.User) ([]*UserHeatmapData, error) {
return getUserHeatmapData(ctx, user, team, group, doer)
}

func getUserHeatmapData(ctx context.Context, user *user_model.User, team *organization.Team, doer *user_model.User) ([]*UserHeatmapData, error) {
func getUserHeatmapData(ctx context.Context, user *user_model.User, team *organization.Team, group *group_model.Group, doer *user_model.User) ([]*UserHeatmapData, error) {
hdata := make([]*UserHeatmapData, 0)

if !ActivityReadable(user, doer) {
Expand All @@ -53,6 +54,7 @@ func getUserHeatmapData(ctx context.Context, user *user_model.User, team *organi
Actor: doer,
IncludePrivate: true, // don't filter by private, as we already filter by repo access
IncludeDeleted: true,
RequestedGroup: group,
// * Heatmaps for individual users only include actions that the user themself did.
// * For organizations actions by all users that were made in owned
// repositories are counted.
Expand Down
Loading
Loading