FEATURE: display commit hash for each plugin on /admin/plugins page. (#22176)

It will help to find out the current version of the plugins even without the `docker_manager` plugin.
This commit is contained in:
Vinoth Kannan
2023-06-26 10:09:57 +05:30
committed by GitHub
parent a183f14d09
commit 52894b9d7c
11 changed files with 125 additions and 2 deletions

View File

@ -516,6 +516,19 @@ class Plugin::Instance
initializers << block
end
def commit_hash
git_repo.latest_local_commit
end
def commit_url
return if commit_hash.blank?
"#{git_repo.url}/commit/#{commit_hash}"
end
def git_repo
@git_repo ||= GitRepo.new(directory, name)
end
def before_auth(&block)
if @before_auth_complete
raise "Auth providers must be registered before omniauth middleware. after_initialize is too late!"