-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
feat: Add endpoint for server version #6524
Changes from 1 commit
b4836de
e69c599
cf742bd
44247d3
04059bd
2389f3c
ed0ceea
64f7891
ec039f8
dfc56db
63a4f89
3dee4df
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -134,7 +134,7 @@ def create_app(): | |
|
||
# development api | ||
with app.app_context(): | ||
from app.api.server_version import server_version_route | ||
from app.api.server_version import info_route | ||
from app.api.admin_statistics_api.events import event_statistics | ||
from app.api.auth import auth_routes | ||
from app.api.attendees import attendee_misc_routes | ||
|
@@ -159,7 +159,7 @@ def create_app(): | |
app.register_blueprint(import_routes) | ||
app.register_blueprint(celery_routes) | ||
app.register_blueprint(auth_routes) | ||
app.register_blueprint(server_version_route) | ||
app.register_blueprint(info_route) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Still at the wrong place There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have moved the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. info_route had no original place as it's a new route and should be placed in the end |
||
app.register_blueprint(event_statistics) | ||
app.register_blueprint(user_misc_routes) | ||
app.register_blueprint(attendee_misc_routes) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
from flask import jsonify, Blueprint | ||
from datetime import datetime | ||
iamareebjamal marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
SERVER_VERSION = '2.2.3-SNAPSHOT' | ||
iamareebjamal marked this conversation as resolved.
Show resolved
Hide resolved
iamareebjamal marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
SERVER_VERSION = '1.0' | ||
|
||
server_version_route = Blueprint('server_version', __name__, url_prefix='/v1') | ||
info_route = Blueprint('info', __name__, url_prefix='/v1') | ||
_build = {'time': str(datetime.now()), 'version': SERVER_VERSION} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. time should be the time of release There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since it'll be a little bit complex for you, ignore the time field There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @iamareebjamal sure no issues. Although if you give me some hint about the vx pipeline I can try to figure out something. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. vx pipeline? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Simplest solution is to invoke git to find last commit time There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But we need to finalize the release today, so let it be and do it in a future release
iamareebjamal marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
||
class ServerVersion: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. expected 2 blank lines, found 1
iamareebjamal marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
@staticmethod | ||
@server_version_route.route('/server_version') | ||
@info_route.route('/info') | ||
def version(): | ||
return jsonify(server_version=SERVER_VERSION) | ||
return jsonify(build=_build) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move to last