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

[#21] show version in admin #412

Merged
merged 5 commits into from
Jul 22, 2024
Merged

Conversation

SonnyBA
Copy link
Contributor

@SonnyBA SonnyBA commented Jun 5, 2024

Fixes maykinmedia/open-api-framework#21

Changes

Shows the current version of the application in the admin:

image

@SonnyBA SonnyBA self-assigned this Jun 5, 2024
Copy link
Collaborator

@annashamray annashamray left a 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

@SonnyBA SonnyBA force-pushed the feature/#21-show-version-admin branch from 1c6189e to db3fd29 Compare June 20, 2024 13:15
Comment on lines 375 to 389
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)
Copy link
Contributor

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-commenter
Copy link

Codecov Report

Attention: Patch coverage is 71.42857% with 4 lines in your changes missing coverage. Please review.

Project coverage is 95.08%. Comparing base (e97300f) to head (d732cdc).
Report is 62 commits behind head on master.

Files Patch % Lines
src/objects/conf/base.py 69.23% 4 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@stevenbal stevenbal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SonnyBA can you rebase on master? The RELEASE is now determined in base.py of OAF #413

@SonnyBA SonnyBA force-pushed the feature/#21-show-version-admin branch from 6b85aea to 1c14814 Compare July 16, 2024 09:51
@SonnyBA SonnyBA requested a review from stevenbal July 16, 2024 10:05
@stevenbal stevenbal merged commit a5a0a50 into master Jul 22, 2024
17 checks passed
@stevenbal stevenbal deleted the feature/#21-show-version-admin branch July 22, 2024 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show version of the release in the admin
4 participants