Coder Social home page Coder Social logo

Comments (3)

durandom avatar durandom commented on May 26, 2024

The following seems to work for !assigned, but not for assigned. 🤷

diff --git a/pkg/hubbub/match.go b/pkg/hubbub/match.go
index ca279eb..7a625f5 100644
--- a/pkg/hubbub/match.go
+++ b/pkg/hubbub/match.go
@@ -95,11 +95,11 @@ func preFetchMatch(i provider.IItem, labels []*provider.Label, fs []provider.Fil
 		// This state can be performed without downloading comments
 		if f.TagRegex() != nil && f.TagRegex().String() == "^assigned$" {
 			// If assigned and no assignee, fail
-			if !f.TagNegate() && i.GetAssignee() == nil {
+			if !f.TagNegate() && len(i.GetAssignees()) == 0 {
 				return false
 			}
 			// if !assigned and has assignee, fail
-			if f.TagNegate() && i.GetAssignee() != nil {
+			if f.TagNegate() && len(i.GetAssignees()) > 0 {
 				return false
 			}
 		}
diff --git a/pkg/provider/issue.go b/pkg/provider/issue.go
index 5095fb5..92cb9f4 100644
--- a/pkg/provider/issue.go
+++ b/pkg/provider/issue.go
@@ -60,6 +60,14 @@ func (i *Issue) GetAssignee() *User {
 	return i.Assignee
 }
 
+// GetAssignees returns the Assignee field.
+func (i *Issue) GetAssignees() []*User {
+	if i == nil {
+		return nil
+	}
+	return i.Assignees
+}
+
 // GetAuthorAssociation returns the AuthorAssociation field if it's non-nil, zero value otherwise.
 func (i *Issue) GetAuthorAssociation() string {
 	if i == nil || i.AuthorAssociation == nil {
diff --git a/pkg/provider/item.go b/pkg/provider/item.go
index 41e41ee..73c4459 100644
--- a/pkg/provider/item.go
+++ b/pkg/provider/item.go
@@ -19,6 +19,7 @@ import "time"
 // Item is an interface that matches both Issues and PullRequests
 type IItem interface {
 	GetAssignee() *User
+	GetAssignees() []*User
 	GetAuthorAssociation() string
 	GetBody() string
 	GetComments() int
diff --git a/pkg/provider/pull_request.go b/pkg/provider/pull_request.go
index f6bbea4..0688bc6 100644
--- a/pkg/provider/pull_request.go
+++ b/pkg/provider/pull_request.go
@@ -84,6 +84,14 @@ func (p *PullRequest) GetAssignee() *User {
 	return p.Assignee
 }
 
+// GetAssignee returns the Assignee field.
+func (p *PullRequest) GetAssignees() []*User {
+	if p == nil {
+		return nil
+	}
+	return p.Assignees
+}
+
 // GetAuthorAssociation returns the AuthorAssociation field if it's non-nil, zero value otherwise.
 func (p *PullRequest) GetAuthorAssociation() string {
 	if p == nil || p.AuthorAssociation == nil {

from triage-party.

durandom avatar durandom commented on May 26, 2024

If you can give me some directions in #292 I'm happy to continue trying to fix it

from triage-party.

hrk091 avatar hrk091 commented on May 26, 2024

I'm facing the same issue, and the fixes in this PR work fine for me.
Is there anyone who can review it?

from triage-party.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.