Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-58283

Add a new versioning file to set MONGO_VERSION and MONGO_GIT_HASH

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.2.16, 4.4.8, 5.0.2, 4.0.27, 5.1.0-rc0
    • Component/s: None
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Backport Requested:
      v5.0, v4.4, v4.2, v4.0
    • Sprint:
      Dev Platform 2021-07-12

      Description

      Write a new variables file called "etc/scons/developer_versioning.vars" that sets MONGO_VERSION using the latest git tag and MONGO_GIT_HASH with some string constant. It may look something like this:

      import os
      import subprocess
       
      def short_describe():
      import os
      import subprocess
      with open(os.devnull, "r+") as devnull:
      proc = subprocess.Popen("git describe --abbrev=0",
      stdout=subprocess.PIPE,
      stderr=devnull,
      stdin=devnull,
      shell=True)
      return proc.communicate()[0].decode('utf-8').strip()[1:]
       
      MONGO_GIT_HASH="unknown"
      MONGO_VERSION=short_describe()
      

        Attachments

          Activity

            People

            Assignee:
            acm Andrew Morrow
            Reporter:
            xuerui.fa Xuerui Fa
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: