-
Notifications
You must be signed in to change notification settings - Fork 4
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
Fix swagger docs at non-root paths #408 #409
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #409 +/- ##
==========================================
- Coverage 96.84% 96.80% -0.05%
==========================================
Files 40 40
Lines 3363 3375 +12
Branches 316 317 +1
==========================================
+ Hits 3257 3267 +10
- Misses 78 80 +2
Partials 28 28
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
Sorry, I am late seeing this PR but I just noticed that it is introducing a new config value. From a versioning perspective, I think that this should be a breaking change (major version bump) rather than a fix (patch version bump). (venv) [datagateway-api]$ semantic-release version
Creating new version
Current version: 7.1.0, Current release version: 7.1.0
Bumping with a patch version to 7.1.1 |
@VKTB ah yes, I missed that (it looks like the Semantic Release workflow thing doesn't run any more either). I think rewording |
@MRichards99 Yes that should do the job. While at it, could you also please merge
From its repo README, it Looks like it is no longer maintained and there was a security incident. It does mention some alternatives but we need to make sure that they are secure before we use them. |
2a4cb9c
to
d88d295
Compare
@VKTB It looks like https://github.com/Ezard/semantic-prs would a good alternative |
All good now, thanks for sorting this out @MRichards99! (venv) [datagateway-api]$ semantic-release print-version
8.0.0 |
Dear all, many thanks for working on this! I tried it out, it clearly shows progress, but we are not there, I'm afraid. Test setupI deployed
<VirtualHost _default_:443>
ServerName data.example.org:443
WSGIDaemonProcess datagateway \
display-name=%{GROUP} user=wwwrun group=www threads=3
WSGIScriptAlias /api /usr/lib/python3.6/site-packages/datagateway_api/wsgi.py \
process-group=datapub application-group=%{GLOBAL}
</VirtualHost>
datagateway_api:
extension: "/datagateway"
# ...
search_api:
extension: "/panosc"
# ...
url_prefix: "/api" ObservationsAs expected, I could reach the Swagger UI for the datagateway and for search API at But the endpoints in the swagger UI were listed as:
and the calls after hitting |
@RKrahl sorry about that - I overlooked that the URLs in the swagger UI were wrong. I've fixed it so it now displays the correct URLs - respecting the |
Great! I'll have a look. |
Tested, works, looks good! |
This PR will close #408
Description
Add a url_prefix config item which tells the app where it's expected to be mounted. I've added some code to take url_prefix into consideration in development, but otherwise we'd be expecting this to be done via a WSGI server e.g. Apache mod_wsgi
This then fixes the swagger UI as the UI files & openapi.json have the correct URLs. Every other URL in the app already worked fine with aliases as they're handled as part of WSGI spec
Testing Instructions
Add a set up instructions describing how the reviewer should test the code
icatdb Generator Script Consistency Test
CI job fails, is this because of a deliberate change made to the script to change generated data (which isn't actually a problem) or is here an underlying issue with the changes made?fix:
,feat:
orBREAKING CHANGE:
so a release is automatically made via GitHub Actions upon merge?url_prefix
option and set one of dg-api or search-api's aliases to "/" - test that the swagger UI is visible for both APIsAgile Board Tracking
Closes #408