Skip to content

Commit

Permalink
2.0.0 - New major version
Browse files Browse the repository at this point in the history
  • Loading branch information
lowitea committed Jan 11, 2022
2 parents ad69969 + 47f80e9 commit d3c97a0
Show file tree
Hide file tree
Showing 49 changed files with 1,856 additions and 1,955 deletions.
1 change: 0 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ omit =
*/.local/*
*/tests/*
conftest.py
*/admin.py
*/urls.py

[report]
Expand Down
6 changes: 6 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ ignore =
WPS115,
; f-string missing prefix
FS003,
; Found a too complex `f` string
WPS237,
; Found wrong metadata variable
WPS410,

per-file-ignores =
; all tests
Expand All @@ -41,6 +45,8 @@ per-file-ignores =
WPS211,
; Found too many `assert` statements
WPS218,
; Found too many methods
WPS214,

; all init files
__init__.py:
Expand Down
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2
updates:
- package-ecosystem: pip
directory: "/"
schedule:
interval: daily
time: "04:30"
open-pull-requests-limit: 20
assignees:
- lowitea
labels:
- dependencies
37 changes: 37 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: "CodeQL"

on:
pull_request:
branches-ignore:
- 'dependabot/**'

push:
branches-ignore:
- 'dependabot/**'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'python' ]

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
29 changes: 29 additions & 0 deletions .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Type checking

on: [push, pull_request]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Setup Poetry
uses: Gr1N/setup-poetry@v7

- name: Install dependencies
run: |
python -m pip install --upgrade pip
poetry install
- name: Analysing the code with mypy
env:
KESHA_SECRET_KEY: secret
run: |
poetry run mypy kesha --ignore-missing-imports
51 changes: 51 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,57 @@
# Version history
We follow [Semantic Versions](https://semver.org/).

## 2.0.0 - New major version

### Important changes
- Add templating for response body and response headers [#7](https://github.com/NUTtech/Kesha/issues/7)
- Add status saving to the log [#75](https://github.com/NUTtech/Kesha/issues/75)
- Add proxy requests with a two-way log record [#9](https://github.com/NUTtech/Kesha/issues/9)

### Minor changes
- Add type annotations [#4](https://github.com/NUTtech/Kesha/issues/4)
- Change logo [#60](https://github.com/NUTtech/Kesha/issues/60)
- Update wemake-style-guide [#61](https://github.com/NUTtech/Kesha/issues/61)
- Adds badge for CodeQL [#19](https://github.com/NUTtech/Kesha/pull/19)
- Fixes run CodeQL [#18](https://github.com/NUTtech/Kesha/pull/18)

### Updating dependencies
- django from 3.1.13 to 3.1.14 [#124](https://github.com/NUTtech/Kesha/pull/124)
- ipython from 7.28.0 to 7.31.0 [#119](https://github.com/NUTtech/Kesha/pull/119)
- uvicorn from 0.15.0 to 0.16.0 [#104](https://github.com/NUTtech/Kesha/pull/104)
- django-debug-toolbar from 3.2.2 to 3.2.4 [#109](https://github.com/NUTtech/Kesha/pull/109)
- django-extensions from 3.1.3 to 3.1.5 [#89](https://github.com/NUTtech/Kesha/pull/89)
- psycopg2-binary from 2.9.1 to 2.9.3 [#116](https://github.com/NUTtech/Kesha/pull/116)
- mypy from 0.910 to 0.931 [#121](https://github.com/NUTtech/Kesha/pull/121)
- requests from 2.26.0 to 2.27.1 [#118](https://github.com/NUTtech/Kesha/pull/118)
- wemake-python-styleguide from 0.15.3 to 0.16.0 [#107](https://github.com/NUTtech/Kesha/pull/107)
- pytest-django from 4.4.0 to 4.5.2 [#102](https://github.com/NUTtech/Kesha/pull/102)
- celery-types from 0.8.2 to 0.10.0 [#117](https://github.com/NUTtech/Kesha/pull/117)
- django-simpleui from 2021.10.15 to 2022.1 [#106](https://github.com/NUTtech/Kesha/pull/106)
- celery from 5.1.2 to 5.2.3 [#115](https://github.com/NUTtech/Kesha/pull/115)
- restrictedpython from 5.1 to 5.2 [#94](https://github.com/NUTtech/Kesha/pull/94)
- types-requests from 2.25.11 to 2.27.5 [#122](https://github.com/NUTtech/Kesha/pull/122)
- lake8-use-fstring from 1.2.1 to 1.3 [#79](https://github.com/NUTtech/Kesha/pull/79)
- django-environ from 0.8.0 to 0.8.1 [#76](https://github.com/NUTtech/Kesha/pull/76)
- flake8-use-fstring from 1.2 to 1.2.1 [#77](https://github.com/NUTtech/Kesha/pull/77)
- pytest-mypy-plugins from 1.9.1 to 1.9.2 [#73](https://github.com/NUTtech/Kesha/pull/73)
- flake8-use-fstring from 1.1 to 1.2 [#74](https://github.com/NUTtech/Kesha/pull/74)
- celery-types from 0.8.1 to 0.8.2 [#72](https://github.com/NUTtech/Kesha/pull/72)
- django-environ from 0.7.0 to 0.8.0 [#69](https://github.com/NUTtech/Kesha/pull/69)
- django-simpleui from 2021.8.17 to 2021.10.15 [#68](https://github.com/NUTtech/Kesha/pull/68)
- pytest-django from 4.3.0 to 4.4.0 [#33](https://github.com/NUTtech/Kesha/pull/33)
- django-environ from 0.4.5 to 0.7.0 [#54](https://github.com/NUTtech/Kesha/pull/54)
- django-simpleui from 2021.3 to 2021.8.17 [#48](https://github.com/NUTtech/Kesha/pull/48)
- celery from 5.1.0 to 5.1.2 [#38](https://github.com/NUTtech/Kesha/pull/38)
- requests from 2.25.1 to 2.26.0 [#41](https://github.com/NUTtech/Kesha/pull/41)
- psycopg2-binary from 2.8.6 to 2.9.1 [#34](https://github.com/NUTtech/Kesha/pull/34)
- pytest from 6.2.4 to 6.2.5 [#51](https://github.com/NUTtech/Kesha/pull/51)
- ipython from 7.23.1 to 7.28.0 [#55](https://github.com/NUTtech/Kesha/pull/55)
- pytest-cov from 2.12.0 to 3.0.0 [#56](https://github.com/NUTtech/Kesha/pull/56)
- celery from 5.0.5 to 5.1.0 [#21](https://github.com/NUTtech/Kesha/pull/21)
- pytest-django from 4.1.0 to 4.3.0 [#13](https://github.com/NUTtech/Kesha/pull/13)
- pytest-cov from 2.11.1 to 2.12.0 [#16](https://github.com/NUTtech/Kesha/pull/16)

## 1.2.0 - The parrot's name is now Kesha!

## 1.1.0 - Disable logs by default
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Build:
![build](https://github.com/NUTtech/Kesha/workflows/build/badge.svg)

Code quality:
[![CodeQL](https://github.com/NUTtech/Kesha/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/NUTtech/Kesha/actions/workflows/codeql-analysis.yml)
[![codecov](https://codecov.io/gh/NUTtech/Kesha/branch/develop/graph/badge.svg?token=788OM63owZ)](https://codecov.io/gh/NUTtech/Kesha)
[![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/NUTtech/Kesha.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/NUTtech/Kesha/context:python)
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=NUTtech_Kesha&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=NUTtech_Kesha)
Expand Down Expand Up @@ -42,6 +43,3 @@ We welcome all contributions!
See [CONTRIBUTING.md](CONTRIBUTING.md) if you want to contribute.
You can start with [issues that need some help](https://github.com/NUTtech/Kesha/issues)
right now.

## Note
The project was forked from https://github.com/Uma-Tech/parrot version 1.1.0. And this parrot now lives here.
1 change: 1 addition & 0 deletions docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- [Local run](quick-start/local-run.md)
- [Usage](usage/index.md)
- [First steps](usage/first-steps.md)
- [Proxy stubs](usage/proxy-stubs.md)
- [Request scripts](usage/request-scripts.md)
- [Changelog](changelog.md)
- [Contributing](contributing.md)
Expand Down
Binary file removed docs/src/images/01.jpg
Binary file not shown.
Binary file removed docs/src/images/02.jpg
Binary file not shown.
Binary file removed docs/src/images/03.jpg
Binary file not shown.
Binary file removed docs/src/images/04.jpg
Binary file not shown.
Binary file removed docs/src/images/05.jpg
Binary file not shown.
Binary file removed docs/src/images/06.jpg
Binary file not shown.
Binary file added docs/src/images/home.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/images/proxy_logs.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/images/proxy_stub_add.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/images/proxy_stubs.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/images/request_logs.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/images/request_script.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/images/request_stub_add.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/images/request_stubs.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{{#include ../../README.md}}

## Screenshots
![](./images/01.jpg)
![](./images/home.jpg)

![](./images/02.jpg)
![](./images/request_logs.jpg)

![](./images/03.jpg)
![](./images/request_stubs.jpg)

![](./images/04.jpg)
![](./images/request_stub_add.jpg)
10 changes: 5 additions & 5 deletions docs/src/usage/first-steps.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

## Create an http-stub

1. Go to `HTTP Stubs` -> `Stubs`
![](../images/03.jpg)
1. Go to `HTTP Stubs` -> `Request stubs`
![](../images/request_stubs.jpg)
1. Click the `Add` button
1. Fill in the required fields
![](../images/04.jpg)
![](../images/request_stub_add.jpg)
1. Click the `Save` button

## Logs

1. Send a http-request to the created http-stub
1. Go to `HTTP Stubs` -> `Logs`
![](../images/02.jpg)
1. Go to `HTTP Stubs` -> `Request logs`
![](../images/request_logs.jpg)
1. Watch incoming requests :)
2 changes: 2 additions & 0 deletions docs/src/usage/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Usage

1. [First steps](first-steps.md)
1. [Proxy stubs](proxy-stubs.md)
1. [Request scripts](request-scripts.md)
1. [Response templating](response-templating.md)
17 changes: 17 additions & 0 deletions docs/src/usage/proxy-stubs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Proxy stubs

## Create a proxy http stub

1. Go to `HTTP Stubs` -> `Proxy stubs`
![](../images/proxy_stubs.jpg)
1. Click the `Add` button
1. Fill in the required fields
![](../images/proxy_stub_add.jpg)
1. Click the `Save` button

## Logs

1. Send a http-request to the created http-stub
1. Go to `HTTP Stubs` -> `Proxy logs`
![](../images/proxy_logs.jpg)
1. Watch incoming requests :)
4 changes: 2 additions & 2 deletions docs/src/usage/request-scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

## For using it
1. Create an http stub ([first steps](first-steps.html))
![](../images/05.jpg)
![](../images/request_stub_add.jpg)
1. In the "request script" field, add a Python script
![](../images/06.jpg)
![](../images/request_script.jpg)

## About scripts
Request scripts support a secure subset of Python version 3.8.
Expand Down
12 changes: 12 additions & 0 deletions docs/src/usage/response-templating.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Response templating

You can use the GET parameters of your request in the body and headers of the
response.

To do this, in the body field or in the value of any header, add a string with
parameters in the format `Your body with the GET parameter $arg1`

Now on the request for example `/stub/?arg1=42` there will be a response with
the body `Your body with GET parameter 42`


3 changes: 3 additions & 0 deletions http_stubs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@
Allows setting up custom urls returning predefined responses.
"""

# importing lookups for registration
from http_stubs.lookups import * # noqa: WPS347

default_app_config = 'http_stubs.apps.HttpStubsConfig'
Loading

0 comments on commit d3c97a0

Please sign in to comment.