ubiquity / ubiquibot

Putting the 'A' in 'DAO'
https://github.com/marketplace/ubiquibot
MIT License
17 stars 59 forks source link

Invalid Property Error Logging #799

Closed 0x4007 closed 10 months ago

0x4007 commented 11 months ago
  1. It would be nice if the bot replies to invocations with the error in order to make it clear why it's down. Fortunately we have logs to rely on but if it comments the error directly then it should lead to an even faster diagnosis.
  2. The bot should not crash if there are extraneous properties. It should throw a warning in the logs though, and its comments.

Also would be great if this specific property error was fixed too.

https://github.com/ubiquity/ubiquibot/commit/4b4c8f89909424f1c4ca37ebd16b513dae42816b

Invalid config according to the logs

Originally posted by @pavlovcik in https://github.com/ubiquity/ubiquibot/issues/793#issuecomment-1732172718

gitcoindev commented 10 months ago

/start

ubiquibot[bot] commented 10 months ago

Deadline Tue, 10 Oct 2023 23:44:36 UTC
Registered Wallet 0x7e92476D69Ff1377a8b45176b1829C4A5566653a

Tips:

gitcoindev commented 10 months ago

Testing was quite tricky but I finally got it. QA passes both for situations when unnecessary properties were defined in the config:

(https://github.com/gitcoindev/ubiquibot/issues/12#issuecomment-1756275530) Invalid repo config: data must NOT have additional properties. Unnecessary properties: price-multiplier

and when some required properties are missing:

(https://github.com/gitcoindev/ubiquibot/issues/12#issuecomment-1756283392) Invalid repo config: data/newContributorGreeting must have required property 'footer'.

I will open a pull request soon.

ubiquibot[bot] commented 10 months ago

Task Assignee Reward

[ CLAIM 150 WXDAI ]

0x7e92476D...A5566653a

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[bot] commented 10 months ago

Task Creator Reward

pavlovcik: [ CLAIM 39.9 WXDAI ]

Keyrxng commented 10 months ago

So what exactly should the repo config look like as I've pulled a fresh dev branch and the only property that doesn't flag an issue for me at least is incentives... I thought it was my config so I stole rndquu's org config and same thing.

evmNetworkId: 100
issueCreatorMultiplier: 1
timeLabels:
  - name: "Time: <1 Hour"
  - name: "Time: <2 Hours"
  - name: "Time: <4 Hours"
  - name: "Time: <1 Day"
  - name: "Time: <1 Week"
priorityLabels:
  - name: "Priority: 1 (Normal)"
  - name: "Priority: 2 (Medium)"
  - name: "Priority: 3 (High)"
  - name: "Priority: 4 (Urgent)"
  - name: "Priority: 5 (Emergency)"
defaultLabels:
  - "Time: <1 Hour"
  - "Priority: 1 (Normal)"
paymentPermitMaxPrice: 1000
commentIncentives: true
maxConcurrentAssigns: 5
promotionComment: ""
assistivePricing: true
registerWalletWithVerification: false
commandSettings:
  - name: start
    enabled: true
  - name: stop
    enabled: true
  - name: wallet
    enabled: true
  - name: multiplier
    enabled: true
  - name: query
    enabled: true
  - name: autopay
    enabled: true
  - name: allow
    enabled: true
  - name: help
    enabled: true
  - name: payout
    enabled: true
  - name: ask
    enabled: true
disableAnalytics: false
enableAccessControl:
  label: true
  organization: true
incentives:
  comment:
    elements:
      code: 5
      img: 5
      h1: 1
      li: 0.5
      a: 0.5
      blockquote: 0
    totals:
      word: 0.1

image

gitcoindev commented 10 months ago

hi @Keyrxng this is interesting why it does not work for you. I went an extra mile here and I experimented on my fork, which is in repo not org and it seems to work correctly.

See here: https://github.com/gitcoindev/ubiquibot/issues/14

First I used an initial config, then I enabled a few commands old-style with a hyphen and got an error. Then I corrected the error and config was recognized. Finally I took the exact @rndquu 's config that you pasted and it also works for me.

Keyrxng commented 10 months ago

I pinged you on your QA comments, appreciate you taking the time

rndquu commented 10 months ago

hi @Keyrxng this is interesting why it does not work for you. I went an extra mile here and I experimented on my fork, which is in repo not org and it seems to work correctly.

See here: gitcoindev#14

First I used an initial config, then I enabled a few commands old-style with a hyphen and got an error. Then I corrected the error and config was recognized. Finally I took the exact @rndquu 's config that you pasted and it also works for me.

https://github.com/gitcoindev/ubiquibot/issues/14#issuecomment-1759407246

+1

rndquu commented 10 months ago

Ok, I'm getting the same error: UbiquiBot Error: Invalid org config: data must NOT have additional properties. Unnecessary properties: privateKeyEncrypted undefined error test-repo rndquu-org in the latest development branch

Checking the root cause of it

rndquu commented 10 months ago

Ok, I'm getting the same error: UbiquiBot Error: Invalid org config: data must NOT have additional properties. Unnecessary properties: privateKeyEncrypted undefined error test-repo rndquu-org in the latest development branch

Checking the root cause of it

I removed the build folder (lib) and built the project again and the error is gone...

gitcoindev commented 10 months ago

Ok, I'm getting the same error: UbiquiBot Error: Invalid org config: data must NOT have additional properties. Unnecessary properties: privateKeyEncrypted undefined error test-repo rndquu-org in the latest development branch Checking the root cause of it

I removed the build folder (lib) and built the project again and the error is gone...

yarn clean should do the trick then !