Uploaded image for project: 'VOLTHA'
  1. VOLTHA
  2. VOL-4770

Gerrit/git commit hook: Detect and fail merge requests when VERSION file not updated

    XMLWordPrintable

    Details

    • Type: Task
    • Status: To Do (View Workflow)
    • Priority: Medium
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: ci-system
    • Labels:
    • Story Points:
      0

      Description

      The community has reported an interest in having merge requests rejected when the VERSION file has not been updated.

       

      General version checking logic:

      • Use a regex for general version string validation.
      • Split string on dot to obtain fields (list = {major, minor, ...}
      • Sub-split fields
        • hyphen to separate modifiers
        • string/int boundries:  dev1 => ['dev', '1']
      • Individual fields can be examined to compare -dev1, -dev2, -dev3, etc.
      • Loop over field data and compare.

       

      Basic error detection:

      • Merge request into the master branch:
        • Version string cannot contain "-dev"
        • Version string must increment a single field +1:
          • master contains v1.1.4
          • VERSION file can contain:
            • 1.1.5
            • 1.2.0
            • 2.0[.0]
      • The community also requested requiring a version string bump for each code change on (branch != master):
        • 1.1-dev1 => 1.1-dev2 => 1.1-dev3
        • Fail when VERSION string:
          • version_string != 1 + last_version
      • Suggestions made based on development workflow, checking non-master merges could be problematic::
        • Behavior would require modifying file VERSION with every submit.
        • We may be able to validate major.minor strings but modifiers like -devXX would be problematic:
          • Potential problem - requiring a version bump for – devXX branches would serialize merging and often force an extraneous VERSION file edit to accommodate the latest -dev modifier value.

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            joey Joey Armstrong
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes