Uploaded image for project: 'Couchbase .NET client library'
  1. Couchbase .NET client library
  2. NCBC-334

Add a method of getting the version of the library programatically

    XMLWordPrintable

Details

    • Improvement
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 1.2.8
    • 1.3.1
    • library
    • None

    Description

      From some tools, it would usually be useful to get a version from the CouchbaseClient class. Ideally this would be derived from something like 'git describe' such that we could see if the code being used is not yet released and what it's lineage is.

      Attachments

        For Gerrit Dashboard: NCBC-334
        # Subject Branch Project Status CR V

        Activity

          jmorris Jeff Morris added a comment - - edited

          After some discussion, the solution needs the following steps:

          1-Git hook: writes the sha1, git-describe or other info describing the snapshot of source being built to a file (Version.txt) in the local directory - this hook is run on every pull, fetch, etc
          2-Version.txt: a file in the local directory that is:
          a) a Build Action of "Embedded resource"*,
          b) is added to git-ignore
          c) contains the version info from git described in #1
          3-Build event: will copy the text from the file into the appropriate assembly attributes:
          a) for version into the AssemblyVersionAttribute,
          b) for other info (git describe or sha1 into the AssemblyInformationalAttribute. I think we could do this via variable substitution.

          *May not have to be an embedded resource, maybe just a file on disk.

          jmorris Jeff Morris added a comment - - edited After some discussion, the solution needs the following steps: 1-Git hook: writes the sha1, git-describe or other info describing the snapshot of source being built to a file (Version.txt) in the local directory - this hook is run on every pull, fetch, etc 2-Version.txt: a file in the local directory that is: a) a Build Action of "Embedded resource"*, b) is added to git-ignore c) contains the version info from git described in #1 3-Build event: will copy the text from the file into the appropriate assembly attributes: a) for version into the AssemblyVersionAttribute, b) for other info (git describe or sha1 into the AssemblyInformationalAttribute. I think we could do this via variable substitution. *May not have to be an embedded resource, maybe just a file on disk.
          jmorris Jeff Morris added a comment - Prototype: https://github.com/jeffrymorris/githook-version-example
          jmorris Jeff Morris added a comment - - edited

          Committed a first generation implementation that adds a post-merge git hook that will run on a git-pull (iif their are remote changes). The hook will run a git-describe to get the state of the current repo and embed it within the AssemblyInformationVersion attribute in the AssemblyInfo.cs, which makes the info viewing through Windows explorer. It also adds a Version.txt file with the same information that is included as an embedded resource.

          A later revision will update the AssemblyVersion and AssemblyFileVersion attributes with a version based off the git-describe (details to come) and add the git log information to the Version.txt file as well as add a method to expose the information publicly.

          Note that the psake scripts will overwrite this information and will need to be updated so that the info exists for release builds as well as testing builds.

          http://review.couchbase.org/#/c/31597/

          jmorris Jeff Morris added a comment - - edited Committed a first generation implementation that adds a post-merge git hook that will run on a git-pull (iif their are remote changes). The hook will run a git-describe to get the state of the current repo and embed it within the AssemblyInformationVersion attribute in the AssemblyInfo.cs, which makes the info viewing through Windows explorer. It also adds a Version.txt file with the same information that is included as an embedded resource. A later revision will update the AssemblyVersion and AssemblyFileVersion attributes with a version based off the git-describe (details to come) and add the git log information to the Version.txt file as well as add a method to expose the information publicly. Note that the psake scripts will overwrite this information and will need to be updated so that the info exists for release builds as well as testing builds. http://review.couchbase.org/#/c/31597/

          People

            jmorris Jeff Morris
            ingenthr Matt Ingenthron
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              PagerDuty