2023-11-30 22:23:39 +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
> - [Русский](https://github.com/bakhirev/assayo/blob/main/documents/RU.md)
> - [English](https://github.com/bakhirev/assayo)
# [Assayo](https://assayo.jp/?ref=github&lang=en)
Visualization and analysis of your git repository data ([demo](https://assayo.jp/demo/?ref=github& lang=en& dump=./test.txt)).
##### Employee can evaluate new workplace
- work pace;
- number of extra hours worked;
- areas of responsibility;
- volume of features and bugs;
- working style of colleagues;
##### Manager can evaluate employees
- identify slackers;
- estimate the amount of code;
- learn the work speed;
- notice behavioral anomalies;
- see the dynamics of work by week;
##### Investor can evaluate product
- product cost;
- cost of features;
- development time;
- forecast of rework time;
- forecast cost;
### How to quickly view the number of commits?
In the root directory of your project, run:
2023-05-12 11:47:48 +00:00
```
git shortlog -s -n -e
```
2023-11-30 22:20:26 +00:00
### How to concat authors?
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
2023-11-30 22:20:26 +00:00
### How to export data from git?
2023-05-12 11:47:48 +00:00
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
```
2023-10-02 14:16:03 +00:00
git --no-pager log --numstat --oneline --all --reverse --date=iso-strict --pretty=format:"%ad>%cN>%cE>%s" > log.txt
```
2023-11-30 22:20:26 +00:00
#### For offline viewing
2023-10-02 14:16:03 +00:00
```
git --no-pager log --numstat --oneline --all --reverse --date=iso-strict --pretty=format:"%ad>%cN>%cE>%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.
2023-10-02 14:16:03 +00:00
2023-11-30 22:20:26 +00:00
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
2023-11-30 22:20:26 +00:00
### How to view the report online?
2023-12-06 22:07:57 +00:00
- go to the [website ](https://assayo.jp/ );
- click the “[Demo](https://assayo.jp/demo)” button;
- drag the `log.txt` file into the browser window;
2023-05-12 11:47:48 +00:00
2023-11-30 22:20:26 +00:00
### How to view the report offline?
2023-12-06 22:07:57 +00:00
- download this repository;
- drag the `log.txt` file to the `/build` folder;
- run `/build/index.html` ;
- or drag the `/build` folder to your repository (where the `log.txt` is located). You can change the name. For example, from `/build` to `/report` .
2023-05-12 11:47:48 +00:00
2023-12-06 22:07:57 +00:00
In this case, it is important that the `log.txt` file is generated by the command for offline viewing.
2023-10-02 14:16:03 +00:00
2023-11-30 22:20:26 +00:00
### How to rebuild the report build?
2023-12-06 22:07:57 +00:00
- download this repository
- run `npm install`
- run `npm run build`
- the new build will be in the `/build` folder
2023-05-12 11:47:48 +00:00
2023-11-30 22:20:26 +00:00
### How to view a report on a group of microservices?
2023-12-06 22:07:57 +00:00
- generate for each microservice file `log.txt` (`log-1.txt`, `log-2.txt` , `log-3.txt` and etc.)
- 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
2023-11-30 22:20:26 +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
2023-12-06 22:07:57 +00:00
### How to add or edit a translation?
2023-11-27 12:45:54 +00:00
2023-12-06 22:07:57 +00:00
You can add a new translation or correct an existing one in the ```ts/translations/``` folder and create a Pull Request.
2023-11-27 12:45:54 +00:00
2023-12-06 22:07:57 +00:00
### How to sign commits?
2023-05-12 11:47:48 +00:00
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
2023-12-06 22:07:57 +00:00
### How to automate data collection?
2023-08-03 21:56:09 +00:00
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);
2023-08-03 21:56:09 +00:00
2023-12-06 22:07:57 +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
2023-09-22 12:29:50 +00:00
### DevOps (CI/CD)
2023-05-12 11:47:48 +00:00
2023-12-06 22:07:57 +00:00
#### Public server
You can upload the data file for report construction to a public URL. And use the website’ s [assayo ](https://assayo.jp/?ref=github&lang=en ) to visualize it.
2023-09-22 12:29:50 +00:00
```
https://assayo.jp/demo/?dump=//you_site.com/some/log.txt
```
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.
#### How to update the Docker image?
- remove metrics, alerts, old builds;
- run ```npm run build```
- run ```docker build -t assayo .```
- visually check the image ```docker run --name assayo -p 80:80 -d assayo```;
- add tag ```docker tag IMAGE_ID bakhirev/assayo:latest```;
- push image to [Docker Hub ](https://hub.docker.com/r/bakhirev/assayo );
### Releases are planned approximately once every six months. What’ s next:
- 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;
### Feedback, suggestions, comments
- telegramm [@bakhirev ](https://t.me/bakhirev ) (priority method of communication)
2023-05-12 11:47:48 +00:00
- [alexey-bakhirev@yandex.ru ](mailto:alexey-bakhirev@yandex.ru )
2023-12-06 22:07:57 +00:00
- website [https://assayo.jp/ ](https://assayo.jp/ )
2023-05-12 11:47:48 +00:00