Skip to content

Commit

Permalink
feat: Release 6 - 12 December 2022 (#113)
Browse files Browse the repository at this point in the history
* feat: PBI 32 status page configuration (#100)

* [RED] add tests for status page configuration

* [GREEN] add implementation status page configuration

* [REFACTOR] add unique constraint on path

* [REFACTOR] remove unused test method

* feat: PBI-33-status page dashboard-Backend (#106)

* [RED] create tests for status page dashboard

* [RED] update tests for status page dashboard

* [GREEN] create implementation for status page dashboard

* [REFACTOR] remove code smells

* [REFACTOR] remove unnecessary filter

Co-authored-by: Muhammad Fahlevi <[email protected]>

* feat: Pbi 35 validation on register (#107)

* [RED] When registering, user should not be verified yet

* [GREEN] When register, user are not verified

* [RED] Only verified user can login

* [GREEN] User cannot login if they are not yet verified

* [RED] Valid Token should verify a user while invalid ones should do nothing

* [GREEN] Valid Token should verify a user while invalid ones should do nothing

* [REFACTOR] Migrations file

* [REFACTOR] Email no longer says the limit is 1 week for user verification

* [FIX] Fix security issue: Now token is deleted after it is consumed

* [ADD] Add legacy support

* [REFACTOR] Add test for missing line

* feat: Pbi 34 add partial assertion text backend (#108)

* [RED] test partial text assertion

* [GREEN] implement partial text assertion

* [FIX] code smell

* refactor: change request process method to allow form (#109)

* refactor: add admin for models verified user and forget password token (#110)

* fix: fix status page config models unique blank (#111)

* refactor: update team name register (#112)

* chores: add release notes

Co-authored-by: luthfifahlevi <[email protected]>
Co-authored-by: Muhammad Fahlevi <[email protected]>
Co-authored-by: Lucky Susanto <[email protected]>
Co-authored-by: Ferdi Fadillah <[email protected]>
  • Loading branch information
5 people authored Dec 12, 2022
1 parent da9c11f commit 2264d34
Show file tree
Hide file tree
Showing 43 changed files with 1,375 additions and 255 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,6 @@ dmypy.json

# Pyre type checker
.pyre/

# Upload folder
uploads/**
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,20 @@ This repository is providing backend service for MonAPI, written in Python and u
- [x] API Test
- [x] Multi-Step API Monitor
- [x] Team Management
- [ ] Integrated Status Page
- [x] Integrated Status Page

## Related Documentation

- [Run Development Server](https://github.com/MonAPI-xyz/MonAPI/blob/staging/docs/development.md)

## Latest Release Notes
Version: v0.5.0<br>
Date: 28th November 2022
1. Team Management
2. Alerts User-Defined Timezone
Version: v1.0.0<br>
Date: 12th December 2022
1. Status Page Integration
2. Email register verification
3. Create new category directly when create API Monitor
4. Partial Assertions Text
5. Release 1st version of MonAPI


Full release notes can be found in [Release Notes](https://github.com/MonAPI-xyz/MonAPI/blob/staging/docs/release_notes.md)
Expand All @@ -56,6 +59,8 @@ Full release notes can be found in [Release Notes](https://github.com/MonAPI-xyz

📝 [Blog Site - https://blog.monapi.xyz](https://blog.monapi.xyz)

📝 [User Manual - https://docs.monapi.xyz](https://docs.monapi.xyz)

## Our Teams
- Lucky Susanto
- Ferdi Fadillah
Expand Down
20 changes: 20 additions & 0 deletions apimonitor/migrations/0017_apimonitor_status_page_category.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 4.1.2 on 2022-11-29 02:00

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('statuspage', '0001_initial'),
('apimonitor', '0016_merge_20221116_1054'),
]

operations = [
migrations.AddField(
model_name='apimonitor',
name='status_page_category',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='statuspage.statuspagecategory'),
),
]
18 changes: 18 additions & 0 deletions apimonitor/migrations/0018_alter_apimonitor_assertion_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.1.2 on 2022-12-09 04:44

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('apimonitor', '0017_apimonitor_status_page_category'),
]

operations = [
migrations.AlterField(
model_name='apimonitor',
name='assertion_type',
field=models.CharField(choices=[('DISABLED', 'Disabled'), ('TEXT', 'Text'), ('JSON', 'JSON'), ('PARTIAL', 'Partial')], default='DISABLED', max_length=16),
),
]
3 changes: 3 additions & 0 deletions apimonitor/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from django.contrib.auth.models import User
from django.core.validators import MinValueValidator, MaxValueValidator
from login.models import Team
from statuspage.models import StatusPageCategory

class APIMonitor(models.Model):
method_choices = [
Expand Down Expand Up @@ -34,6 +35,7 @@ class APIMonitor(models.Model):
('DISABLED', 'Disabled'),
('TEXT', 'Text'),
('JSON', 'JSON'),
('PARTIAL', 'Partial'),
]

team = models.ForeignKey(Team, on_delete=models.CASCADE)
Expand All @@ -47,6 +49,7 @@ class APIMonitor(models.Model):
assertion_value = models.TextField(blank=True)
is_assert_json_schema_only = models.BooleanField(default=False)
last_notified = models.DateTimeField(null=True, blank=True)
status_page_category = models.ForeignKey(StatusPageCategory, null=True, blank=True, on_delete=models.SET_NULL)


class APIMonitorQueryParam(models.Model):
Expand Down
6 changes: 6 additions & 0 deletions apimonitor/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from apimonitor.models import APIMonitor, APIMonitorQueryParam, APIMonitorHeader, APIMonitorRawBody, \
APIMonitorResult, AssertionExcludeKey
from statuspage.serializers import StatusPageCategorySerializers

class APIMonitorQueryParamSerializer(serializers.ModelSerializer):
class Meta:
Expand Down Expand Up @@ -76,6 +77,7 @@ class APIMonitorSerializer(serializers.ModelSerializer):
body_form = APIMonitorBodyFormSerializer(many=True, required=False, allow_null=True)
raw_body = APIMonitorRawBodySerializer(required=False, allow_null=True)
previous_step_id = serializers.PrimaryKeyRelatedField(read_only=True, many=False)
status_page_category_id = serializers.PrimaryKeyRelatedField(read_only=True, many=False)
exclude_keys = AssertionExcludeKeySerializer(many=True, required=False, allow_null=True)

class Meta:
Expand All @@ -96,6 +98,7 @@ class Meta:
'assertion_value',
'is_assert_json_schema_only',
'exclude_keys',
'status_page_category_id',
]


Expand Down Expand Up @@ -147,6 +150,7 @@ class APIMonitorDashboardSerializer(serializers.Serializer):
class APIMonitorRetrieveSerializer(APIMonitorSerializer):
success_rate = APIMonitorDetailSuccessRateSerializer(many=True)
response_time = APIMonitorDetailResponseTimeSerializer(many=True)
status_page_category = StatusPageCategorySerializers()

class Meta:
model = APIMonitor
Expand All @@ -168,4 +172,6 @@ class Meta:
'assertion_value',
'is_assert_json_schema_only',
'exclude_keys',
'status_page_category_id',
'status_page_category',
]
Loading

0 comments on commit 2264d34

Please sign in to comment.