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

Mijn 6927 api env agnostisch #82

Merged
merged 72 commits into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
22f926b
Change port
timvanoostrom Aug 25, 2022
a3233a9
Change port
timvanoostrom Aug 25, 2022
ed342d9
Config settings
timvanoostrom Aug 25, 2022
9d4303c
Add ssh
timvanoostrom Aug 25, 2022
00f910e
Rm
timvanoostrom Aug 25, 2022
faee873
Upodate sshd
timvanoostrom Aug 25, 2022
bb7546e
Test
timvanoostrom Aug 25, 2022
4288cc7
Use entrypoint
timvanoostrom Aug 25, 2022
e9d74d5
Copy uwsgi
timvanoostrom Aug 25, 2022
a3e3380
Change entry
timvanoostrom Aug 25, 2022
0d141d2
Try this
timvanoostrom Aug 25, 2022
077103e
Use SSH
timvanoostrom Aug 25, 2022
83c4e92
SSHD
timvanoostrom Aug 25, 2022
d50fb41
Move to folders
timvanoostrom Aug 26, 2022
4fb33db
Add GH workflow
timvanoostrom Aug 26, 2022
fadd7a8
Add variable
timvanoostrom Aug 26, 2022
f9b6e0f
Rm comment
timvanoostrom Aug 26, 2022
a4dc86f
Try extract var
timvanoostrom Aug 26, 2022
d105062
Change to multi stage build
timvanoostrom Aug 26, 2022
2fd55d2
Change stage names
timvanoostrom Aug 26, 2022
c947915
Fix splitting of BBZ
timvanoostrom Sep 9, 2022
5b5e4cc
Merge branch 'main' of github.com:Amsterdam/mijn-wpi into MIJN-4445-a…
timvanoostrom Oct 24, 2022
1a79ee6
Merge branch 'main' of github.com:Amsterdam/mijn-wpi into MIJN-4445-a…
timvanoostrom Jan 24, 2023
16d7b46
Add pipeline
timvanoostrom Jan 24, 2023
e9f3972
Pass dtap
timvanoostrom Jan 27, 2023
c5e140c
Add vars
timvanoostrom Jan 27, 2023
840d877
Test
timvanoostrom Jan 27, 2023
f07d337
Try port 80
timvanoostrom Jan 31, 2023
1a3e9e8
Fix
timvanoostrom Jan 31, 2023
cb8a6b8
Try this
timvanoostrom Feb 1, 2023
988206e
Restore port settings
timvanoostrom Feb 2, 2023
0bcf1b7
Simplify to 1 job
timvanoostrom Feb 2, 2023
d344b89
RM
timvanoostrom Feb 2, 2023
c797dbf
Change variable names
timvanoostrom Feb 2, 2023
443c662
Merge branch 'main' of github.com:Amsterdam/mijn-wpi into testen
timvanoostrom May 2, 2023
ea12d69
Update docker file
timvanoostrom May 2, 2023
224993f
Update pipeline file
timvanoostrom May 2, 2023
4837bca
Cleaning
timvanoostrom May 2, 2023
a734ba0
Use IS_TAP, clean obsolete code
timvanoostrom May 2, 2023
dc1f277
RM import
timvanoostrom May 2, 2023
7877cba
Add root route
timvanoostrom May 2, 2023
77ac8a0
Merge branch 'main' of github.com:Amsterdam/mijn-wpi into testen
timvanoostrom May 16, 2023
e154aa1
Change config
timvanoostrom May 25, 2023
46e95e0
Log original message on O+T
timvanoostrom May 30, 2023
0317e06
Add verify
timvanoostrom May 30, 2023
2f8d92d
Add nano, add debug
timvanoostrom Jun 1, 2023
9dd64af
Add param
timvanoostrom Jun 1, 2023
a6a5191
Merge branch 'main' of github.com:Amsterdam/mijn-wpi into testen
timvanoostrom Jun 20, 2023
251d32f
Update Dockerfile
timvanoostrom Jun 20, 2023
58bd704
Remove stage
timvanoostrom Jun 20, 2023
dce118a
Revert "Remove stage"
timvanoostrom Jun 20, 2023
44fec24
Merge branch 'main' of github.com:Amsterdam/mijn-wpi into testen
timvanoostrom Jul 6, 2023
14e1715
Add debug logging
timvanoostrom Jul 7, 2023
5657e1a
Change to log
timvanoostrom Jul 7, 2023
7e91619
Add some debug
timvanoostrom Jul 7, 2023
d9625f2
Merge branch 'main' of github.com:Amsterdam/mijn-wpi into testen
timvanoostrom Oct 30, 2023
4a9951f
MIJN-6926 Base64 encoded private key
timvanoostrom Oct 30, 2023
450b6d6
Add requirements management
timvanoostrom Oct 30, 2023
70029de
Add env agnostic changes
timvanoostrom Oct 30, 2023
afb0388
Replace workflows
timvanoostrom Oct 30, 2023
a38c7e1
Remove openapi validation
timvanoostrom Oct 30, 2023
cce72db
Lint
timvanoostrom Oct 30, 2023
297f81d
Update docker file
timvanoostrom Oct 30, 2023
6c5b2d4
Re-add copy line
timvanoostrom Oct 30, 2023
9b6d6b4
Add env param
timvanoostrom Oct 30, 2023
f19b8a2
Change id
timvanoostrom Oct 31, 2023
7420b28
Add acceptance
timvanoostrom Nov 10, 2023
f6a5403
Enable aquascan
timvanoostrom Nov 10, 2023
41cf673
Add test
timvanoostrom Nov 10, 2023
85bba2d
Add manual dtap
timvanoostrom Nov 10, 2023
efb415c
Merge branch 'main' of github.com:Amsterdam/mijn-wpi into MIJN-6927-a…
timvanoostrom Nov 10, 2023
c306758
Update requirements
timvanoostrom Nov 10, 2023
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
15 changes: 11 additions & 4 deletions app/server.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
import os
from urllib.error import HTTPError

import sentry_sdk
Expand Down Expand Up @@ -41,10 +42,16 @@
)


@application.route("/", methods=["GET"])
@application.route("/status/health", methods=["GET"])
def status_health():
return success_response_json("OK")
@application.route("/")
@application.route("/status/health")
def health_check():
return success_response_json(
{
"gitSha": os.getenv("MA_GIT_SHA", -1),
"buildId": os.getenv("MA_BUILD_ID", -1),
"otapEnv": os.getenv("MA_OTAP_ENV", None),
}
)


@application.route(f"{API_BASE_PATH}/uitkering-en-stadspas/aanvragen", methods=["GET"])
Expand Down
19 changes: 14 additions & 5 deletions app/test_server.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import datetime
import os
from unittest.mock import patch

from app.test_app import WpiApiTestApp
Expand All @@ -8,14 +9,22 @@
from app.utils import encrypt


@patch.dict(
os.environ,
{
"MA_BUILD_ID": "999",
"MA_GIT_SHA": "abcdefghijk",
"MA_OTAP_ENV": "unittesting",
},
)
class WPITestServer(WpiApiTestApp):
def test_status_health(self):
def test_status(self):
response = self.client.get("/status/health")
data = response.get_json()

self.assertEqual(response.status_code, 200)
self.assertEqual(data["status"], "OK")
self.assertEqual(data["content"], "OK")
self.assertEqual(
response.data.decode(),
'{"content":{"buildId":"999","gitSha":"abcdefghijk","otapEnv":"unittesting"},"status":"OK"}\n',
)

@patch("app.server.get_aanvragen")
def test_aanvragen(self, get_aanvragen_mock):
Expand Down
24 changes: 15 additions & 9 deletions azure-pipelines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ trigger:
batch: true
branches:
include:
- ontwikkelen
- testen
- az-acceptance
pr:
autoCancel: true
branches:
Expand Down Expand Up @@ -32,22 +32,28 @@ parameters:
default: none
values:
- none
- o
- t
# - a
# - p

- a
- p
- name: updateAppSettings
type: boolean
default: false

variables:
- ${{ if eq(variables['Build.SourceBranchName'], 'ontwikkelen') }}:
- name: dtapName
value: o
- ${{ if or(eq(variables['Build.SourceBranchName'], 'testen'), eq(variables['Build.Reason'], 'PullRequest')) }}:
- name: dtapName
value: t
- ${{ if eq(variables['Build.SourceBranchName'], 'az-acceptance') }}:
- name: dtapName
value: a
- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
- name: btdDeploy
value: false
- ${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
- name: btdDeploy
value: ${{ parameters.btdDeploy }}
- name: dtapName
value: t
- ${{ if ne(parameters.dtapName, 'none') }}:
- name: dtapName
value: ${{ parameters.dtapName }}
Expand All @@ -59,6 +65,6 @@ jobs:
dtapName: ${{ variables.dtapName }}
btdBuild: ${{ parameters.btdBuild }}
btdTest: ${{ parameters.btdTest }}
btdDeploy: ${{ parameters.btdDeploy }}
btdDeploy: ${{ variables.btdDeploy }}
updateAppSettings: ${{ parameters.updateAppSettings }}
aquaScan: ${{ eq(variables['Build.Reason'], 'PullRequest') }}
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
attrs==23.1.0
# via zeep
black==23.10.1
black==23.11.0
# via -r requirements-root.txt
blinker==1.7.0
# via
Expand Down