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

Config nested inheritance #648

Closed
whilefoo opened this issue Aug 20, 2023 · 10 comments · Fixed by #691
Closed

Config nested inheritance #648

whilefoo opened this issue Aug 20, 2023 · 10 comments · Fixed by #691

Comments

@whilefoo
Copy link
Collaborator

whilefoo commented Aug 20, 2023

          We only have inheritance on top level properties, so if `incentives` property is missing from repo and org config, it will use the whole `incentives` property from default config. Nested properties don't have inheritance (if `h1` is not present in repo config it won't inherit from default config), that is something I was meaning to make an issue for.

Originally posted by @whilefoo in #545 (comment)

For example if we have a organization config:

incentives:
  comment:
    elements:
      code: 5
      img: 5
      h1: 1
    totals:
      word: 0.1

and repo config:

incentives:
  comment:
    elements:
      code: 10
      li: 3
    totals:
      word: 0.1

currently because repo config overrides organization config and we parse only top-level properties, the merged config will be the same as repo config, but we want to have inheritance on nested properties too, so the merge config should look like this:

incentives:
  comment:
    elements:
      code: 10
      img: 5
      li: 3
      h1: 1
    totals:
      word: 0.1
@0x4007
Copy link
Member

0x4007 commented Aug 21, 2023

Do you think my proposal addresses this? #647

@whilefoo
Copy link
Collaborator Author

Your solution doesn't work if the key are just top-level properties but if we did that recursively for every property then it would work.

@whilefoo
Copy link
Collaborator Author

We can do this using lodash function merge (example)

@devpanther
Copy link
Contributor

/start

@ubiquibot
Copy link

ubiquibot bot commented Aug 29, 2023

Deadline Tue, 29 Aug 2023 18:18:11 UTC
Registered Wallet 0xf76F1ACB66020f893c95371f740549F312DEA3f1
Tips:
  • Use /wallet 0x0000...0000 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.

    @ubiquibot
    Copy link

    ubiquibot bot commented Sep 7, 2023

    Task Assignee Reward

    [ CLAIM 150 WXDAI ]

    0xf76F1ACB...312DEA3f1

    If you've enjoyed your experience in the DevPool, we'd appreciate your support. Follow Ubiquity on GitHub and star this repo. Your endorsement means the world to us and helps us grow!
    We are excited to announce that the DevPool and UbiquiBot are now available to partners! Our ideal collaborators are globally distributed crypto-native organizations, who actively work on open source on GitHub, and excel in research & development. If you can introduce us to the repository maintainers in these types of companies, we have a special bonus in store for you!

    @ubiquibot
    Copy link

    ubiquibot bot commented Sep 7, 2023

    Task Creator Reward

    whilefoo: [ CLAIM 83.2 WXDAI ]

    @0x4007
    Copy link
    Member

    0x4007 commented Sep 14, 2023

    Task Creator Reward

    whilefoo: [ CLAIM 83.2 WXDAI ]

    This is a lot higher than expected.

    Is it counting words inside of code blocks? The code blocks should just count for like $5 for example. With the 4x multiplier thats $20.

    @whilefoo
    Copy link
    Collaborator Author

    Yes I think it's also counting words in code blocks and the top quote and italics

    @0x4007
    Copy link
    Member

    0x4007 commented Sep 14, 2023

    Yes I think it's also counting words in code blocks and the top quote and italics

    Yikes. We should set a special property on every element that indicates whether the parser should recurse or stop.

    incentives: 
      comments:
        totals:
          word: 0.1
        elements:
          rewards:
            code: 5
            p: 0.1
            a: 5
        ignore-children: code, i, blockquote
          

    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