No project description provided
Project description
+---------+
|ConfigMap|
+----+----+
|
+--+-------+--------+--+
| | | |
| | mi-scheduler | |
| | | |
+------+---+---+-------+
| | | | |
| | | | |
| | | | |
| Argo Workflows |
| | | | |
| | | | |
+---------------v---v---v---v----v------------------+ +-------------------- +--------------------+
| | | Visualization | | Recommendation |
| +---------+ +---------+ +---------+ | +-------------------+ +--------------------+
| |thoth/ | | AICoE | | your | | | Project Health | | thoth |
| | station| | | | org | | | (dashboard) | | |
| +---------+ +---------+ +---------+ | | | | |
| |solver | |... | |your | | +---------+---------+ +----------+---------+
| | | | | | repos | | thoth-station/mi ^ ^
| |amun | |... | X X X X X | | | (Meta-information Indicators) | |
| | | | | | | | +-------------+---------------+
| |adviser | |... | | | | |
| | | | | | | | |
| |.... | |... | | | | +-----------------+-------------------+
| | | | | | | | | |
| +---------+ +---------+ +---------+ | | Knowledge Processsing |
| | | |
+-----------------------+---------------------------+ +-----------------+-------------------+
GitHub repositories | ^
| +--------------------------------------------------------+ |
| | | |
| | Entities Analysis +-------> Knowledge | |
+---------------->-+ +--------------------+
+---------+----------------+----------+------------------+
| Issues | Pull Requests | Readmes | etc........... |
| | | | |
+---------+----------------+----------+------------------+
This repository contains functions to store knowledge for the bot, primary goal is to use the knowledge to evaluate repository statistics.
Remember to also checkout mi-scheduler, which schedules the workflows for thoth-station/mi project.
Pre-Usage
pipenv install --dev
Usage - Create Bot Knowledge
You can extract knowledge from a repository using the following command:
GITHUB_ACCESS_TOKEN=<github_acess_token> PYTHONPATH=. pipenv run srcopsmetrics/cli.py --repository <repo_name> -c
You can extract knowledge from a organization using the following command:
GITHUB_ACCESS_TOKEN=<github_acess_token> PYTHONPATH=. pipenv run srcopsmetrics/cli.py --organization <org_name> -c
Usage - Storing Knowledge
By default the cli will try to store the bot knowledge on Ceph. In order to store on Ceph you need to provide the following env variables:
S3_ENDPOINT_URL Ceph Host name where knowledge is stored.
CEPH_BUCKET Ceph Bucket name where knowledge is stored.
CEPH_BUCKET_PREFIX Ceph Prefix where knowledge is stored.
CEPH_KEY_ID Ceph Key ID
CEPH_SECRET_KEY Ceph Secret Key
If you want to test locally you have also the option to store locally without providing any parameter adding -l flag:
GITHUB_ACCESS_TOKEN=<github_acess_token> PYTHONPATH=. pipenv run srcopsmetrics/cli.py --repository <repo_name> -c -l
Usage - Visualize Project Statistics
PYTHONPATH=. pipenv run srcopsmetrics/cli.py --repository <repo_name> -v
PYTHONPATH=. pipenv run srcopsmetrics/cli.py --organization <org_name> -v
Entity
Throughout the project, the objects with name “entities” are mentioned. Entity is essentialy a repository metadata that is being inspected during the process of analysis (e.g. Issue or Pull Request). Then, specified features are extracted from this entity and are saved as knowledge afterwards. For more information go to srcopsmetrics/entities page
Meta-Information Indicators
If you want to know more about data analyzed and collected, check Meta-Information Indicators.
Usage - Reviewer Reccomender
PYTHONPATH=. pipenv run srcopsmetrics/cli.py --project <project_name> -r True
If there are bots in the list of contributors of your project you can add them to the list at the beginning of the file. In this way you can receive the percentage of the work done by humans vs bots.
BOTS_NAMES = [
"sesheta",
"dependencies[bot]",
"dependabot[bot]",
]
number_reviewer flag is set to 2
Final Score for Reviewers assignment
The final score for the selection of the reviewers, it is based on the following contributions. (Number of reviewers is by default 2, but it can be changed)
Number of PR reviewed respect to total number of PR reviewed by the team.
Mean time to review a PR by reviewer respect to team repostiory MTTR.
Mean length of PR respect to minimum value of PR length for a specific label.
Number of commits respect to the total number of commits in the repository.
5. Time since last review compared to time from the first review of the project respect to the present time. (Time dependent contribution)
Each of the contribution as a weight factor k. If all weight factors are set to 1, all contributions to the final score have the same weight.
Example results
Repository PullRequest n. Commits n. PullRequestRev n. MTTFR MTTR
thoth-station/performance 33 38 20 0:17:30.500000 0:46:28
INFO:reviewer_recommender:-------------------------------------------------------------------------------
Contrib PR n. PR % PRRev n. PRRev % MPRLen Rev n. MRL MTTFR MTTR TLR Comm n. Comm % Bot
fridex 17 0.515152 13 0.65 S 21 3.0 0:02:44 0:31:10 40 days 00:08:36.857380 19 0.5 False
pacospace 16 0.484848 7 0.35 M 9 1.0 1:01:46 1:01:46 40 days 05:00:39.857380 19 0.5 False
Contrib C1 C2 C3 C4 C5 Score
pacospace 0.484848 0.752294 1.00000 0.5 1 0.337028
fridex 0.515152 1.490909 0.22449 0.5 1 0.159314
INFO:reviewer_recommender:Number of reviewers requested: 2
INFO:reviewer_recommender:Reviewers: ['pacospace' 'fridex']
How to contribute
Always feel free to open new Issues or engage in already existing ones!
I want to add new Entity
If you want to contribute by adding new entity that will be analysed from GitHub repositories and stored as a knowledge, your implementation has to meet with Entity criteria described above. Always remember to first create Issue and describe why do you think this new entity should be analysed and stored and what are the benefits of doing so according to the goal of thoth-station/mi project. Do not forget to reference the Issue in your Pull Request.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file srcopsmetrics-2.5.0.tar.gz
.
File metadata
- Download URL: srcopsmetrics-2.5.0.tar.gz
- Upload date:
- Size: 34.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/39.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 990956e303e934134440ffe71ccf08113edc9f9c487d6b9c62f3e77ae7fb0391 |
|
MD5 | cbb0b541d16367905582b3798a7666c6 |
|
BLAKE2b-256 | ab4d69f8aa1c0c592ba2b407d1176722f2b09d333798d17e8b95c5c77eac19c3 |
File details
Details for the file srcopsmetrics-2.5.0-py3-none-any.whl
.
File metadata
- Download URL: srcopsmetrics-2.5.0-py3-none-any.whl
- Upload date:
- Size: 58.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/39.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4598c2475b863f6a73dff2a4418240d4c96ea1b02bea97f9c2dead37cb543d7f |
|
MD5 | 3ad65df60c757f320ad8445b95f0d97b |
|
BLAKE2b-256 | 5e53b3a0f570183a6acb617644f25e5d0a310f8cfdde75a5fb693420978ffc1d |