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

Read DEFAULT_TIME_RANGE_FOR_MAX_ISSUE from env #619

Closed
rndquu opened this issue Aug 15, 2023 · 10 comments · Fixed by #639
Closed

Read DEFAULT_TIME_RANGE_FOR_MAX_ISSUE from env #619

rndquu opened this issue Aug 15, 2023 · 10 comments · Fixed by #639

Comments

@rndquu
Copy link
Member

rndquu commented Aug 15, 2023

Original discussion

For QA purposes we need to read DEFAULT_TIME_RANGE_FOR_MAX_ISSUE and DEFAULT_TIME_RANGE_FOR_MAX_ISSUE_ENABLED from env variables so that @Draeieg could set them in the netlify dashboard for testing purposes

What should be done:

  1. Read DEFAULT_TIME_RANGE_FOR_MAX_ISSUE and DEFAULT_TIME_RANGE_FOR_MAX_ISSUE_ENABLED from process.env
  2. By default set DEFAULT_TIME_RANGE_FOR_MAX_ISSUE to 24 (if env variable is empty)
  3. By default set DEFAULT_TIME_RANGE_FOR_MAX_ISSUE_ENABLED to true (if env variable is empty)
@EtherealGlow
Copy link
Contributor

/start

@ubiquibot
Copy link

ubiquibot bot commented Aug 19, 2023

Deadline Sat, 19 Aug 2023 17:24:03 UTC
Registered Wallet 0xa611a37657A76583305F557D63B94834a35C7bF4
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 Aug 26, 2023

    Task Assignee Reward

    [ CLAIM 75 WXDAI ]

    0xa611a376...a35C7bF4

    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 Aug 26, 2023

    Task Creator Reward

    rndquu: [ CLAIM 89 WXDAI ]

    @0x4007
    Copy link
    Member

    0x4007 commented Aug 26, 2023

    I just dug this up from the logs (id: 650)

    Why did this Task Creator Reward add up to be 89 WXDAI?

    This is quite a bit higher than expected

    @whilefoo @wannacfuture

    Loaded config:

    {
        "price": {
            "baseMultiplier": 1.5,
            "issueCreatorMultiplier": 2,
            "timeLabels": [
                {
                    "name": "Time: <1 Hour",
                    "weight": 0.125,
                    "value": 3600
                },
                {
                    "name": "Time: <2 Hours",
                    "weight": 0.25,
                    "value": 7200
                },
                {
                    "name": "Time: <4 Hours",
                    "weight": 0.5,
                    "value": 14400
                },
                {
                    "name": "Time: <1 Day",
                    "weight": 1,
                    "value": 86400
                },
                {
                    "name": "Time: <1 Week",
                    "weight": 2,
                    "value": 604800
                }
            ],
            "priorityLabels": [
                {
                    "name": "Priority: 0 (Normal)",
                    "weight": 1
                },
                {
                    "name": "Priority: 1 (Medium)",
                    "weight": 2
                },
                {
                    "name": "Priority: 2 (High)",
                    "weight": 3
                },
                {
                    "name": "Priority: 3 (Urgent)",
                    "weight": 4
                },
                {
                    "name": "Priority: 4 (Emergency)",
                    "weight": 5
                }
            ],
            "incentives": {
                "comment": {
                    "elements": {
                        "code": 5,
                        "img": 5,
                        "h1": 1,
                        "li": 0.5,
                        "a": 0.5,
                        "blockquote": 0
                    },
                    "totals": {
                        "word": 0.1
                    }
                }
            },
            "defaultLabels": [
                "Time: <1 Hour",
                "Priority: 0 (Normal)"
            ]
        },
        "unassign": {
            "followUpTime": 345600000,
            "disqualifyTime": 604800000
        },
        "mode": {
            "paymentPermitMaxPrice": 1000,
            "disableAnalytics": true,
            "incentiveMode": true,
            "assistivePricing": true
        },
        "log": {
            "logEnvironment": "production",
            "level": "info",
            "retryLimit": 0
        },
        "wallet": {
            "registerWalletWithVerification": false
        }
    }

    @0x4007
    Copy link
    Member

    0x4007 commented Aug 26, 2023

    I also see a suspicious log related to parsing the original specification. Perhaps it is giving credit to the HTML code that GitHub automatically generates?

    I think we might need to scrub out all html attributes?

    <p dir="auto">Original <a href="https://github.com/ubiquibot/ubiquibot-config/pull/2#discussion_r1293969395" data-hovercard-type="pull_request" data-hovercard-url="/ubiquibot/ubiquibot-config/pull/2/hovercard">discussion</a></p>
    <p dir="auto">For QA purposes we need to read <a href="https://github.com/ubiquity/ubiquibot/blob/d56a523c81829e17513f7da1f1ccb1bbdca8b180/src/configs/shared.ts#L6">DEFAULT_TIME_RANGE_FOR_MAX_ISSUE</a> and <a href="https://github.com/ubiquity/ubiquibot/blob/d56a523c81829e17513f7da1f1ccb1bbdca8b180/src/configs/shared.ts#L7C14-L7C54">DEFAULT_TIME_RANGE_FOR_MAX_ISSUE_ENABLED</a> from env variables so that <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/Draeieg/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/Draeieg">@Draeieg</a> could set them in the netlify dashboard for testing purposes</p>
    <p dir="auto">What should be done:</p>
    <ol dir="auto">
    <li>Read <code class="notranslate">DEFAULT_TIME_RANGE_FOR_MAX_ISSUE</code> and <code class="notranslate">DEFAULT_TIME_RANGE_FOR_MAX_ISSUE_ENABLED</code> from <code class="notranslate">process.env</code></li>
    <li>By default set <code class="notranslate">DEFAULT_TIME_RANGE_FOR_MAX_ISSUE</code> to <code class="notranslate">24</code> (if env variable is empty)</li>
    <li>By default set <code class="notranslate">DEFAULT_TIME_RANGE_FOR_MAX_ISSUE_ENABLED</code> to <code class="notranslate">true</code> (if env variable is empty)</li>
    </ol>

    @whilefoo
    Copy link
    Collaborator

    whilefoo commented Aug 26, 2023

    Hmm I guess we can skip links that point to github.com?
    Also github treats DEFAULT_TIME_RANGE_FOR_MAX_ISSUE_ENABLED as code even though it's not actual code. Maybe we can limit that only code tags with X minimum characters count as code?

    @0x4007
    Copy link
    Member

    0x4007 commented Aug 26, 2023

    Hmm I guess we can skip links that point to github.com?

    I think its okay, but we must scrub the links in the attributes. Only count href attribute, I guess.


    DEFAULT_TIME_RANGE_FOR_MAX_ISSUE_ENABLED this should be different than

    DEFAULT_TIME_RANGE_FOR_MAX_ISSUE_ENABLED
    

    Where the second one should be like $5 a pop. The first one should be like $1


    I believe that the first one is <code> and second one is <pre><code> not sure what mdast will be able to help us with here.

    @whilefoo
    Copy link
    Collaborator

    whilefoo commented Aug 26, 2023

    I think its okay, but we must scrub the links in the attributes. Only count href attribute, I guess.

    It only counts tags, attributes don't matter.

    I believe that the first one is <code> and second one is <pre><code> not sure what mdast will be able to help us with here.

    We don't use mdast anymore though. I can make it to stop recursing the HTML DOM when it hits <pre> this way we avoid counting additional <code> tag and it won't count the text inside the code block.

    @0x4007
    Copy link
    Member

    0x4007 commented Aug 26, 2023

    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