ubiquity-os-marketplace / command-start-stop

Manager user commands to assign / un-assign themselves to tasks.
0 stars 18 forks source link

Collaborator Gating Based On Label #62

Closed 0x4007 closed 1 week ago

0x4007 commented 1 month ago
  - uses:
    - plugin: https://ubiquibot-assistive-pricing-development.ubiquity.workers.dev
      with:
        labels:
          time:
            - "Time: <1 Hour"
              collaboratorOnly: false
            - "Time: <2 Hours"
              collaboratorOnly: false
            - "Time: <4 Hours"
              collaboratorOnly: true
            - "Time: <1 Day"
              collaboratorOnly: true
            - "Time: <1 Week"
              collaboratorOnly: true
            - "Time: <1 Month"
              collaboratorOnly: true
          priority:
            - "Priority: 1 (Normal)"
              collaboratorOnly: false
            - "Priority: 2 (Medium)"
              collaboratorOnly: false
            - "Priority: 3 (High)"
              collaboratorOnly: true
            - "Priority: 4 (Urgent)"
              collaboratorOnly: true
            - "Priority: 5 (Emergency)"
              collaboratorOnly: true
        basePriceMultiplier: 2
        publicAccessControl:
          setLabel: true
          fundExternalClosedIssue: false

We could even embed metadata in the label description, although for this purpose maybe via the config here is simple enough.

0x4007 commented 1 month ago

@gentlementlegen I think this could save us from a lot of unnecessary blockers. Perhaps you can prioritize it?

ubiquity-os[bot] commented 1 month ago

@gentlementlegen the deadline is at Tue, Oct 1, 5:41 PM UTC

gentlementlegen commented 1 month ago

@0x4007 Should we add a tag on the task or should it just be taken from the configuration?

0x4007 commented 1 month ago

Just from the configuration. I don't think extra labels is a good idea.

gentlementlegen commented 1 month ago

@0x4007 Any message to display like "This issue is for collaborators only?"

0x4007 commented 1 month ago

In the future I think its worthwhile to assume the correct answer for these small details that are fast to change to reduce delay. This message seems fine to start!

gentlementlegen commented 1 month ago

@0x4007 I just realized this was created under the configuration of assistive-pricing, so I think we should create a new label on the issue for this so command-start-stop can check it and know if the task is restricted or not.

0x4007 commented 1 month ago

I don't think extra labels is a good idea.

To me it seems like a lazy answer to keep adding labels for every feature. We already went through this with v1 of bot and the issues all looked like a mess.

gentlementlegen commented 1 month ago

First idea then would be to add a description inside the label saying "Collaborator only" so that command-start-stop can check the restrictions on the labels, without having to add new ones.

0x4007 commented 1 month ago

We could even embed metadata in the label description, although for this purpose maybe via the config here is simple enough.

I don't think it makes sense to implement a new approach. Just read from config like we always do because it works fine. We can embed metadata in the description if we have more complex needs.

gentlementlegen commented 1 month ago

The configuration you linked is not for this plugin, plugins are not aware of the configuration of the others which is what I am trying to solve here.

Currently command-start-stop reads the labels that were set from assistive-pricing which is the only way they convey information to each other so far. Which is why I first proposed to have another tag. But I think adding the restrictions within the tag themselves allows for easy parsing and does not add much more logic, and no new tags. Otherwise I am not sure how to approach this.

0x4007 commented 1 month ago

Then you have to sync. It's more complicated than just reading from config every time I think

gentlementlegen commented 1 month ago

What do you mean by "to sync"?

0x4007 commented 1 month ago

Any changes to the config have to sync all the descriptions every time with your proposal. It's more complex.

gentlementlegen commented 1 month ago

assistive-pricing already syncs all the labels whenever there is a change in pricing / label added / labels removed / labels edited so I don't think more logic is needed.

0x4007 commented 1 month ago

Then let's embed in the description if that means less new code.

Given that we don't do that anywhere else, and that we do something more similar to my proposal, I am highly skeptical that it is the simplest way.

gentlementlegen commented 1 month ago

Will depend on https://github.com/ubiquity-os-marketplace/daemon-pricing/pull/18 to be completed in order to have the label updates working properly.

gentlementlegen commented 1 month ago

So through the UI the labels would look like this image

which I think is helpful when creating the tasks.

0x4007 commented 1 month ago

Perhaps we can use emoji so that it stands out like ⚠️

gentlementlegen commented 1 month ago

Not sure if GitHub supports that, will have a look.

0x4007 commented 1 month ago

To clarify I mean in the description. ⚠️ contributor only.

gentlementlegen commented 1 month ago

Yes got it. It seems to be supported: image

0x4007 commented 1 month ago

Price shoudn't have that

gentlementlegen commented 1 month ago

@0x4007 Yes it was for testing, I didn't remove that tag, pricing won't have them.

ubiquity-os[bot] commented 1 month ago
! All linked pull requests must be closed to generate rewards.
ubiquity-os[bot] commented 1 month ago

@gentlementlegen, this task has been idle for a while. Please provide an update.

ubiquity-os-beta[bot] commented 1 month ago

@gentlementlegen, this task has been idle for a while. Please provide an update.

gentlementlegen commented 1 month ago

Still waiting on https://github.com/ubiquity-os-marketplace/daemon-pricing/pull/18 to be merged in.

Keyrxng commented 3 weeks ago

https://github.com/ubiquity-os-marketplace/daemon-pricing/pull/42#issuecomment-2431077191

Since https://github.com/ubiquity-os-marketplace/daemon-pricing/pull/18 is not actually blocking this and after looking over things I'd like offer a super simple ultra low code suggestion that can be merged in under an hour

To me it seems like a lazy answer to keep adding labels for every feature. We already went through this with v1 of bot and the issues all looked like a mess.

Then you have to sync. It's more complicated than just reading from config every time I think

It really is as easy as reading from the config when the user calls /start, then if the task labels are lower than the new config thresholds they can start it.

   - uses:
     - plugin: http://localhost:4000
       runsOn:  ["issue_comment.created", "issues.assigned", "issues.unassigned", "pull_request.opened", "pull_request.edited"]
       with:
         reviewDelayTolerance: "1 Day"
         taskStaleTimeoutDuration: "30 Days"
         maxConcurrentTasks: 
           member: 2
           contributor: 5
         startRequiresWallet: false
         rolesWithReviewAuthority: ["OWNER", "ADMIN", "MEMBER", "CONTRIBUTOR"]

         collaboratorOnlyThresholds:{
           time: 1 week,
           priority: 4 urgent
         }

The benefits of using assistive-pricing I guess is being able to update label descriptions but that was never a concern before, as a comment on the task is usually the chosen approach to user feedback as opposed to bury inside label info which a contributor may not see unless they open up the label selection dropdown, and ultimately we'd need to serve feedback from /start anyway.

"time" and "priority" prefixes may be changed by partners I think but not us so can deal with that later if that's an issue reading this approach.

Keyrxng commented 3 weeks ago

example, I can't set labels in this org so I cannot see all of the available labels, meaning this description is hidden to contributors, so if they use /start we'll need to provide feedback anyway.

image

gentlementlegen commented 3 weeks ago

@Keyrxng Thanks for the idea! However this is all already implemented there so I could change this after we merge https://github.com/ubiquity-os-marketplace/daemon-pricing/pull/42

Keyrxng commented 3 weeks ago

@Keyrxng Thanks for the idea! However this is all already implemented there so I could change this after we merge ubiquity-os-marketplace/daemon-pricing#42

I saw that PR was merged yeah, although if the descriptions are only visible to people with access it's more of an internal quality of life having label descriptions since only team can see them.

Since they are not dependant on each other the change could be made in start-stop first and not be held back by me or any other bugs or whatever, if the plan is to change it later, may as well do it first as there is nothing holding that back.

Sorry, just trying to provide value/solutions vs problems and delays considering how things are rn, hope you understand.

gentlementlegen commented 2 weeks ago

Actually if you pass your cursor over the tags you can see the "collaborator only". And either way when users try to assign they would get a message.

Sure but we need to configuration change feature anyway.

Keyrxng commented 2 weeks ago

Actually if you pass your cursor over the tags you can see the "collaborator only".

Didn't notice this my mistake

ubiquity-os-beta[bot] commented 1 week ago

 [ 200 WXDAI ] 

@gentlementlegen
Contributions Overview
ViewContributionCountReward
IssueTask1200
IssueComment150
ReviewComment20
Conversation Incentives
CommentFormattingRelevanceReward
@0x4007 Should we add a tag on the task or should it just be tak…
0
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 18
  wordValue: 0
  result: 0
0.850
@0x4007 Any message to display like "This issue is for collabora…
0
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 12
  wordValue: 0
  result: 0
0.90
@0x4007 I just realized this was created under the configuration…
0
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 38
  wordValue: 0
  result: 0
0.880
First idea then would be to add a description inside the label s…
0
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 30
  wordValue: 0
  result: 0
0.870
The configuration you linked is not for this plugin, plugins are…
0
content:
  content:
    p:
      score: 0
      elementCount: 2
  result: 0
regex:
  wordCount: 93
  wordValue: 0
  result: 0
0.920
What do you mean by "to sync"?
0
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 7
  wordValue: 0
  result: 0
0.80
`assistive-pricing` already syncs all the labels wheneve…
0
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 27
  wordValue: 0
  result: 0
0.910
Will depend on https://github.com/ubiquity-os-marketplace/daemon…
0
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 25
  wordValue: 0
  result: 0
0.650
So through the UI the labels would look like this![image](http…
5
content:
  content:
    p:
      score: 0
      elementCount: 3
    img:
      score: 5
      elementCount: 1
  result: 5
regex:
  wordCount: 19
  wordValue: 0
  result: 0
0.60
Not sure if GitHub supports that, will have a look.
0
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 10
  wordValue: 0
  result: 0
0.60
Yes got it. It seems to be supported:![image](https://github.c…
5
content:
  content:
    p:
      score: 0
      elementCount: 2
    img:
      score: 5
      elementCount: 1
  result: 5
regex:
  wordCount: 8
  wordValue: 0
  result: 0
0.550
@0x4007 Yes it was for testing, I didn't remove that tag, pricin…
0
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 17
  wordValue: 0
  result: 0
0.820
Still waiting on https://github.com/ubiquity-os-marketplace/daem…
0
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 17
  wordValue: 0
  result: 0
0.70
@Keyrxng Thanks for the idea! However this is all already implem…
5
content:
  content:
    p:
      score: 0
      elementCount: 1
    a:
      score: 5
      elementCount: 1
  result: 5
regex:
  wordCount: 30
  wordValue: 0
  result: 0
0.750
Actually if you pass your cursor over the tags you can see the "…
0
content:
  content:
    p:
      score: 0
      elementCount: 2
  result: 0
regex:
  wordCount: 37
  wordValue: 0
  result: 0
0.780
Resolves #62
0
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 2
  wordValue: 0
  result: 0
0.50
@0x4007 should not happenhttps://github.com/ubiquity-os-market…
0
content:
  content:
    p:
      score: 0
      elementCount: 2
  result: 0
regex:
  wordCount: 22
  wordValue: 0
  result: 0
0.20

 [ 24.6465 WXDAI ] 

@0x4007
Contributions Overview
ViewContributionCountReward
IssueSpecification115.48
IssueComment118.5005
ReviewComment20.666
Conversation Incentives
CommentFormattingRelevanceReward
- Since we still are ways off to implementing XP, we should impl…
5.16
content:
  content:
    ul:
      score: 0
      elementCount: 1
    li:
      score: 0.5
      elementCount: 3
    p:
      score: 0
      elementCount: 4
  result: 1.5
regex:
  wordCount: 69
  wordValue: 0.1
  result: 3.66
115.48
@gentlementlegen I think this could save us from a lot of unnece…
1.17
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 18
  wordValue: 0.1
  result: 1.17
0.850.9945
Just from the configuration. I don't think extra labels is a goo…
0.94
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 14
  wordValue: 0.1
  result: 0.94
0.750.705
In the future I think its worthwhile to assume the correct answe…
1.8
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 30
  wordValue: 0.1
  result: 1.8
0.71.26
To me it seems like a lazy answer to keep adding labels for ever…
1.9
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 32
  wordValue: 0.1
  result: 1.9
0.651.235
I don't think it makes sense to implement a new approach. Just r…
2.15
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 37
  wordValue: 0.1
  result: 2.15
0.61.29
Then you have to sync. It's more complicated than just reading f…
1.17
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 18
  wordValue: 0.1
  result: 1.17
0.550.6435
Any changes to the config have to sync all the descriptions ever…
1.28
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 20
  wordValue: 0.1
  result: 1.28
0.50.64
Then let's embed in the description if that means less new code.…
2.4
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 42
  wordValue: 0.1
  result: 2.4
0.451.08
Perhaps we can use emoji so that it stands out like ⚠️
0.77
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 11
  wordValue: 0.1
  result: 0.77
0.40.308
To clarify I mean in the description. ⚠️ contributor only.
0.65
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 9
  wordValue: 0.1
  result: 0.65
0.350.2275
Price shoudn't have that
0.39
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 5
  wordValue: 0.1
  result: 0.39
0.30.117
```suggestionthrow logger.error("Only co…
0
content:
  content: {}
  result: 0
regex:
  wordCount: 0
  wordValue: 0.1
  result: 0
0.90
Just make sure that you don't change the Price label description…
1.11
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 17
  wordValue: 0.1
  result: 1.11
0.60.666

 [ 4.42 WXDAI ] 

@Keyrxng
Contributions Overview
ViewContributionCountReward
IssueComment44.42
Conversation Incentives
CommentFormattingRelevanceReward
https://github.com/ubiquity-os-marketplace/daemon-pricing/pull/4…
8.06
content:
  content:
    p:
      score: 0
      elementCount: 5
  result: 0
regex:
  wordCount: 175
  wordValue: 0.1
  result: 8.06
0.851.71775
example, I can't set labels in this org so I cannot see all of t…
7.1
content:
  content:
    p:
      score: 0
      elementCount: 2
    img:
      score: 5
      elementCount: 1
  result: 5
regex:
  wordCount: 36
  wordValue: 0.1
  result: 2.1
0.81.675
I saw that PR was merged yeah, although if the descriptions are …
5.18
content:
  content:
    p:
      score: 0
      elementCount: 3
  result: 0
regex:
  wordCount: 104
  wordValue: 0.1
  result: 5.18
0.750.97625
Didn't notice this my mistake
0.46
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 6
  wordValue: 0.1
  result: 0.46
0.40.051