mirror of
https://github.com/go-gitea/gitea.git
synced 2026-04-14 16:37:57 +02:00
Add comment for the design of "user activity time" (#37195)
This commit is contained in:
@@ -62,6 +62,7 @@ func getUserHeatmapData(ctx context.Context, user *user_model.User, team *organi
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// HINT: USER-ACTIVITY-PUSH-COMMITS: it only uses the doer's action time, it doesn't use git commit's time
|
||||
return hdata, db.GetEngine(ctx).
|
||||
Select(groupBy+" AS timestamp, count(user_id) as contributions").
|
||||
Table("action").
|
||||
|
||||
@@ -327,7 +327,7 @@ func (a *actionNotifier) PushCommits(ctx context.Context, pusher *user_model.Use
|
||||
|
||||
opType := activities_model.ActionCommitRepo
|
||||
|
||||
// Check it's tag push or branch.
|
||||
// Check its tag push or branch.
|
||||
if opts.RefFullName.IsTag() {
|
||||
opType = activities_model.ActionPushTag
|
||||
if opts.IsDelRef() {
|
||||
@@ -337,6 +337,11 @@ func (a *actionNotifier) PushCommits(ctx context.Context, pusher *user_model.Use
|
||||
opType = activities_model.ActionDeleteBranch
|
||||
}
|
||||
|
||||
// HINT: USER-ACTIVITY-PUSH-COMMITS: it's said that the time of push commits (for user activity display) is designed this way,
|
||||
// it doesn't use git commit's time, it only uses the doer's action time.
|
||||
// ref: https://github.com/go-gitea/gitea/pull/36469#issuecomment-3901955347
|
||||
// ref: https://github.com/go-gitea/gitea/issues/14051
|
||||
// ref: https://github.com/go-gitea/gitea/issues/11861#issuecomment-643162143
|
||||
if err = NotifyWatchers(ctx, &activities_model.Action{
|
||||
ActUserID: pusher.ID,
|
||||
ActUser: pusher,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{{if .EnableHeatmap}}
|
||||
{{/*HINT: USER-ACTIVITY-PUSH-COMMITS: it only uses the doer's action time, it doesn't use git commit's time */}}
|
||||
<div class="activity-heatmap-container">
|
||||
<div id="user-heatmap" class="is-loading"
|
||||
data-heatmap-url="{{.HeatmapURL}}"
|
||||
|
||||
Reference in New Issue
Block a user