chore: omit superceded Chromium updates from notes (#19400)
* feat: omit superceded Chromium updates from notes * chore: simplify changed code
This commit is contained in:
		
					parent
					
						
							
								103b38650f
							
						
					
				
			
			
				commit
				
					
						b3fb7497c2
					
				
			
		
					 1 changed files with 16 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -591,6 +591,8 @@ const getNotes = async (fromRef, toRef, newVersion) => {
 | 
			
		|||
      })
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  pool.commits = removeSupercededChromiumUpdates(pool.commits)
 | 
			
		||||
 | 
			
		||||
  const notes = {
 | 
			
		||||
    breaking: [],
 | 
			
		||||
    docs: [],
 | 
			
		||||
| 
						 | 
				
			
			@ -623,6 +625,20 @@ const getNotes = async (fromRef, toRef, newVersion) => {
 | 
			
		|||
  return notes
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const removeSupercededChromiumUpdates = (commits) => {
 | 
			
		||||
  const chromiumRegex = /^Updated Chromium to \d+\.\d+\.\d+\.\d+/
 | 
			
		||||
  const updates = commits.filter(commit => (commit.note || commit.subject).match(chromiumRegex))
 | 
			
		||||
  const keepers = commits.filter(commit => !updates.includes(commit))
 | 
			
		||||
 | 
			
		||||
  // keep the newest update.
 | 
			
		||||
  if (updates.length) {
 | 
			
		||||
    updates.sort((a, b) => a.originalPr.number - b.originalPr.number)
 | 
			
		||||
    keepers.push(updates.pop())
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  return keepers
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/***
 | 
			
		||||
****  Render
 | 
			
		||||
***/
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue