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

Invalid Property Error Logging #799

Closed
0x4007 opened this issue Sep 23, 2023 · 12 comments · Fixed by #852
Closed

Invalid Property Error Logging #799

0x4007 opened this issue Sep 23, 2023 · 12 comments · Fixed by #852

Comments

@0x4007
Copy link
Member

0x4007 commented Sep 23, 2023

  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.

4b4c8f8

Invalid config according to the logs

Originally posted by @pavlovcik in #793 (comment)

@gitcoindev
Copy link
Contributor

/start

@ubiquibot
Copy link

ubiquibot bot commented Oct 10, 2023

Deadline Tue, 10 Oct 2023 23:44:36 UTC
Registered Wallet 0x7e92476D69Ff1377a8b45176b1829C4A5566653a
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.

    @gitcoindev
    Copy link
    Contributor

    gitcoindev commented Oct 10, 2023

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

    (gitcoindev#12 (comment))
    Invalid repo config: data must NOT have additional properties. Unnecessary properties: price-multiplier

    and when some required properties are missing:

    (gitcoindev#12 (comment))
    Invalid repo config: data/newContributorGreeting must have required property 'footer'.

    I will open a pull request soon.

    gitcoindev added a commit to gitcoindev/ubiquibot that referenced this issue Oct 10, 2023
    The bot replies directly to invocations with invalid config to make it
    clear why it's down. A new helper method upsertLastCommentToIssue was
    introduce to avoid adding multpile comments with the same error message.
    
    Resolves: ubiquity#799
    gitcoindev added a commit to gitcoindev/ubiquibot that referenced this issue Oct 10, 2023
    gitcoindev added a commit to gitcoindev/ubiquibot that referenced this issue Oct 11, 2023
    As suggested during PR review, getAllIssueComments returns all issue
    comments using paginated response.
    
    Resolves: ubiquity#799
    0xcodercrane added a commit that referenced this issue Oct 11, 2023
    * feat: reply to invalid config
    
    The bot replies directly to invocations with invalid config to make it
    clear why it's down. A new helper method upsertLastCommentToIssue was
    introduce to avoid adding multpile comments with the same error message.
    
    Resolves: #799
    
    * fix: add missing await for upsertLastCommentToIssue
    
    Resolves: #799
    
    * chore: uUpdate src/helpers/issue.ts
    
    * feat: use getAllIssueComments in upsertLastCommentToIssue
    
    As suggested during PR review, getAllIssueComments returns all issue
    comments using paginated response.
    
    Resolves: #799
    
    * feat: upsertLastCommentToIssue use raw format
    
    ---------
    
    Co-authored-by: 0xCodercrane <108444211+0xcodercrane@users.noreply.github.com>
    @ubiquibot ubiquibot bot added the Permitted label Oct 11, 2023
    @ubiquibot
    Copy link

    ubiquibot bot commented Oct 11, 2023

    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
    Copy link

    ubiquibot bot commented Oct 11, 2023

    Task Creator Reward

    pavlovcik: [ CLAIM 39.9 WXDAI ]

    @Keyrxng
    Copy link
    Member

    Keyrxng commented Oct 12, 2023

    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
    Copy link
    Contributor

    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.

    @Keyrxng
    Copy link
    Member

    Keyrxng commented Oct 12, 2023

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

    @rndquu
    Copy link
    Member

    rndquu commented Oct 12, 2023

    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.

    gitcoindev#14 (comment)

    +1

    @rndquu
    Copy link
    Member

    rndquu commented Oct 12, 2023

    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
    Copy link
    Member

    rndquu commented Oct 12, 2023

    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
    Copy link
    Contributor

    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 !

    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.

    4 participants