ubiquity-os-marketplace / text-conversation-rewards

1 stars 27 forks source link

Ensure hidden comments are not counted #110

Closed Keyrxng closed 2 months ago

Keyrxng commented 2 months ago

As the title states, we need to ensure that any comments which are marked as hidden should be deemed as not suitable for rewards.

This is because there will be scenarios where a comment is posted and for a number of reasons it would be marked as hidden symbolizing that it's irrelevant in some way to the discussion at hand.

I am uncertain if this is implemented at the moment, @gentlementlegen you would know best

0x4007 commented 2 months ago

/help

ubiquity-os[bot] commented 2 months ago

Available Commands

Command Description Example
/help List all available commands. /help
/allow Allows the user to modify the given label. /allow @user1 label
/query Returns the user's wallet, access, and multiplier information. /query @ubiquibot
/start Assign yourself to the issue. /start
/stop Unassign yourself from the issue. /stop
/wallet Register your wallet address for payments. /wallet ubq.eth
gentlementlegen commented 2 months ago

@Keyrxng this is not implemented and definitely needed since we had weird bots and comments lately. Would there be other cases except than hidden? I don't know what happens for deleted comments.

Keyrxng commented 2 months ago

@Keyrxng this is not implemented and definitely needed since we had weird bots and comments lately. Would there be other cases except than hidden? I don't know what happens for deleted comments.

Lmao I wrote about deleted comments at first too and thought nah that's stupid. But yeah for sure a simple test that after a comment is posted then deleted that it is actually removed from the API results is a good thing to check, I'm glad you brought it up.

I think all of the reasons you can hide a comment might be grouped under hidden which would make things easier

Lordsedion commented 2 months ago

/wallet 0x15D08808F3A481bA4180CCdb9848eaC437a4259C

ubiquity-os[bot] commented 2 months ago

+ Successfully registered wallet address
gentlementlegen commented 2 months ago

I went through the REST API from top to bottom and it seems that there is not way to know if a comment was minimized through the REST API but only through GraphQl calls, see also: https://github.com/orgs/community/discussions/9175

Sadly this will imply more complex changes: either we create a GraphQl query that we run for each comment, which is slow and network intensive but would require least changes, or instead we switch the whole fetching to GraphQl which is way cleaner and more efficient but requires heavy code modifications.

GraphQl reference:

query commentDetails($owner: String!, $repo: String!, $issue_number: Int!) {
  repository(owner: $owner, name: $repo) {
    issueOrPullRequest(number: $issue_number) {
      ... on Issue {
        comments(first: 100) {
          nodes {
            id
            isMinimized
          }
        }
      }
      ... on PullRequest {
        comments(first: 100) {
          nodes {
            id
            isMinimized
          }
        }
      }
    }
  }
}
0x4007 commented 2 months ago

It feels like the GitHub team gave up on REST and left it in production for backwards compatibility now that we are getting into the more esoteric features.

gentlementlegen commented 2 months ago

It appears so, also GraphQl allows for much more complex queries which I believe is the reason why they don't try to implement it back in REST. We might benefit from using GraphQl more often in our plugins I guess.

ubiquity-os[bot] commented 2 months ago
DeadlineFri, Sep 13, 5:52 PM UTC
Beneficiary 0x0fC1b909ba9265A846b82CF4CE352fc3e7EeB2ED
Tips:
<ul>
<li>Use <code>/wallet 0x0000...0000</code> if you want to update your registered payment wallet address.</li>
<li>Be sure to open a draft pull request as soon as possible to communicate updates on your progress.</li>
<li>Be sure to provide timely updates to us when requested, or you will be automatically unassigned from the task.</li>
<ul>
ubiquity-os[bot] commented 2 months ago

[ 34.28 WXDAI ]

@gentlementlegen
Contributions Overview
View Contribution Count Reward
Issue Task 1 25
Issue Comment 3 9.28
Review Comment 5 0
Conversation Incentives
Comment Formatting Relevance Reward
@Keyrxng this is not implemented and definitely needed since we …
1.95
content:
  p:
    symbols:
      \b\w+\b:
        count: 33
        multiplier: 0.1
    score: 1
multiplier: 1
0.7 1.365
I went through the REST API from top to bottom and it seems that…
6.74
content:
  p:
    symbols:
      \b\w+\b:
        count: 96
        multiplier: 0.1
    score: 1
  pre:
    symbols:
      \b\w+\b:
        count: 1
        multiplier: 0.1
    score: 0
  code:
    symbols:
      \b\w+\b:
        count: 32
        multiplier: 0.1
    score: 1
multiplier: 1
1 6.74
It appears so, also GraphQl allows for much more complex queries…
2.35
content:
  p:
    symbols:
      \b\w+\b:
        count: 41
        multiplier: 0.1
    score: 1
multiplier: 1
0.5 1.175
Resolves #110 QA: https://github.com/Meniole/conversation-rewa…
0
content:
  p:
    symbols:
      \b\w+\b:
        count: 13
        multiplier: 0
    score: 1
multiplier: 0
0.2 -
REST does not contain it, and GraphQL type has a different shape…
0
content:
  p:
    symbols:
      \b\w+\b:
        count: 32
        multiplier: 0.2
    score: 1
multiplier: 0
1 -
Auto generated defaulted to this, can change if necessary.
0
content:
  p:
    symbols:
      \b\w+\b:
        count: 9
        multiplier: 0.2
    score: 1
multiplier: 0
1 -
There might be a way to fetch all the nodes given a list of ids,…
0
content:
  p:
    symbols:
      \b\w+\b:
        count: 19
        multiplier: 0.2
    score: 1
multiplier: 0
1 -
@whilefoo new QA with changes: https://github.com/Meniole/conver…
0
content:
  p:
    symbols:
      \b\w+\b:
        count: 15
        multiplier: 0.2
    score: 1
multiplier: 0
1 -

[ 19.494 WXDAI ]

@Keyrxng
Contributions Overview
View Contribution Count Reward
Issue Specification 1 13.27
Issue Comment 1 6.224
Conversation Incentives
Comment Formatting Relevance Reward
As the title states, we need to ensure that any comments which a…
13.27
content:
  p:
    symbols:
      \b\w+\b:
        count: 75
        multiplier: 0.1
    score: 1
  code:
    symbols:
      \b\w+\b:
        count: 1
        multiplier: 0.1
    score: 5
multiplier: 3
1 13.27
Lmao I wrote about deleted comments at first too and thought nah…
7.78
content:
  p:
    symbols:
      \b\w+\b:
        count: 72
        multiplier: 0.2
    score: 1
  code:
    symbols:
      \b\w+\b:
        count: 1
        multiplier: 0.2
    score: 1
multiplier: 1
0.8 6.224

[ 2.64 WXDAI ]

@0x4007
Contributions Overview
View Contribution Count Reward
Issue Comment 1 0
Review Comment 2 2.64
Conversation Incentives
Comment Formatting Relevance Reward
It feels like the GitHub team gave up on REST and left it in pro…
0
content:
  p:
    symbols:
      \b\w+\b:
        count: 28
        multiplier: 0.1
    score: 1
multiplier: 1
- -
I'm surprised its not included in some type. Perhaps you can fin…
1.06
content:
  p:
    symbols:
      \b\w+\b:
        count: 16
        multiplier: 0.1
    score: 1
multiplier: 1
1 1.06
Why not make these single line functions? ```types…
1.58
content:
  p:
    symbols:
      \b\w+\b:
        count: 7
        multiplier: 0.1
    score: 1
  pre:
    symbols:
      \b\w+\b:
        count: 1
        multiplier: 0.1
    score: 0
  code:
    symbols:
      \b\w+\b:
        count: 16
        multiplier: 0.1
    score: 1
multiplier: 1
1 1.58

[ 0.21 WXDAI ]

@whilefoo
Contributions Overview
View Contribution Count Reward
Review Comment 1 0.21
Conversation Incentives
Comment Formatting Relevance Reward
Is it not possible to query all comments at once for isMinimized?
0.21
content:
  p:
    symbols:
      \b\w+\b:
        count: 12
        multiplier: 0.1
    score: 1
multiplier: 0.25
1 0.21