#5 Bump without modified
Opened 4 years ago by sgallagh. Modified 4 years ago
sgallagh/fedora-module-defaults-ci libgit-change  into  master

file modified
+1
@@ -2,6 +2,7 @@ 

      parameters {

          string(defaultValue: "", description: "", name: "REPO")

          string(defaultValue: "", description: "", name: "BRANCH")

+         string(defaultValue: "", description: "", name: "BRANCH_TO")

      }

  

      agent { node { label 'fedora29' } }

file modified
+1 -1
@@ -2,7 +2,7 @@ 

  version: 1

  data:

    module: libgit2

-   stream: 0.27

+   stream: 0.28

    profiles:

      0.26: []

      0.27: []

file modified
+14 -5
@@ -1,13 +1,14 @@ 

  #!/bin/bash

  

  set -e

+ set -x

  

  if [ -n "$REPO" -a -n "$BRANCH" ]; then

      git config user.email "noreply@ci.centos.org"

      git config user.name "CentOS CI"

  

      # Save the commit ID of the baseline checkout

-     MODULE_DEFAULTS_TEST_BASELINE=$(git log -1 --pretty=%H)

+     MODULE_DEFAULTS_TEST_BASELINE=$(git log -1 --pretty=%H origin/$BRANCH_TO)

      export MODULE_DEFAULTS_TEST_BASELINE

  

      # Merge the PR into the current tree
@@ -15,14 +16,22 @@ 

      git gc --auto

      git remote add proposed "$REPO"

      git fetch proposed

-     git checkout origin/master

-     git merge --no-ff "proposed/$BRANCH" -m "Merge PR"

+ 

+     MODULE_DEFAULTS_TEST_UPDATED=$(git log -1 --pretty=%H proposed/$BRANCH)

+     export MODULE_DEFAULTS_TEST_UPDATED

+ 

+     # Test that it merges cleanly

+     git branch -D baseline || true

+     git checkout -b baseline $MODULE_DEFAULTS_TEST_BASELINE

+     git merge --no-ff "$MODULE_DEFAULTS_TEST_UPDATED" -m "Merge PR"

  

      echo "Running tests for branch $BRANCH of repo $REPO"

      echo "Last commits:"

-     git log -2

+     git log $MODULE_DEFAULTS_TEST_BASELINE..$MODULE_DEFAULTS_TEST_UPDATED

  

-     # Run any tests that only apply to PRs

+     # Run any tests that only apply to PRs.

+     # Always run these from the master branch

+     git checkout origin/master

      tests/pr_tests.sh

  fi

  

file modified
+1 -1
@@ -16,7 +16,7 @@ 

  modified_files=$(git log --name-only \

                           --pretty=oneline \

                           --full-index \

-                          $MODULE_DEFAULTS_TEST_BASELINE..HEAD \

+                          $MODULE_DEFAULTS_TEST_BASELINE..$MODULE_DEFAULTS_TEST_UPDATED \

                    | grep -vE '^[0-9a-f]{40} ' | sort -u)

  

  for file in ${modified_files[@]}; do