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

Added an endpoint to get gocd server version details (#2202) #2239

Merged
merged 1 commit into from May 31, 2016

Conversation

Projects
None yet
4 participants
@GaneshSPatil
Copy link
Contributor

commented May 30, 2016

No description provided.

@@ -269,6 +269,7 @@
/api/feeds/**=ROLE_SUPERVISOR
/api/support=ROLE_SUPERVISOR
/api/pipelines.xml=ROLE_USER
/api/server_version=ROLE_USER

This comment has been minimized.

Copy link
@ketan

ketan May 30, 2016

Member

You probably mean to say IS_AUTHENTICATED_ANONYMOUSLY so that anonymous users can call this too?

This comment has been minimized.

Copy link
@ketan

ketan May 30, 2016

Member

Also how about simply calling this /api/version?

@@ -0,0 +1 @@
{}

This comment has been minimized.

Copy link
@ketan

ketan May 30, 2016

Member

You probably want to populate a default file with actual keys and values set to unknown or something similar.

@zabil zabil added the in progress label May 30, 2016

version_file = Rails.root.join('..', 'vm', 'admin', 'server_version.txt.vm')
file_content = '{"go_version":"16.6.0", "go_build_number":"235", "git_sha":"69ef4921709a84831913d9fa7e750fbf840f213c"}'
expected_json = { :_links => {
:self=>{:href=> 'http://test.host/api/server_version' },

This comment has been minimized.

Copy link
@ketan

ketan May 30, 2016

Member

Please indent this code properly. The consistent way to test this is like this

This comment has been minimized.

Copy link
@ketan

ketan May 30, 2016

Member

Sorry, I mean this

expect(actual_response).to eq(expected_response([john], ApiV1::UsersRepresenter))

property :version, getter: lambda { |options| go_version }
property :build_number, getter: lambda {| options| go_build_number }
property :git_sha, getter: lambda { |options| git_sha }
property :go_full_version, getter: lambda { |options| "#{go_version} (#{go_build_number}-#{git_sha})" }

This comment has been minimized.

Copy link
@ketan

ketan May 30, 2016

Member

simply full_version instead of go_full_version?

@GaneshSPatil GaneshSPatil changed the title Added an endpoint to get gocd server version details Added an endpoint to get gocd server version details (#2202) May 31, 2016

buildfile Outdated
@@ -74,6 +74,10 @@ define "cruise" do |project|
ENV["VERSION_NUMBER"] = VERSION_NUMBER
ENV["RELEASE_COMMIT"] = RELEASE_COMMIT

ENV["GO_VERSION"] = GO_VERSION
ENV["RELEASE_REVISION"] = "#{RELEASE_REVISION}"
ENV["GIT_SHA"] = GIT_SHA

This comment has been minimized.

Copy link
@zabil

zabil May 31, 2016

Contributor

We have a variable called RELEASE_VCS_REV what's the difference between that and GIT_SHA?

This comment has been minimized.

Copy link
@GaneshSPatil

GaneshSPatil May 31, 2016

Author Contributor

@zabil
can you tell me where we have used RELEASE_VCS_REV?

@@ -0,0 +1 @@
{"go_version":"16.6.0","go_build_number":"3341", "git_sha":"1236015adabbfdf88a786f9e0d66aabd071c1c12"}

This comment has been minimized.

Copy link
@zabil

zabil May 31, 2016

Contributor

This must be generated only while packaging.
Check-in this file with an empty json

This comment has been minimized.

Copy link
@ketan

ketan May 31, 2016

Member

We're adding a json with required fields, but values set to unknown, so the reader knows what fields are needed in the file.

@GaneshSPatil GaneshSPatil force-pushed the GaneshSPatil:gocd-server-version branch from 1c41044 to e96d66e May 31, 2016

@ketan ketan added this to the Release 16.6 milestone May 31, 2016

@ketan ketan merged commit e43774e into gocd:master May 31, 2016

@ketan ketan removed the in progress label May 31, 2016

@ketan

This comment has been minimized.

Copy link
Member

commented May 31, 2016

/cc @timoa

@timoa

This comment has been minimized.

Copy link

commented May 31, 2016

Thanks @ketan! Good news for the next releases to call this endpoint rather than the login page and search in the HTML the version label in the bottom ;)

@GaneshSPatil GaneshSPatil deleted the GaneshSPatil:gocd-server-version branch Jun 6, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.