Uploaded image for project: 'IT: Release Engineering'
  1. IT: Release Engineering
  2. RELENG-2567

Global-jjb release-job.sh fails to detect files on non-ff git merge

Issue XMLXMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Normal Normal
    • Q4 2019 Tech Debt
    • None
    • Global JJB
    • None
    • ORAN

      The global-jjb shell script release-job.sh works on git fast-forward merges but fails on other merges.  The critical line that breaks is in the set_variables_common function:

      release_files=$(git diff-tree --no-commit-id -r "$GIT_COMMIT" --name-only -- "releases/" ".releases

      I think that line just needs to be extended with the "-m" flag per this documentation from git-diff-tree:

             -m
                 By default, git diff-tree --stdin does not show differences for merge commits. With
                 this flag, it shows differences to that commit from all of its parents. See also -c.
      

      Here's an example of a release job that chokes on a merge of a change that isn't just a fast forward:

      https://jenkins.o-ran-sc.org/job/portal-ric-dashboard-release-merge/1/console

      Here's an example of a release job that works fine on a merge that is a fast forward:

      https://jenkins.o-ran-sc.org/job/nonrtric-release-merge/2/console

      Another bad feature - the git parse command needs to detect that a release YAML file was *deleted*. Today it happily fires up and tries to verify the commands in a file that is being deleted, but in my opinion I think it should not.

              agardner Aric Gardner
              cl778h Chris Lott
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: