File tree Expand file tree Collapse file tree 3 files changed +17
-11
lines changed Expand file tree Collapse file tree 3 files changed +17
-11
lines changed Original file line number Diff line number Diff line change 1
1
[tool .poetry ]
2
2
name = " jira-bugzilla-integration"
3
- version = " 0.1.0 "
3
+ version = " 2. 0.1"
4
4
description = " jira-bugzilla-integration"
5
5
authors = [" @mozilla/jbi-core" ]
6
6
license = " MPL"
Original file line number Diff line number Diff line change 8
8
import sentry_sdk
9
9
import uvicorn # type: ignore
10
10
from fastapi import FastAPI , Request
11
- from fastapi .responses import RedirectResponse
12
11
from fastapi .staticfiles import StaticFiles
13
12
from sentry_sdk .integrations .asgi import SentryAsgiMiddleware
14
13
24
23
app = FastAPI (
25
24
title = "Jira Bugzilla Integration (JBI)" ,
26
25
description = "JBI v2 Platform" ,
27
- version = "0.1.0 " ,
26
+ version = "2. 0.1" ,
28
27
)
29
28
30
29
app .include_router (monitor_router )
39
38
40
39
@app .get ("/" , include_in_schema = False )
41
40
def root (request : Request ):
42
- """GET via root redirects to /docs."""
43
- return RedirectResponse (url = "./docs" )
41
+ """Expose key configuration"""
42
+ return {
43
+ "title" : app .title ,
44
+ "description" : app .description ,
45
+ "version" : app .version ,
46
+ "documentation" : app .docs_url ,
47
+ "configuration" : {
48
+ "jira_base_url" : settings .jira_base_url ,
49
+ "bugzilla_base_url" : settings .bugzilla_base_url ,
50
+ },
51
+ }
44
52
45
53
46
54
@app .middleware ("http" )
Original file line number Diff line number Diff line change 9
9
10
10
11
11
def test_read_root (anon_client ):
12
- """The site root redirects to the Swagger docs """
12
+ """The root URL provides information """
13
13
resp = anon_client .get ("/" )
14
- assert resp .status_code == 200
15
- assert len (resp .history ) == 1
16
- prev_resp = resp .history [0 ]
17
- assert prev_resp .status_code == 307 # Temporary Redirect
18
- assert prev_resp .headers ["location" ] == "./docs"
14
+ infos = resp .json ()
15
+
16
+ assert "atlassian.net" in infos ["configuration" ]["jira_base_url" ]
19
17
20
18
21
19
def test_request_summary_is_logged (caplog ):
You can’t perform that action at this time.
0 commit comments