Skip to content

Teach scripts about git version #393

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

Merged
merged 4 commits into from
May 26, 2017
Merged

Conversation

zbeekman
Copy link
Collaborator

@zbeekman zbeekman commented May 25, 2017

Avg response time coverage on master
Issue Stats Codecov branch

Summary of changes

More clever version information in install.sh --version, extracted by CMake and in caf --version and cafrun --version

Rationale for changes

The "odd patch level version number between releases" was getting a bit annoying, and I wanted an easier way to tell which commit a users code is based on. Now it should be possible, under most circumstances to easily get this information.

One exception is when someone does a shallow clone... since git describe won't be able to track back to a tag, but this is fine, since it should still have the commit hash... so where we need something that looks like x.y.z (e.g., CMake project version) we fall back on the embedded version in .VERSION

If the user is using an official release tarball then .gitattributes to embed additional information in .VERSION file including:

  • ref-names (this is the magic sauce to get the tag info)
  • Git commit that the generated archive was based on
    • Full hash
    • Committer name
    • Committer date
    • Commit signer and pubkey
    • Signature status and output of gpg verify

So just make sure to git checkout <tag> before git archive --prefix=OpenCoarrays-$(git describe)/ -o OpenCoarrays-$(git describe).tar.gz <tag> to have the cleanest info in .VERSION. (It will still work if you don't checkout the tag first, you'll just add info about where your current HEAD is at...)

Additional info and certifications

This pull request (PR) is a:

  • Bug fix
  • Feature addition
  • Other, Please describe:

I certify that:

  • I have reviewed the contributing guidelines
  • If this PR is a work in progress I have added WIP: to the
    beginning of the PR title
  • If this PR is problematic for any reason, I have added
    DO NOT MERGE: to the beginning of the title
  • The branch name and title of this PR contains the text
    issue-<#> where <#> is replaced by the issue that this PR
    is addressing
  • I have deleted trailing white space on any lines that this PR
    touches
  • I have used spaces for indentation on any lines that this PR
    touches
  • I have included some comments to explain non-obvious code
    changes
  • I have run the tests localy (ctest) and all tests pass
  • Each commit is a logically atomic, self-consistent, cohesive
    set of changes
  • The commit message should follow these guidelines:
    • First line is directive phrase, starting with a capitalized
      imperative verb, and is no longer than 50 characters
      summarizing your commit
    • Next line, if necessary is blank
    • Following lines are all wrapped at 72 characters and can
      include additional paragraphs, bulleted lists, etc.
    • Use Github keywords where appropriate, to indicate the
      commit resolves an open issue.
  • I have signed Contributor License Agreement (CLA) by
    clicking the "details" link to the right of the licence/cla
    check and following the directions on the CLA assistant webpage
  • I have ensured that the test coverage hasn't gone down and added new unit tests to cover an new code added to the library

For contributors and SI team members with code review priviledges

zbeekman added 2 commits May 25, 2017 16:19
 - Insert various info into .VERSION file when
   `git archive` is performed.
   - Latest tag
   - Commit that archive/tag is based on
   - Author, date, signature info for that commit
 - Teach top level CMakeLists.txt how to:
   - Deal with the `git archive` modified version
     of .VERSION
   - Check if src dir is a git repo
   - Extract version info from `git describe`
   - Fall back on manually entered version string
     in .VERSION when it can't be extracted from
     git
 - Embed detailed version info in caf and cafrun
   that was extracted by git
 - Ensure install.sh and other build scripts will
   fetch the `git archive` created version info,
   or fall back onto manually entered version in .VERSION
 - Print full `git describe` when building with CMake
 - Fall back on project version if can't `git describe`
@codecov
Copy link

codecov bot commented May 25, 2017

Codecov Report

Merging #393 into master will decrease coverage by 4.11%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master     #393      +/-   ##
==========================================
- Coverage   41.19%   37.07%   -4.12%     
==========================================
  Files           3        3              
  Lines        1277     1950     +673     
  Branches      227      320      +93     
==========================================
+ Hits          526      723     +197     
- Misses        665     1119     +454     
- Partials       86      108      +22

 - Travis-CI seems to always error out when running the failed images
   tests. So only run it in the allowed failures tests
@zbeekman
Copy link
Collaborator Author

zbeekman commented May 26, 2017

I'm going to merge this early because I have tested extensively locally, and would like to get this into the pending release, after going over the CI tests with a fine-toothed comb.

LGTM

Approved with PullApprove Approved with PullApprove

@zbeekman zbeekman merged commit 02a7997 into master May 26, 2017
@zbeekman zbeekman deleted the teach-scripts-about-git-version branch May 26, 2017 00:19
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.

1 participant