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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/167 - Codacy fixes #168

Merged
merged 5 commits into from
Apr 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,15 @@ This code of conduct applies to Epimetheus GitHub space. This includes issue tra
If you believe someone is violating the code of conduct, we ask that you report it by sending feedback using [feedback form](https://siili.com/salabs).

* Be friendly and patient.

* Be welcoming. We strive to be a community that welcomes and supports people of all backgrounds and identities. This includes, but is not limited to members of any race, ethnicity, culture, national origin, colour, immigration status, social and economic class, educational level, sex, sexual orientation, gender identity and expression, age, size, family status, political belief, religion, and mental and physical ability.

* Be considerate. Your work will be used by other people, and you in turn will depend on the work of others. Any decision you take will affect users and colleagues, and you should take those consequences into account when making decisions. Remember that we're a world-wide community, so you might not be communicating in someone else's primary language.

* Be respectful. Not all of us will agree all the time, but disagreement is no excuse for poor behavior and poor manners. We might all experience some frustration now and then, but we cannot allow that frustration to turn into a personal attack. It’s important to remember that a community where people feel uncomfortable or threatened is not a productive one. Members of the Epimetheus community should be respectful when dealing with other members as well as with people outside the Epimetheus community.

* Be careful in the words that you choose. We are a community of professionals, and we conduct ourselves professionally. Be kind to others. Do not insult or put down other participants. Harassment and other exclusionary behavior aren't acceptable. This includes, but is not limited to:

* Violent threats or language directed against another person.
* Discriminatory jokes and language.
* Posting sexually explicit or violent material.
Expand All @@ -23,6 +28,7 @@ If you believe someone is violating the code of conduct, we ask that you report
* Unwelcome sexual attention.
* Advocating for, or encouraging, any of the above behavior.
* Repeated harassment of others. In general, if someone asks you to stop, then stop.

* When we disagree, try to understand why. Disagreements, both social and technical, happen all the time and Epimetheus is no exception. It is important that we resolve disagreements and differing views constructively. Remember that we’re different. The strength of Epimetheus comes from its varied community, people from a wide range of backgrounds. Different people have different perspectives on issues. Being unable to understand why someone holds a viewpoint doesn’t mean that they’re wrong. Don’t forget that it is human to err and blaming each other doesn’t get us anywhere. Instead, focus on helping to resolve issues and learning from mistakes.

Original text courtesy of the [Speak Up! project](http://web.archive.org/web/20141109123859/http://speakup.io/coc.html).
Expand Down
40 changes: 23 additions & 17 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ As an open source project, Epimetheus welcomes contributions of many forms.

Examples of contributions include:

* Code patches
* Documentation improvements
* Bug reports and patch reviews
- Code patches
- Documentation improvements
- Bug reports and patch reviews

Patches can be submitted as pull requests, but if you don't file an issue, it may be ignored. Please file an issue to suggest changes.

## Branch naming and commit messages
Please start a new branch name with ```feature```, ```bug``` or ```hotfix``` depending on the type of the issue, and then add the related issue's number. The rest of the branch’s name should be short and descriptive.<br>
Please start a new branch name with `feature`, `bug` or `hotfix` depending on the type of the issue, and then add the related issue's number. The rest of the branch’s name should be short and descriptive.<br>
**Example:**
>```“feature/21-more-documentation”```
> `“feature/21-more-documentation”`

Commit messages should always start with the number of the issue that they're related to. Please avoid commits that are not related to any issue.
- If you have a small fix that's somehow related to the current issue on hand, feel free to fix it as well.
Expand All @@ -22,7 +22,7 @@ Commit messages should always start with the number of the issue that they're re
- Small and general fixes like correcting a typo or updating the documentation don't require an issue number.

## Pull requests
Before making a pull request, please rebase the local branch to the [```develop```](/~https://github.com/salabs/Epimetheus/tree/develop) branch and squash any unnecessary commits.
Before making a pull request, please rebase the local branch to the [`develop`](/~https://github.com/salabs/Epimetheus/tree/develop) branch and squash any unnecessary commits.

Pull request's title should contain the related issue's number, and the pull request should be linked to the related issue.

Expand All @@ -39,36 +39,42 @@ Epimetheus project uses [EditorConfig](https://editorconfig.org/) to manage the
for settings.

## Release strategy
Project uses semantic versioning, and all the pull requests are first created in to ```develop``` branch. Releases are done regularly when there are new commits in the development branch. The releases are done with a merge commit that has release version numbering in semantic order (Major, Minor, Patch) (Semantic versioning: <https://semver.org/>)
Project uses semantic versioning, and all the pull requests are first created in to `develop` branch. Releases are done regularly when there are new commits in the development branch. The releases are done with a merge commit that has release version numbering in semantic order (Major, Minor, Patch) (Semantic versioning: <https://semver.org/>)

![image](./release_strategy.png)

## Step-by-step example of contributing
1. Checkout to ```develop``` branch:
```
1. Checkout to `develop` branch:
```bash
git checkout develop
```

2. Checkout to a new branch and name it according to the issue's type and number:
```
```bash
git checkout -b <issuetype/issuenumber-description>
```

3. Commit changes with a clear and descriptive note that starts with the issue number:
```
```bash
git add
git commit -m "issuenumber - description of changes"
```
4. Sync with ```develop``` branch:
```

4. Sync with `develop` branch:
```bash
git checkout develop
git pull
```
5. Rebase the ```develop``` branch into the local branch. Use ```--interactive/--i``` flag to reword or squash commits:
```

5. Rebase the `develop` branch into the local branch. Use `--interactive/--i` flag to reword or squash commits:
```bash
git checkout <issuetype/issuenumber-description>
git rebase develop
```

6. Push the local branch:
```
```bash
git push
```
7. Create a pull request and follow the given guidelines. Make sure the ```base``` is set to ```develop```.

7. Create a pull request and follow the given guidelines. Make sure the `base` is set to `develop`.
9 changes: 5 additions & 4 deletions README-docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ Alternative way to run project is using docker-compose with provided configurati
### Docker environmental variables

Project uses following variables to access database:
```

```dosini
DATABASE=database_name
HOST=database_server_name
USER=database_user
Expand All @@ -19,7 +20,7 @@ Alternative way is to save these in docker-compose.yml file.

### Running docker-compose

In windows 10 powershell, you can command docker-compose with the following syntax:
In Windows 10 powershell, you can command docker-compose with the following syntax:

`$env:ENV_FILE="configfile.env"; docker-compose -f .\docker-compose.yml up --build`

Expand All @@ -29,12 +30,12 @@ Frontend runs on: [http://localhost:3000](http://localhost:3000/)

[Dockerfile-prod](./frontend/Dockerfile-prod) has two build arguments; `nginx_port` and `backend_url` with default values `8080` and `http://backend-server:5000`.
The `nginx_port` argument configures the port which the Ngnix service runs inside the Docker and the `backend_url` argument tells the Nginx service
where to route backend server requests. This arguments can be configured when building the Docker image.
where to route backend server requests. These arguments can be configured when building the Docker image.

### Running docker-compose with public images

There are also prebuilt images that you can use by running the command.

`$env:ENV_FILE="configfile.env"; docker-compose -f .\docker-compose-from-remote.yml up --build`

Note that currently the public images are built with the default arguements as defined in the chapter before.
Note that currently the public images are built with the default arguments as defined in the chapter before.
28 changes: 13 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Epimetheus Introduction
# Epimetheus Introduction

[![Codacy Badge](https://api.codacy.com/project/badge/Grade/2540205769b54d6ab25426c2158a2f70)](https://app.codacy.com/gh/salabs/Epimetheus?utm_source=github.com&utm_medium=referral&utm_content=salabs/Epimetheus&utm_campaign=Badge_Grade_Dashboard)

Expand All @@ -8,20 +8,20 @@ Epimetheus offers a dashboard/UI to visualize data from [TestArchiver](https://g

### Requirements

1. PostgreSQL database with archived result data
2. `Python v3+`
3. `Node.js v10+`
> 1. PostgreSQL database with archived result data
> 2. `Python v3+`
> 3. `Node.js v10+`

### Database

Currently the only supported database engine is PostgreSQL. It can be local or cloud version.
Currently, the only supported database engine is PostgreSQL. It can be local or cloud version.

### Backend

If you have multiple python installations on your machine, remember to use the 'python3' postfix,
also with pip you might need to use 'pip3' to make sure the requirements get installed with the right python.

```
```bash
cd backend-server
pip install -r requirements.txt
python .\server.py --database dbname --host dbhost --user dbuser --pw dbpasswd --port 5000
Expand All @@ -31,7 +31,7 @@ Detailed information in [backend readme](backend_server/README.md).

### Frontend

```
```bash
cd frontend
npm install
npm run start
Expand Down Expand Up @@ -67,23 +67,21 @@ Supported browsers are "all modern browsers". This means IE and some mobile brow
## Release Notes

- 1.1.0 (2021-03-12)

- Simple build results API
- Analysis view for a build with keyword analysis table
- Keyword analysis API
- Accessibility improvements
- Style and file name refactoring
- Dockerhub publishing for new releases
- Features:
* #141 Style and refactor the keyword analysis table enhancement
* #138 Fix various bugs caused by the grid bug
* #137 Simple single build results API enhancement
* #135 Keyword execution time analysis tool enhancement
* #133 Accessibility fix for checkbox bug
* #131 Check color usage enhancement
- <p>#141 Style and refactor the keyword analysis table enhancement</p>
- <p>#138 Fix various bugs caused by the grid bug</p>
- <p>#137 Simple single build results API enhancement</p>
- <p>#135 Keyword execution time analysis tool enhancement</p>
- <p>#133 Accessibility fix for checkbox bug</p>
- <p>#131 Check color usage enhancement</p>

- 1.0.1 (2020-10-21)

- Fixes a bug which prevented the frontend container from starting when using docker-compose
- Changes the default port of Nginx in Dockerfile-prod container from 80 to 8080. Services in Docker containers are now running as non root user.
- Layout fixes
Expand Down
14 changes: 7 additions & 7 deletions backend_server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@ Python server that connects to database and provides data for frontend.

## Database

Currently the only supported database engine is PostgreSQL. It can be local or cloud version.
Currently, the only supported database engine is PostgreSQL. It can be local or cloud version.

The database should also be initailized and some results archived before the backend server can start serving data.
The database should also be initialized, and some results archived before the backend server can start serving data.

## Running natively with python

First make sure you have `python` and `pip` installed.

Install required pip packages:

```
```bash
pip install -r .\requirements.txt
```

Start python server with environment variables:

```
```bash
python .\server.py --database dbname --host dbhost --user dbuser --pw dbpasswd --port 5000
```

Expand All @@ -30,11 +30,11 @@ If you want to use other port than 5000, set it with `--port` parameter. Note th

## Running in Docker

Use the provided [Dockerfile](Dockerfile) to run python server in container.
Use the provided [Dockerfile](Dockerfile) to run python server in a container.

Docker environment should contain values for following parameters:

```
```dosini
DATABASE: database name
HOST: database host
USER: database user
Expand All @@ -44,7 +44,7 @@ PORT: server port

## Swagger API docs

Backend API has swagger documentation available and it can be viewed at [localhost:5000/data/doc/](http://localhost:5000/data/doc) (with direct access to backend) or proxied through frontend server [localhost:3000/data/doc/](http://localhost:3000/data/doc). It uses [tornado-swagger](/~https://github.com/mrk-andreev/tornado-swagger).
Backend API has swagger documentation available, and it can be viewed at [localhost:5000/data/doc/](http://localhost:5000/data/doc) (with direct access to backend) or proxied through frontend server [localhost:3000/data/doc/](http://localhost:3000/data/doc). It uses [tornado-swagger](/~https://github.com/mrk-andreev/tornado-swagger).

Documentation is located in [server.py](server.py).

Expand Down
22 changes: 11 additions & 11 deletions deployment-templates/README.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@

# Docker Compose Files
This directory contains a few docker-compose files for different types of installations.

docker-compose-backend.yml:
- This file is aimed to provide a working backend in the case local backend installation fails.

docker-compose-from-remote.yml:
- This file creates epimetheus with default port number for nginx and default hostname for backend.
- This file creates Epimetheus with default port number for nginx and default hostname for backend.

docker-compose-with-env.yml:
- Also built from remote images.
- This file aims to display the different environmental variables available for the frontend container.
- Defining the backend hostname as a variable and the port used by nginx as a variable.

# Setup
## Setup
An .env file needs to be created for docker-compose to use for backend configuration.
Read more here https://docs.docker.com/compose/env-file/

Content of an .env file with the necessary paramaters:
```
Content of an .env file with the necessary parameters:

```dosini
DATABASE="database_name"
HOST="host"
USER="user"
PASSWORD="password"
PORT="5000"
```

Port defines the port the backend executes in, epimetheus assumes this in development environment as 5000.
Port defines the port the backend executes in, Epimetheus assumes this in development environment as 5000.

The docker-compose files define that an ENV_FILE variable needs to be given, which is basically the path to the .env file.
The docker-compose files define that an ENV_FILE variable needs to be given, which is basically the path to the .env file.
If the .env file is located in the same directory as the docker-compose files, which is recommended.

```
```bash
export ENV_FILE=".env filename"
```

# Creating an environment
## Creating an environment
After the creation of the .env file and the creation of ENV_FILE local environmental variable, you can run a specific docker-compose file with

```
docker-compose --file "docker_compose_file_name" up
```bash
docker-compose --file "docker_compose_file_name" up
```
Loading