golang.org/x/build@v0.0.0-20240506185731-218518f32b70/devapp/data.go (about)

     1  // Copyright 2019 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package main
     6  
     7  import (
     8  	"golang.org/x/build/maintner"
     9  )
    10  
    11  var (
    12  	excludedProjects = map[string]bool{
    13  		"gocloud":              true,
    14  		"google-api-go-client": true,
    15  	}
    16  	deletedChanges = map[struct {
    17  		proj string
    18  		num  int32
    19  	}]bool{
    20  		{"crypto", 35958}:  true,
    21  		{"scratch", 71730}: true,
    22  		{"scratch", 71850}: true,
    23  		{"scratch", 72090}: true,
    24  		{"scratch", 72091}: true,
    25  		{"scratch", 72110}: true,
    26  		{"scratch", 72131}: true,
    27  		{"tools", 93515}:   true,
    28  	}
    29  )
    30  
    31  func filterProjects(fn func(*maintner.GerritProject) error) func(*maintner.GerritProject) error {
    32  	return func(p *maintner.GerritProject) error {
    33  		if excludedProjects[p.Project()] {
    34  			return nil
    35  		}
    36  		return fn(p)
    37  	}
    38  }
    39  
    40  func withoutDeletedCLs(p *maintner.GerritProject, fn func(*maintner.GerritCL) error) func(*maintner.GerritCL) error {
    41  	return func(cl *maintner.GerritCL) error {
    42  		if deletedChanges[struct {
    43  			proj string
    44  			num  int32
    45  		}{p.Project(), cl.Number}] {
    46  			return nil
    47  		}
    48  		return fn(cl)
    49  	}
    50  }