Merge branch 'stable-3.1'
* stable-3.1: LazyPostReceiveHookChain: Don't call ReceivePack.getPackSize for delete Move repository description to the last column. Jenkinsfile: Always build java sources if WORKSPACE file changed Change-Id: Ifa56bbddba70a5358d9d04c35ab5a26ef3af2130
This commit is contained in:
		
							
								
								
									
										5
									
								
								Jenkinsfile
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								Jenkinsfile
									
									
									
									
										vendored
									
									
								
							@@ -139,7 +139,7 @@ def collectBuildModes() {
 | 
			
		||||
    def polygerritFiles = changedFiles.findAll { it.startsWith("polygerrit-ui") ||
 | 
			
		||||
        it.startsWith("lib/js") }
 | 
			
		||||
 | 
			
		||||
    if(polygerritFiles.size() > 0 || changedFiles.contains("WORKSPACE")) {
 | 
			
		||||
    if(polygerritFiles.size() > 0) {
 | 
			
		||||
        if(changedFiles.size() == polygerritFiles.size()) {
 | 
			
		||||
            println "Only PolyGerrit UI changes detected, skipping other test modes..."
 | 
			
		||||
            Builds.modes = ["polygerrit"]
 | 
			
		||||
@@ -147,6 +147,9 @@ def collectBuildModes() {
 | 
			
		||||
            println "PolyGerrit UI changes detected, adding 'polygerrit' validation..."
 | 
			
		||||
            Builds.modes += "polygerrit"
 | 
			
		||||
        }
 | 
			
		||||
    } else if(changedFiles.contains("WORKSPACE")) {
 | 
			
		||||
        println "WORKSPACE file changes detected, adding 'polygerrit' validation..."
 | 
			
		||||
        Builds.modes += "polygerrit"
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -79,13 +79,9 @@ public class LazyPostReceiveHookChain implements PostReceiveHook {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  public static boolean affectsSize(ReceivePack rp, Collection<ReceiveCommand> commands) {
 | 
			
		||||
    if (rp.getPackSize() > 0L) {
 | 
			
		||||
      for (ReceiveCommand cmd : commands) {
 | 
			
		||||
        if (cmd.getType() != ReceiveCommand.Type.DELETE) {
 | 
			
		||||
          return true;
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    if (commands.stream().allMatch(c -> c.getType() == ReceiveCommand.Type.DELETE)) {
 | 
			
		||||
      return false;
 | 
			
		||||
    }
 | 
			
		||||
    return false;
 | 
			
		||||
    return rp.getPackSize() > 0L;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user