Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

CredEquate: create credequate CLI/API #3299

Merged
merged 3 commits into from
Jan 25, 2022
Merged

CredEquate: create credequate CLI/API #3299

merged 3 commits into from
Jan 25, 2022

Conversation

blueridger
Copy link
Member

@blueridger blueridger commented Jan 20, 2022

Description

builds on #3295

This adds the credequate API/CLI, which is the credequate equivalent of the credrank API/CLI. This CLI turns plugin contributions into scored contributions, creates a CredGrainView, writes the results, and outputs top cred earners to the console.

Test Plan

Manual tested against sourcecred/cred/gh-pages
Results pushed to https://github.com/sourcecred/cred/tree/credequate-demo

sourcecred.json

{
  "bundledPlugins": [
  ],
  "credEquatePlugins": [
    {
      "id": "sourcecred/discord",
      "configsByTarget": {
        "453243919774253079": [
          {
            "memo": "Initial Config",
            "startDate": "1/1/2021",
            "weights": [
              {
                "key": "emoji",
                "default": 1,
                "subkeys": [
                  {
                    "subkey": "sourcecred:626763367893303303",
                    "weight": 3
                  },
                  {
                    "subkey": "馃憥",
                    "weight": 0
                  }
                ]
              },
              {
                "key": "role",
                "default": 0,
                "subkeys": [
                  {
                    "subkey": "477551557723029514",
                    "memo": "contributors",
                    "weight": 2
                  },
                  {
                    "subkey": "717905734863421472",
                    "memo": "community",
                    "weight": 1
                  }
                ]
              },
              {
                "key": "channel",
                "default": 1,
                "subkeys": [
                  {
                    "subkey": "743545520445718700",
                    "memo": "meeting-notes",
                    "weight": 8
                  },
                  {
                    "subkey": "718512695875469353",
                    "memo": "announcements",
                    "weight": 0.1
                  },
                  {
                    "subkey": "454007860926611478",
                    "memo": "any-questions",
                    "weight": 3
                  },
                  {
                    "subkey": "679064720375808026",
                    "memo": "props",
                    "weight": 15
                  },
                  {
                    "subkey": "543168537062014987",
                    "memo": "did-a-thing",
                    "weight": 12
                  }
                ]
              },
              {
                "key": "category",
                "default": 1,
                "subkeys": []
              }
            ],
            "operators": [
              {
                "key": "reactionsAcrossParticipants",
                "operator": "AVERAGE"
              },
              {
                "key": "reactionsOfSingleParticipant",
                "operator": "MAX"
              }
            ],
            "shares": [
              {
                "key": "author",
                "default": 1,
                "subkeys": [
                  {
                    "subkey": "743545520445718700",
                    "memo": "meeting-notes",
                    "weight": 0.05
                  },
                  {
                    "subkey": "679064720375808026",
                    "memo": "props",
                    "weight": 0
                  }
                ]
              },
              {
                "key": "mention",
                "default": 1,
                "subkeys": []
              }
            ]
          }
        ]
      }
    }
  ]
}
  1. run scdev contributions
  2. run scdev credequate && scdev credequate --no-zip

console result:

  GO   credequate
# Top Participants By Cred

| Description | Cred | % |
| --- | --- | --- |
| Thena | 19363.9 | 13.6% |
| Ryeder | 13586.6 | 9.5% |
| s-ben | 10616.3 | 7.5% |
| KuraFire | 8045.8 | 5.7% |
| AL0YSI0US | 7426.7 | 5.2% |
| topocount | 6737.9 | 4.7% |
| hz | 6248.4 | 4.4% |
| ezrau | 5439.0 | 3.8% |
| lbstrobbe | 5426.2 | 3.8% |
| saintmedusa | 4315.1 | 3.0% |
| panchomiguel | 4166.2 | 2.9% |
| echojuliet | 4108.1 | 2.9% |
| hammad | 3767.0 | 2.6% |
| scrabbleboy | 3627.1 | 2.5% |
| magwalk | 3441.5 | 2.4% |
| joiecousins | 2338.0 | 1.6% |
| lotusleaf | 2074.3 | 1.5% |
| Magey | 1897.0 | 1.3% |
| Willow | 1875.4 | 1.3% |
| Marcie | 1843.4 | 1.3% |
  GO   writing changes
 DONE  writing changes: 1850ms
 DONE  credequate: 5009ms

Screen Shot 2022-01-20 at 3 56 48 PM
Screen Shot 2022-01-20 at 3 57 09 PM
Screen Shot 2022-01-20 at 3 57 20 PM

Base automatically changed from discord-credequate to main January 25, 2022 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants