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

Allow collections to define their own velocity stats #191

Merged
merged 1 commit into from
Jul 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion pkg/hubbub/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func (h *Engine) SearchIssues(ctx context.Context, org string, project string, f
}

if seen[i.GetURL()] {
klog.Errorf("unusual: I already saw #%d", i.GetNumber())
klog.Errorf("unusual: I already saw #%d", i.GetURL())
continue
}
seen[i.GetURL()] = true
Expand Down
24 changes: 14 additions & 10 deletions pkg/site/page.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,20 @@ func (h *Handlers) collectionPage(ctx context.Context, id string, refresh bool)
p.Stale = true
}

for _, s := range sts {
if s.UsedForStats {
if s.ID == VelocityStatsName {
p.VelocityStats = h.updater.Lookup(ctx, s.ID, false)
continue
}
// Older configs may not use OpenStatsName
if s.ID == OpenStatsName || p.OpenStats == nil {
p.OpenStats = h.updater.Lookup(ctx, s.ID, false)
continue
if result.Collection.Velocity != "" {
p.VelocityStats = h.updater.Lookup(ctx, result.Collection.Velocity, false)
} else {
for _, s := range sts {
if s.UsedForStats {
if s.ID == VelocityStatsName {
p.VelocityStats = h.updater.Lookup(ctx, s.ID, false)
continue
}
// Older configs may not use OpenStatsName
if s.ID == OpenStatsName || p.OpenStats == nil {
p.OpenStats = h.updater.Lookup(ctx, s.ID, false)
continue
}
}
}
}
Expand Down
1 change: 1 addition & 0 deletions pkg/triage/collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ type Collection struct {
Display string `yaml:"display"`
Overflow int `yaml:"overflow"`
Selector string `yaml:"selector"`
Velocity string `yaml:"velocity"`
}

// The result of Execute
Expand Down