Skip to content

Commit 2264d34

Browse files
andrew-susantoluthfifahleviMuhammad Fahleviluckysusantoferdifdi
authored
feat: Release 6 - 12 December 2022 (#113)
* 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 <muhammad.fahlevi@gdn-commerce.com> * 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 <77453015+luthfifahlevi@users.noreply.github.com> Co-authored-by: Muhammad Fahlevi <muhammad.fahlevi@gdn-commerce.com> Co-authored-by: Lucky Susanto <78904597+Exqrch@users.noreply.github.com> Co-authored-by: Ferdi Fadillah <46517394+ferdifdi@users.noreply.github.com>
1 parent da9c11f commit 2264d34

43 files changed

Lines changed: 1375 additions & 255 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,3 +130,6 @@ dmypy.json
130130

131131
# Pyre type checker
132132
.pyre/
133+
134+
# Upload folder
135+
uploads/**

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,20 @@ This repository is providing backend service for MonAPI, written in Python and u
3636
- [x] API Test
3737
- [x] Multi-Step API Monitor
3838
- [x] Team Management
39-
- [ ] Integrated Status Page
39+
- [x] Integrated Status Page
4040

4141
## Related Documentation
4242

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

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

5154

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

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

62+
📝 [User Manual - https://docs.monapi.xyz](https://docs.monapi.xyz)
63+
5964
## Our Teams
6065
- Lucky Susanto
6166
- Ferdi Fadillah
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Generated by Django 4.1.2 on 2022-11-29 02:00
2+
3+
from django.db import migrations, models
4+
import django.db.models.deletion
5+
6+
7+
class Migration(migrations.Migration):
8+
9+
dependencies = [
10+
('statuspage', '0001_initial'),
11+
('apimonitor', '0016_merge_20221116_1054'),
12+
]
13+
14+
operations = [
15+
migrations.AddField(
16+
model_name='apimonitor',
17+
name='status_page_category',
18+
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='statuspage.statuspagecategory'),
19+
),
20+
]
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Generated by Django 4.1.2 on 2022-12-09 04:44
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('apimonitor', '0017_apimonitor_status_page_category'),
10+
]
11+
12+
operations = [
13+
migrations.AlterField(
14+
model_name='apimonitor',
15+
name='assertion_type',
16+
field=models.CharField(choices=[('DISABLED', 'Disabled'), ('TEXT', 'Text'), ('JSON', 'JSON'), ('PARTIAL', 'Partial')], default='DISABLED', max_length=16),
17+
),
18+
]

apimonitor/models.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from django.contrib.auth.models import User
44
from django.core.validators import MinValueValidator, MaxValueValidator
55
from login.models import Team
6+
from statuspage.models import StatusPageCategory
67

78
class APIMonitor(models.Model):
89
method_choices = [
@@ -34,6 +35,7 @@ class APIMonitor(models.Model):
3435
('DISABLED', 'Disabled'),
3536
('TEXT', 'Text'),
3637
('JSON', 'JSON'),
38+
('PARTIAL', 'Partial'),
3739
]
3840

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

5154

5255
class APIMonitorQueryParam(models.Model):

apimonitor/serializers.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from apimonitor.models import APIMonitor, APIMonitorQueryParam, APIMonitorHeader, APIMonitorRawBody, \
44
APIMonitorResult, AssertionExcludeKey
5+
from statuspage.serializers import StatusPageCategorySerializers
56

67
class APIMonitorQueryParamSerializer(serializers.ModelSerializer):
78
class Meta:
@@ -76,6 +77,7 @@ class APIMonitorSerializer(serializers.ModelSerializer):
7677
body_form = APIMonitorBodyFormSerializer(many=True, required=False, allow_null=True)
7778
raw_body = APIMonitorRawBodySerializer(required=False, allow_null=True)
7879
previous_step_id = serializers.PrimaryKeyRelatedField(read_only=True, many=False)
80+
status_page_category_id = serializers.PrimaryKeyRelatedField(read_only=True, many=False)
7981
exclude_keys = AssertionExcludeKeySerializer(many=True, required=False, allow_null=True)
8082

8183
class Meta:
@@ -96,6 +98,7 @@ class Meta:
9698
'assertion_value',
9799
'is_assert_json_schema_only',
98100
'exclude_keys',
101+
'status_page_category_id',
99102
]
100103

101104

@@ -147,6 +150,7 @@ class APIMonitorDashboardSerializer(serializers.Serializer):
147150
class APIMonitorRetrieveSerializer(APIMonitorSerializer):
148151
success_rate = APIMonitorDetailSuccessRateSerializer(many=True)
149152
response_time = APIMonitorDetailResponseTimeSerializer(many=True)
153+
status_page_category = StatusPageCategorySerializers()
150154

151155
class Meta:
152156
model = APIMonitor
@@ -168,4 +172,6 @@ class Meta:
168172
'assertion_value',
169173
'is_assert_json_schema_only',
170174
'exclude_keys',
175+
'status_page_category_id',
176+
'status_page_category',
171177
]

0 commit comments

Comments
 (0)