-
Notifications
You must be signed in to change notification settings - Fork 10
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
[#21] show version in admin #412
Conversation
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.
Looks good, but I agree with Steven (in other PR), that it would be nice to have it in open-api-framework
1c6189e
to
db3fd29
Compare
src/objects/conf/base.py
Outdated
if "GIT_SHA" in os.environ: | ||
GIT_SHA = config("GIT_SHA", "") | ||
# in docker (build) context, there is no .git directory | ||
elif os.path.exists(os.path.join(BASE_DIR, ".git")): | ||
try: | ||
import git | ||
except ImportError: | ||
GIT_SHA = None | ||
else: | ||
repo = git.Repo(search_parent_directories=True) | ||
GIT_SHA = repo.head.object.hexsha | ||
else: | ||
GIT_SHA = None | ||
|
||
RELEASE = config("RELEASE", GIT_SHA) |
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.
This will be part of the OAf base settings in the future: #413
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #412 +/- ##
==========================================
+ Coverage 94.84% 95.08% +0.23%
==========================================
Files 135 151 +16
Lines 4657 5225 +568
==========================================
+ Hits 4417 4968 +551
- Misses 240 257 +17 ☔ View full report in Codecov by Sentry. |
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.
6b85aea
to
1c14814
Compare
Fixes maykinmedia/open-api-framework#21
Changes
Shows the current version of the application in the admin: