diff options
author | 2024-05-16 09:04:39 +0300 | |
---|---|---|
committer | 2024-05-16 09:04:39 +0300 | |
commit | 366153a7cdd2b9c2de4ec435156737085921c656 (patch) | |
tree | 647b08b73941a2da69755e113d4fd694a05acd32 /pkg/models | |
parent | eapi6 overview: minor improvements (diff) | |
download | soko-366153a7cdd2b9c2de4ec435156737085921c656.tar.gz soko-366153a7cdd2b9c2de4ec435156737085921c656.tar.bz2 soko-366153a7cdd2b9c2de4ec435156737085921c656.zip |
bugs: show all general bugs
Closes: https://bugs.gentoo.org/931966
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Diffstat (limited to 'pkg/models')
-rw-r--r-- | pkg/models/bug.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/pkg/models/bug.go b/pkg/models/bug.go index 15bdaf5..1329631 100644 --- a/pkg/models/bug.go +++ b/pkg/models/bug.go @@ -1,5 +1,14 @@ package models +type BugComponent string + +const ( + BugComponentVulnerabilities BugComponent = "Vulnerabilities" + BugComponentStabilization BugComponent = "Stabilization" + BugComponentKeywording BugComponent = "Keywording" + BugComponentGeneral BugComponent = "" +) + type Bug struct { Id string `pg:",pk"` Product string @@ -20,3 +29,12 @@ type VersionToBug struct { VersionId string BugId string } + +func (b *Bug) MatchesComponent(component BugComponent) bool { + if component != BugComponentGeneral { + return b.Component == string(component) + } + return b.Component != string(BugComponentVulnerabilities) && + b.Component != string(BugComponentStabilization) && + b.Component != string(BugComponentKeywording) +} |