psss / did

What did you do last week, month, year?
https://did.readthedocs.io/
GNU General Public License v2.0
245 stars 103 forks source link

Merge is not working for github #346

Closed maxandersen closed 6 months ago

maxandersen commented 7 months ago

having multiple emails I get duplicates in output even when using --merge:

* Issues commented on github: 9
    * quarkusio/quarkus#37000 - Add qute-web to the platform
    * quarkusio/quarkus-workshops#276 - quarkus.http.cors.origin in the doc...
    * quarkusio/quarkus#6588 - [CI] - Quickstarts Native Build + Quarkus main
    * quarkusio/quarkus#37000 - Add qute-web to the platform
    * quarkusio/quarkus-workshops#276 - quarkus.http.cors.origin in the doc...
    * quarkusio/quarkus#6588 - [CI] - Quickstarts Native Build + Quarkus main
    * quarkusio/quarkus#37000 - Add qute-web to the platform
    * quarkusio/quarkus-workshops#276 - quarkus.http.cors.origin in the doc...
    * quarkusio/quarkus#6588 - [CI] - Quickstarts Native Build + Quarkus main

any way have this just be:

* Issues commented on github: 3
    * quarkusio/quarkus#37000 - Add qute-web to the platform
    * quarkusio/quarkus-workshops#276 - quarkus.http.cors.origin in the doc...
    * quarkusio/quarkus#6588 - [CI] - Quickstarts Native Build + Quarkus main
maxandersen commented 7 months ago

issue is that comparision is done using check if an instance is present in the list.

By implementing eq on githubIssue I could fix it for that case - but I'm wondering if that is going to break other assumptions as theoretically other parts of the issue could be different.

here is what I added to github.py:

def __eq__(self, other):
        """ Equality comparison """
        if isinstance(other, Issue):
            return self.owner == other.owner and self.project == other.project and self.id == other.id
        return False

    def __hash__(self):
        """ Hash function """
        return hash((self.owner, self.project, self.id))