Skip to content
This repository has been archived by the owner on Sep 19, 2024. It is now read-only.

Refactor Config: mdast element keys as HTML entities / ref #496

Closed
Tracked by #490
0x4007 opened this issue Jul 11, 2023 · 18 comments · Fixed by #545
Closed
Tracked by #490

Refactor Config: mdast element keys as HTML entities / ref #496

0x4007 opened this issue Jul 11, 2023 · 18 comments · Fixed by #545

Comments

@0x4007
Copy link
Member

0x4007 commented Jul 11, 2023

@rndquu
Copy link
Member

rndquu commented Jul 11, 2023

This issue adds unnecessary code complexity

So under the hood we should transform html's li to mdast's list and then assign node prices.

I don't really see the difference between a vs link or img vs image. To me the mdast syntax is more friendly to none tech users compared to the \w+ which is planned to be used for words count.

@0x4007
Copy link
Member Author

0x4007 commented Jul 12, 2023

  1. I just reviewed the syntax on its readme. Theres still limitations with its implementation, in this context. Perhaps we will need more complex key names to encode all of this information. How do you propose to refer to element h2 in our config using mdast? Also notice that in communicating with you, I am able to unambiguously express which element I'm referring to.
  2. mdast is intended to be used by remark which looks like it can solve our problems with plugins to work with the markdown source. It seems that we should include remark? I'm pretty certain that it can handle this conversion for us.

@rndquu
Copy link
Member

rndquu commented Jul 12, 2023

How do you propose to refer to element h2 in our config using mdast?

We could use the same type as mdast already use:

{
  type: 'heading',
  depth: 2,
  price: 100
}

It seems that we should include remark?

remark is built on top of the micromark which we already use in the bot's code

So this task is about moving from mdast types to html types, right? In other words the incentive comments feature would work this way:

  1. Get html nodes prices from the config
  2. Convert markdown to html
  3. Calculate payouts based on the parsed html tags

@0x4007
Copy link
Member Author

0x4007 commented Jul 12, 2023

It seems like a hack to try and serialize a JSON object and use it as a key for the config property inside of a .yml file. It's better to just use the html entity as the key name. e.g.

comment-incentives:
  code: 5
  img: 5
  h1: 1
  li: 0.5
  a: 0.5
  blockquote: 0

every-x-incentives:
  every-word: 0.1 # not sure what is the most expressive property name for the "every word" incentive
  # every-sentence: 0
  # every-paragraph: 0
  • Get html nodes prices from the config
  • Convert markdown to html
  • Calculate payouts based on the parsed html tags

Seems correct.


I tried experimenting with the yml schema. It needs work but figured I would post here before sleeping. This gives us so many possibilities for customization. Note that these numbers are just for example purposes only:

incentives:
  comment:
    code: 5
    img: 5
    h1: 1
    li: 0.5
    a: 0.5
    blockquote: 0
    totals:
      word: 0.1 # not sure what is the most expressive property name for the "every word" incentive
      # sentence: 0
      # paragraph: 0
      # comment: 0
  reactions:
    received:
      thumbs-up: 1
      thumbs-down: -1
    sent:
      thumbs-up: 0.5
      thumbs-down: 0.5
      eyes: 0.5
  reviews:
    received:
      approved: 10
      rejected: -10
      left-comment: 0
    sent:
      approved: 10
      rejected: 10
      left-comment: 0

@rndquu
Copy link
Member

rndquu commented Jul 13, 2023

The time label should be updated to at least <1 Day then

@whilefoo
Copy link
Collaborator

whilefoo commented Jul 17, 2023

/start

@ubiquibot
Copy link

ubiquibot bot commented Jul 17, 2023

Deadline Tue, 18 Jul 2023 11:23:26 GMT
Registered Wallet 0xA0B11F474d8ECE1205d38c66d5F2bE8917675d60
Payment Multiplier 1.00
Multiplier Reason
Total Bounty 450 USD
Tips:
  • Use /wallet 0x4FDE...BA18 if you want to update your registered payment wallet address @user.
  • Be sure to open a draft pull request as soon as possible to communicate updates on your progress.
  • Be sure to provide timely updates to us when requested, or you will be automatically unassigned from the bounty.

    @whilefoo
    Copy link
    Collaborator

    Github API can return comments in the HTML form so I think it would be better to use that instead of using other tools for conversion?

    @rndquu
    Copy link
    Member

    rndquu commented Jul 17, 2023

    Github API can return comments in the HTML form so I think it would be better to use that instead of using other tools for conversion?

    yes, it might be better

    @whilefoo
    Copy link
    Collaborator

    Is the scope of this issue also implementing incentive of comments in the PR related to the issue and reactions of the comments?

    @rndquu
    Copy link
    Member

    rndquu commented Jul 20, 2023

    Is the scope of this issue also implementing incentive of comments in the PR related to the issue and reactions of the comments?

    I don't think so. The scope for this issue is refactoring mdast element names to html tags in the bot's config and making sure that nothing is broken. @pavlovcik pls confirm

    @whilefoo whilefoo mentioned this issue Jul 21, 2023
    @ubiquibot
    Copy link

    ubiquibot bot commented Jul 24, 2023

    Do you have any updates @whilefoo? If you would like to release the bounty back to the DevPool, please comment /unassign
    Last activity time: Thu Jul 20 2023 12:10:04 GMT+0000 (Coordinated Universal Time)

    @whilefoo
    Copy link
    Collaborator

    @ubiquibot waiting for clarification in #545

    @ubiquibot
    Copy link

    ubiquibot bot commented Jul 29, 2023

    Do you have any updates @whilefoo? If you would like to release the bounty back to the DevPool, please comment /unassign
    Last activity time: Tue Jul 25 2023 08:45:17 GMT+0000 (Coordinated Universal Time)

    @ubiquibot
    Copy link

    ubiquibot bot commented Aug 9, 2023

    Do you have any updates @whilefoo? If you would like to release the bounty back to the DevPool, please comment /unassign
    Last activity time: Sat Aug 05 2023 08:38:44 GMT+0000 (Coordinated Universal Time)

    @0x4007 0x4007 added ping and removed ping labels Aug 9, 2023
    @ubiquibot
    Copy link

    ubiquibot bot commented Aug 22, 2023

    @whilefoo - Releasing the bounty back to dev pool because the allocated duration already ended!
    Last activity time: Tue Jul 25 2023 08:45:17 GMT+0000 (Coordinated Universal Time)

    @ubiquibot ubiquibot bot added the Permitted label Aug 22, 2023
    @ubiquibot
    Copy link

    ubiquibot bot commented Aug 22, 2023

    [ CLAIM 450 WXDAI ]

    0xA0B11F47...917675d60

    If you enjoy the DevPool experience, please follow Ubiquity on GitHub and star this repo to show your support. It helps a lot!

    @ubiquibot
    Copy link

    ubiquibot bot commented Aug 22, 2023

    @whilefoo The time limit for this bounty is on Wed, 23 Aug 2023 15:00:32 UTC

    Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
    Projects
    None yet
    Development

    Successfully merging a pull request may close this issue.

    3 participants