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

Show version #1021

Closed
wants to merge 4 commits into from
Closed

Show version #1021

wants to merge 4 commits into from

Conversation

bingxie
Copy link
Contributor

@bingxie bingxie commented Jun 1, 2016

Display the version on two places.
snip20160601_1
snip20160601_2

module GitRepo
def self.last_tag
begin
IO.popen("git describe --tags --abbrev=0 "){ |v| v.readline.strip }
Copy link
Member

Choose a reason for hiding this comment

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

I think the --abbrev=0 could be omitted so that people know if they are running the latest code of a branch instead of a release. But it's okay as is. Definitely an improvement.

@mkllnk
Copy link
Member

mkllnk commented Jun 15, 2016

I think this pr can go ahead.

@oeoeaio
Copy link
Contributor

oeoeaio commented Jun 15, 2016

Hey @mkllnk and @bingxie, Rohan and I are just looking at this, and we've noticed a bit of an issue. The logic here depends on the existence of a tag for the version number, which is very dependent on the particular workflow being used, and also on the way that tags are used.

For example, the last tag on our production server in Aus will always be the previous version, rather than the current one, because the current release is generally only created in GitHub after we have pushed to production (which is when tags on the server will be updated). This means that this logic will work quite well on Aus production for intermediate pushes to prod, but not at all for actual releases.

The second consideration is that it restricts the use of tags to releases only - not sure how big an issue this is, but probably not a good idea to assume this will always be the case.

We thought it might be better to use the GitHub API to determine whether the current server commit is a release commit, and if so, to use that version number. This request could be cached, and only invalidated on server initialisation.

Where the server commit does not match a release commit, we can just display the SHA - this will probably only ever happen on Australian production...

How does that sound?

@mkllnk
Copy link
Member

mkllnk commented Jun 15, 2016

That's a good point. But since we deploy quite regularly, it's not a big deal.

If we wanted to use Github integration, it could be better to listen to release events and act on that. For example do a git fetch and reload the version number. We could use that infrastructure later to inform admins about new releases as well.

@bingxie
Copy link
Contributor Author

bingxie commented Jun 21, 2016

Using the github releases API is a very good idea. I went through the API doc, I can only find get a release by tag name API. It still rely on the tag name. I am not sure how can we match a release with server commit.

@mkllnk
Copy link
Member

mkllnk commented Jun 21, 2016

Github always uses a tag for a release. You can't have a release without tag. That's why I think that git describe is a really good solution. The question is just: When do we update our local data about the release?

Even if we use the Github API and retrieve the information on deploy of our production server, we have the same problem that the release doesn't exist yet. We will have an outdated version number on our production server.

@bingxie
Copy link
Contributor Author

bingxie commented Jul 7, 2016

@oeoeaio How should we make decision on this issue?

@oeoeaio
Copy link
Contributor

oeoeaio commented Jul 8, 2016

@bingxie @mkllnk @RohanM

I really like the idea of using GitHub's webhooks to listen for release events and to then update the version number accordingly. How does everyone else feel about that?

@bingxie
Copy link
Contributor Author

bingxie commented Jul 8, 2016

👍 , so we can use webhooks to get the newest version for our australian production server. But for others who deployed a older version, does it still rely on the git tag?

@mkllnk
Copy link
Member

mkllnk commented Jul 8, 2016

That's a good idea. So we extend this pull request so that we update the tag information based on a webhook call. That's cool.

@daniellemoorhead daniellemoorhead added this to the v1.8.3 - Tres puntos milestone Jul 15, 2016
@daniellemoorhead daniellemoorhead modified the milestones: v1.9 - Enigmatic Edamame!, v1.8.3 - Tres puntos, v1.10 - Funky Feijoa! Jul 15, 2016
@daniellemoorhead
Copy link
Contributor

---Doing a PR Cleanup---

@oeoeaio @mkllnk do you think this is worth keeping and building on this or should the PR be closed?

@mkllnk
Copy link
Member

mkllnk commented Apr 21, 2017

It would be good to do this. Seems really useful.

@daniellemoorhead daniellemoorhead modified the milestones: June dot point release, v1.10 - Funky Feijoa! Jun 2, 2017
@daniellemoorhead daniellemoorhead added this to the Aus Current milestone Jun 30, 2017
@daniellemoorhead
Copy link
Contributor

Closing this, comment added to #577 issue that can be picked up and implemented via a new PR.

@daniellemoorhead daniellemoorhead removed this from the Aus Current milestone Sep 15, 2017
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.

None yet

8 participants