assayo/README.md

263 lines
19 KiB
Markdown
Raw Normal View History

2024-04-25 19:54:56 +00:00
> __[English](https://github.com/bakhirev/assayo)__ | [中文](https://github.com/bakhirev/assayo/blob/main/documents/ZH.md) | [Español](https://github.com/bakhirev/assayo/blob/main/documents/ES.md) | [Français](https://github.com/bakhirev/assayo/blob/main/documents/FR.md) | [Português](https://github.com/bakhirev/assayo/blob/main/documents/PT.md) | [Deutsch](https://github.com/bakhirev/assayo/blob/main/documents/DE.md) | [日本語](https://github.com/bakhirev/assayo/blob/main/documents/JA.md) | [Русский](https://github.com/bakhirev/assayo/blob/main/documents/RU.md)
2023-11-30 22:20:26 +00:00
2024-04-25 19:54:56 +00:00
> The [main documentation](https://github.com/bakhirev/assayo/blob/main/documents/RU.md) is in russian. This is a translation. It may contain errors. If you a native speaker, you can help improve this translation. Thanks!
2023-11-30 22:20:26 +00:00
2024-05-03 08:40:42 +00:00
# [Assayo](https://assayo.online/?ref=github)
2023-11-30 22:20:26 +00:00
2024-07-19 07:51:21 +00:00
Visualization and analysis of git commit statistics. Team Lead performance tool.
Links: [demo](https://assayo.online/demo/?ref=github&dump=./test.txt), [install](https://assayo.online/demo/?ref=github), [docker](https://hub.docker.com/r/bakhirev/assayo), [reddit](https://www.reddit.com/r/ITManagers/comments/1e5k291/the_visualization_and_analysis_of_git_commit/), [habr](https://habr.com/ru/articles/763342/).
2024-04-09 21:08:47 +00:00
2024-05-05 09:13:48 +00:00
<a href="http://www.facebook.com/sharer.php?u=https%3A%2F%2Fgithub.com%2Fbakhirev%2Fassayo" target="_blank"><img src="https://assayo.online/assets/seo/social/facebook.jpg" title="Visualization and analysis of git repository" width="24px" height="24px"/></a><a href="https://reddit.com/submit?url=https%3A%2F%2Fgithub.com%2Fbakhirev%2Fassayo&title=Visualization%20and%20analysis%20of%20git%20repository" target="_blank"><img src="https://assayo.online/assets/seo/social/reddit.jpg" title="Visualization and analysis of git repository" width="24px" height="24px"/></a><a href="https://twitter.com/intent/tweet?url=https%3A%2F%2Fgithub.com%2Fbakhirev%2Fassayo&text=Visualization%20and%20analysis%20of%20git%20repository%20%3A%20Check%20your%20git%20stats%21&via=&hashtags=IT%2Cgit%2Cstatistics%2Caudit%2Cdata-visualization%2Creport" target="_blank"><img src="https://assayo.online/assets/seo/social/twitter.jpg" title="Visualization and analysis of git repository" width="24px" height="24px"/></a><a href="https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fgithub.com%2Fbakhirev%2Fassayo" target="_blank"><img src="https://assayo.online/assets/seo/social/linkedin.jpg" title="Visualization and analysis of git repository" width="24px" height="24px"/></a><a href="https://www.tumblr.com/widgets/share/tool?canonicalUrl=https%3A%2F%2Fgithub.com%2Fbakhirev%2Fassayo&title=Visualization%20and%20analysis%20of%20git%20repository&caption=Check%20your%20git%20stats%21&tags=IT%2Cgit%2Cstatistics%2Caudit%2Cdata-visualization%2Creport" target="_blank"><img src="https://assayo.online/assets/seo/social/tumblr.jpg" title="Visualization and analysis of git repository" width="24px" height="24px"/></a><a href="https://www.blogger.com/blog-this.g?u=https%3A%2F%2Fgithub.com%2Fbakhirev%2Fassayo&n=Visualization%20and%20analysis%20of%20git%20repository&t=Check%20your%20git%20stats%21" target="_blank"><img src="https://assayo.online/assets/seo/social/blogger.jpg" title="Visualization and analysis of git repository" width="24px" height="24px"/></a><a href="https://www.evernote.com/clip.action?url=https%3A%2F%2Fgithub.com%2Fbakhirev%2Fassayo&title=Visualization%20and%20analysis%20of%20git%20repository%20%3A%20Check%20your%20git%20stats%21" target="_blank"><img src="https://assayo.online/assets/seo/social/evernote.jpg" title="Visualization and analysis of git repository" width="24px" height="24px"/></a><a href="http://www.addthis.com/bookmark.php?url=https%3A%2F%2Fgithub.com%2Fbakhirev%2Fassayo" target="_blank"><img src="https://assayo.online/assets/seo/social/add.this.jpg" title="Visualization and analysis of git repository" width="24px" height="24px"/></a><a href="https://getpocket.com/edit?url=https%3A%2F%2Fgithub.com%2Fbakhirev%2Fassayo" target="_blank"><img src="https://assayo.online/assets/seo/social/getpocket.jpg" title="Visualization and analysis of git repository" width="24px" height="24px"/></a><a href="https://news.ycombinator.com/submitlink?u=https%3A%2F%2Fgithub.com%2Fbakhirev%2Fassayo&t=Visualization%20and%20analysis%20of%20git%20repository" target="_blank"><img src="https://assayo.online/assets/seo/social/hacker.news.jpg" title="Visualization and analysis of git repository" width="24px" height="24px"/></a><a href="https://buffer.com/add?text=Visualization%20and%20analysis%20of%20git%20repository%20%3A%20Check%20your%20git%20stats%21&url=https%3A%2F%2Fgithub.com%2Fbakhirev%2Fassayo" target="_blank"><img src="https://assayo.online/assets/seo/social/buffer.jpg" title="Visualization and analysis of git repository" width="24px" height="24px"/></a><a href="https://share.flipboard.com/bookmarklet/popout?v=2&title=Visualization%20and%20analysis%20of%20git%20repository%20%3A%20Check%20your%20git%20stats%21&url=https%3A%2F%2Fgithub.com%2Fbakhirev%2Fassayo" target="_blank"><img src="https://assayo.online/assets/seo/social/flipboard.jpg" title="Visualization and analysis of git repository" width="24px" height="24px"/></a><a href="http://www.instapaper.com/edit?url=https%3A%2F%2Fgithub.com%2Fbakhirev%2Fassayo&title=Visualization%20and%20analysis%20of%20g
2024-07-15 11:00:34 +00:00
<a href="https://assayo.online/demo/?dump=./test.txt" target="_blank"><img src="https://assayo.online/seo/github/index.gif" width="100%" /></a>
2024-05-05 08:54:25 +00:00
2024-04-08 22:24:39 +00:00
##### 👨‍💻 Employee can evaluate new workplace
2024-01-03 19:26:57 +00:00
- work speed;
2023-11-30 22:20:26 +00:00
- number of extra hours worked;
2024-01-03 19:26:57 +00:00
- areas of competence;
2023-11-30 22:20:26 +00:00
- volume of features and bugs;
- working style of colleagues;
2024-04-08 22:24:39 +00:00
##### ‍👨‍💼 Team lead can evaluate employees
2023-11-30 22:20:26 +00:00
- identify slackers;
- estimate the amount of code;
- learn the work speed;
- notice behavioral anomalies;
- see the dynamics of work by week;
2024-04-08 22:24:39 +00:00
##### 👑 Founder can evaluate product
2023-11-30 22:20:26 +00:00
- product cost;
- cost of features;
- development time;
- forecast of rework time;
- forecast cost;
2024-03-22 14:40:12 +00:00
### Table of contents
- [How to quickly view the number of commits?](#link-1)
- [How to concat authors?](#link-2)
- [How to export data from git?](#link-3)
- [For online viewing](#link-4)
- [For offline viewing](#link-5)
- [How to view the report?](#link-6)
2024-03-22 22:22:07 +00:00
- [Online](#link-7)
- [Offline](#link-8)
2024-07-15 07:57:59 +00:00
- [How to rebuild the HTML report from source code?](#link-9)
2024-03-22 22:22:07 +00:00
- [How to view a report on a group of microservices?](#link-10)
- [How to brand the interface?](#link-11)
- [How to sign commits?](#link-12)
- [How to add checking for commit message?](#link-13)
- [Use file commit-msg](#link-14)
- [Use package pre-commit](#link-15)
- [How to automate data collection?](#link-16)
- [With backend](#link-17)
- [Without backend](#link-18)
- [DevOps (CI/CD)](#link-19)
- [Public server](#link-20)
- [Private server](#link-21)
- [How to update the Docker image?](#link-22)
2024-04-25 19:54:56 +00:00
- [About application](#link-23)
- [Architecture](#link-24)
- [How to add or edit a translation?](#link-25)
- [RoadMap](#link-26)
- [Contacts](#link-27)
2024-03-22 22:22:07 +00:00
<a name="link-1"></a>
2024-04-25 19:54:56 +00:00
### 🚀 How to quickly view the number of commits?
2023-11-30 22:20:26 +00:00
In the root directory of your project, run:
2023-05-12 11:47:48 +00:00
```
git shortlog -s -n -e
```
2024-03-22 22:22:07 +00:00
<a name="link-2"></a>
2024-04-08 22:24:39 +00:00
### ‍🎭 How to concat authors?
2023-11-30 22:20:26 +00:00
In the root directory of your project, you need to create a `.mailmap` file.
Example of the contents of the file:
2023-05-12 11:47:48 +00:00
```
Alex B <alex@mail.uk>
Alex B <alex@mail.uk> <alex@gov.tk>
Alex B <alex@mail.uk> <bakhirev@ya.kz>
2023-09-25 07:15:24 +00:00
Alex B <alex@mail.uk> <man64@yahoo.com>
2023-05-12 11:47:48 +00:00
```
2023-11-30 22:20:26 +00:00
Read more about the format of this file you can [here](https://git-scm.com/docs/gitmailmap).
2023-05-12 11:47:48 +00:00
2024-03-22 22:22:07 +00:00
<a name="link-3"></a>
2024-04-25 19:54:56 +00:00
### 📤 How to export data from git?
2023-05-12 11:47:48 +00:00
2024-03-22 22:22:07 +00:00
<a name="link-4"></a>
2023-11-30 22:20:26 +00:00
#### For online viewing
In the root directory of your project run:
2023-05-12 11:47:48 +00:00
```
2024-07-06 11:53:22 +00:00
git --no-pager log --raw --numstat --oneline --all --reverse --date=iso-strict --pretty=format:"%ad>%aN>%aE>%s" > log.txt
2023-10-02 14:16:03 +00:00
```
2024-03-22 22:22:07 +00:00
<a name="link-5"></a>
2023-11-30 22:20:26 +00:00
#### For offline viewing
2023-10-02 14:16:03 +00:00
```
2024-07-06 11:53:22 +00:00
git --no-pager log --raw --numstat --raw --oneline --all --reverse --date=iso-strict --pretty=format:"%ad>%aN>%aE>%s" | sed -e 's/\\/\\\\/g' | sed -e 's/`/"/g' | sed -e 's/^/report.push(\`/g' | sed 's/$/\`\);/g' | sed 's/\$/_/g' > log.txt
2023-05-12 11:47:48 +00:00
```
2023-11-30 22:20:26 +00:00
Git will create a file `log.txt`.
This file contains data for show a report.
The difference between the online and offline format is the presence of a wrapper for strings. The offline format will be pulled up like a `js` file if you just opened `/build/index.html `
2023-05-12 11:47:48 +00:00
2024-08-19 13:17:30 +00:00
#### If you use PowerShell in Windows
By default, the output encoding may not match UTF-8 and the resulting log file will be unreadable. Before saving the log, you can change the encoding with the command.
```
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
```
Or open a saved file and manually change the encoding to UTF8.
2024-03-22 22:22:07 +00:00
<a name="link-6"></a>
2024-04-25 19:54:56 +00:00
### 📈 How to view the report?
2024-03-22 22:22:07 +00:00
<a name="link-7"></a>
2024-03-22 14:40:12 +00:00
#### Online
2024-02-28 20:17:21 +00:00
- go to the [website](https://assayo.online/);
- click the “[Demo](https://assayo.online/demo)” button;
2024-07-15 07:57:59 +00:00
- drop the `log.txt` file into the browser window;
2023-05-12 11:47:48 +00:00
2024-03-22 22:22:07 +00:00
<a name="link-8"></a>
2024-03-22 14:40:12 +00:00
#### Offline
2024-07-15 07:57:59 +00:00
- download this repository `git clone https://github.com/bakhirev/assayo.git`;
- drop the `log.txt` file to the `/build` folder;
2023-12-06 22:07:57 +00:00
- run `/build/index.html`;
2024-07-15 07:57:59 +00:00
- or drop the `/build` folder to your repository (where the `log.txt` is located). You can change the name. For example, from `/build` to `/report`.
2024-03-22 22:22:07 +00:00
In this case, it is important that the `log.txt` file is generated by the command for offline viewing.
2023-05-12 11:47:48 +00:00
2024-03-22 22:22:07 +00:00
<a name="link-9"></a>
2024-07-15 07:57:59 +00:00
### 🏭 How to rebuild the HTML report from source code?
- download this repository `git clone https://github.com/bakhirev/assayo.git`
2023-12-06 22:07:57 +00:00
- run `npm install`
2024-07-14 12:13:04 +00:00
- run `npm run build:local`
2024-07-15 07:57:59 +00:00
- the new HTML build will be in the `/build` folder
2023-05-12 11:47:48 +00:00
2024-03-22 22:22:07 +00:00
<a name="link-10"></a>
2024-04-08 22:24:39 +00:00
### 🗃️ How to view a report on a group of microservices?
2024-04-25 20:04:12 +00:00
- generate for each microservice file `log.txt` (`log-1.txt`, `log-2.txt`, `log-3.txt` and etc.) You can do this manually, or use the [Assayo Crawler](https://github.com/bakhirev/assayo-crawler) module for automatic log collection;
2023-12-06 22:07:57 +00:00
- see “How to view an online report?”. At the last step, drag all the files at once into the browser window.
- see “How to see a report offline?”. At the second step, drag all microservice files (`log-1.txt`, `log-2.txt`, `log-3.txt` and etc.) to the report folder (`/build`).
2023-05-12 11:47:48 +00:00
2024-03-22 22:22:07 +00:00
<a name="link-11"></a>
2024-04-08 22:24:39 +00:00
### 🎨 How to brand the interface?
2023-12-06 22:07:57 +00:00
You can create your own interface theme. Options:
- **Title**. You can set default document title in the URL parameter ```title```. Example: ```?title=You Company```
- **Visual theme**. To do this, you need to prepare a CSS file with new styles and specify its URL in the ```theme``` parameter. Example: ```?theme=//company.com/some.css```. You can use class names as selectors. Most of them do not change in new versions.
- **Language**. You can set language in the URL parameter ```lang```. Example: ```?lang=es```
2023-11-27 12:45:54 +00:00
2024-03-22 22:22:07 +00:00
<a name="link-12"></a>
2024-04-08 22:24:39 +00:00
### 📝 How to sign commits?
2023-12-06 22:07:57 +00:00
Follow the [Conventional Commits 1.0.0](https://www.conventionalcommits.org/en/v1.0.0/). Example:
2023-05-12 11:47:48 +00:00
```
JIRA-1234 feat(profile): Added avatar for user
```
2023-12-06 22:07:57 +00:00
- task number in the task tracker `(JIRA-1234)`
- type of work `(feat, fix, style, refactor, test, doc и т.д.)`
- feature `(profile - new page on site or new function, use one (two) short wordor an abbreviation)`
- what problem were solved `(Added avatar for user)`
2023-05-12 11:47:48 +00:00
2024-03-22 22:22:07 +00:00
<a name="link-13"></a>
2024-04-08 22:24:39 +00:00
### 👮 How to add checking for commit message?
2024-03-22 14:40:12 +00:00
2024-03-22 22:22:07 +00:00
<a name="link-14"></a>
2024-03-22 14:40:12 +00:00
#### Use file `commit-msg`
1. Create file `commit-msg` in folder `.git/hooks/`
2. Add this text in file:
```
#!/usr/bin/env bash
if ! grep -iqE "(JIRA-[0-9]{1,5})(\s)(feat|fix|docs|style|refactor|test|chore)((\([a-z0-9_-]{1,}\)){0,})(:\s)([a-z]{1,})" "$1"; then
echo "Need commit message like: JIRA-12 fix(profile): some text. Read Semantic Commit Messages" >&2
exit 1
fi
```
2024-03-22 22:22:07 +00:00
<a name="link-15"></a>
2024-03-22 14:40:12 +00:00
#### Use package [pre-commit](https://www.npmjs.com/package/pre-commit)
1. Add in file `package.json` property `commit-msg`:
```
...
"commit-msg": {
"regex": "(JIRA-[0-9]{1,5})(\\s)(feat|fix|docs|style|refactor|test|chore)((\\([a-z0-9_-]{1,}\\)){0,})(:\\s)([a-z]{1,})",
"error-message": "Need commit message like: JIRA-12 fix(profile): some text Read Semantic Commit Messages"
},
...
```
2. Run command `npm install pre-commit`
2024-03-22 22:22:07 +00:00
<a name="link-16"></a>
2024-04-08 22:24:39 +00:00
### 📚 How to automate data collection?
2023-08-03 21:56:09 +00:00
2024-03-22 22:22:07 +00:00
<a name="link-17"></a>
2024-03-22 14:40:12 +00:00
#### With backend
- use module [Assayo Crawler](https://github.com/bakhirev/assayo-crawler);
2024-03-22 22:22:07 +00:00
<a name="link-18"></a>
2023-12-06 22:07:57 +00:00
#### Without backend
- create a clone of the repository you need;
- copy the `build` folder to the root;
- open `build/index.html` in the browser and add it to bookmarks;
- add a shortcut to `build/assets/ci-cd.sh` to the startup folder (Windows);
2024-03-22 22:22:07 +00:00
Every time you restart the computer, the script will update statistics on all the data that automatically merged into the main branch.
2023-08-03 21:56:09 +00:00
2024-03-22 22:22:07 +00:00
<a name="link-19"></a>
2024-04-08 22:24:39 +00:00
### 🛠️ DevOps (CI/CD)
2023-05-12 11:47:48 +00:00
2024-03-22 22:22:07 +00:00
<a name="link-20"></a>
2023-12-06 22:07:57 +00:00
#### Public server
2024-05-03 08:40:42 +00:00
You can upload the data file for report construction to a public URL. And use the websites [assayo](https://assayo.online/?ref=github) to visualize it.
2023-09-22 12:29:50 +00:00
```
2024-02-28 20:17:21 +00:00
https://assayo.online/demo/?dump=//you_site.com/some/log.txt
2023-09-22 12:29:50 +00:00
```
2024-03-22 22:22:07 +00:00
<a name="link-21"></a>
2023-12-06 22:07:57 +00:00
#### Private server
- download the [docker image](https://hub.docker.com/r/bakhirev/assayo);
- run it on your local network;
- use the web interface to view the reports, set the URL of the data in the URL parameter ```dump```:
2023-09-22 12:29:50 +00:00
```
2023-09-25 07:15:24 +00:00
http://assayo_url/?dump=//you_url/some/log.txt
2023-12-06 22:07:57 +00:00
assayo_url - URL of the assayo container, it listens on port 80;
you_url - URL of your container with git logs;
2023-09-22 12:29:50 +00:00
```
2023-12-06 22:07:57 +00:00
By default, the image will run at ```http://127.0.0.1:80/```. If it doesn't work, check if port 80 is free.
2024-03-22 22:22:07 +00:00
<a name="link-22"></a>
2023-12-06 22:07:57 +00:00
#### How to update the Docker image?
2024-07-15 07:57:59 +00:00
- run ```npm run build:docker```
2023-12-06 22:07:57 +00:00
- run ```docker build -t assayo .```
- visually check the image ```docker run --name assayo -p 80:80 -d assayo```;
2024-04-30 15:13:34 +00:00
- add tag ```docker tag assayo bakhirev/assayo:latest```;
- push image to [Docker Hub](https://hub.docker.com/r/bakhirev/assayo) ```docker push bakhirev/assayo:latest```;
2023-12-06 22:07:57 +00:00
2024-03-22 22:22:07 +00:00
<a name="link-23"></a>
2024-04-25 19:54:56 +00:00
### 🛠️ About application
<a name="link-24"></a>
#### 📐 Architecture
<img src="https://raw.githubusercontent.com/bakhirev/assayo-crawler/12af4410fc93384cafb108a4429e43f9a874dbaa/schema.svg" width="70%" />
2024-05-07 06:37:18 +00:00
1. [Reports showcase UI](https://github.com/bakhirev/assayo-showcase) displays a list of available reports. Each report consists of a title, description, and a list of repositories.
2024-04-25 19:54:56 +00:00
2. [Crawler service](https://github.com/bakhirev/assayo-crawler) collects repository logs for the report.
3. [Log visualization UI](https://github.com/bakhirev/assayo) **(you here)** displays report. Needs a log file for work.
<a name="link-25"></a>
#### 🈯 How to add or edit a translation?
You can add a new translation or correct an existing one in the ```ts/translations/``` folder.
[Instruction](https://github.com/firstcontributions/first-contributions)
<a name="link-26"></a>
#### 🗺️ RoadMap:
Releases are planned approximately once every six months. Whats next:
2023-12-06 22:07:57 +00:00
- more recommendations and achievements;
- annual/monthly summaries, report printing;
- localization and internationalization;
- file analysis;
- different roles for statistics (hiding finances);
- development of the backend, integration with other systems;
2024-04-25 19:54:56 +00:00
<a name="link-27"></a>
2024-06-27 20:42:58 +00:00
#### 📬 Feedback, suggestions, comments
- <img alt="Telegram Messenger" src="https://telegram.org/img/website_icon.svg?4" style="vertical-align: middle;" /> [@bakhirev](https://t.me/bakhirev) (preferred method of communication)
- 📧 [alexey-bakhirev@yandex.ru](mailto:alexey-bakhirev@yandex.ru)
- 🌐 [https://assayo.online/](https://assayo.online/?ref=github)
2024-05-05 09:49:12 +00:00
<img src="https://mc.yandex.ru/watch/94903985" style="position:absolute; left:-9999px;" alt="" />