Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: CODEOWNERS file #244

Draft
wants to merge 8 commits into
base: development
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/codeowners/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This directory contains automation that helped us generate the [`CODEOWNERS`](/CODEOWNERS) file.

- `main_dirs.txt` is a list of the "main" directories for which we want a list of code owners; this was generated with `find -d`, and manually choosing the "main" directories
- `generate-codeowners.rb` reads `main_dirs.txt` and uses `git` logs to find the unique set of authors for all of the files within each directory; it then writes a new `CODEOWNERS` file
- finally, we go through the `CODEOWNERS` file manually to decide which contributors to keep; those contributors will be notified in PR reviews, so for example we may not want to include contributors who are not involved in the project any more
107 changes: 107 additions & 0 deletions .github/codeowners/generate-codeowners.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
#!/usr/bin/env ruby
# run this script from the TOP level directory

GithubHandles = {
'<Adam Hobart>' => 'ajhobart',
'<Alessandra Filippi>' => 'afilippi67',
'<Andrey Kim>' => 'drewkenjo',
'<Blake Huck>' => 'huckb',
'<Bruno Benkel>' => 'bleaktwig',
'<Christopher Dilks>' => 'c-dilks',
'<Cole Smith>' => 'forcar',
'<Connor Pecar>' => 'cpecar',
'<David Heddle>' => 'heddle',
'<David Payette>' => 'dpayette',
'<Efrain Patrick Segarra>' => '',
'<Efrain Segarra>' => '',
'<Florian Hauenstein>' => 'hauenst',
'<Francesco Bossu>' => 'fbossu',
'<Francois-Xavier Girod>' => 'fxgirod',
'<Gagik Gavalian>' => 'gavalian',
'<Giovanni Angelini>' => 'gangel85',
'<Guillaume Christiaens>' => 'Guillaum-C',
'<Joseph Newton>' => 'josnewton',
'<Justin Goodwill>' => '',
'<L Smith>' => 'forcar',
'<Latif Kabir>' => 'latifkabir',
'<Marco Contalbrigo>' => 'mcontalb',
'<Mathieu Ouillon>' => 'mathieuouillon',
'<Maurik Holtrop>' => 'mholtrop',
'<Maxime Defurne>' => 'mdefurne',
'<Michael Hoffer>' => 'miho',
'<Nathan Baltzell>' => 'baltzell',
'<Nathan Harrison>' => 'naharrison',
'<Nick Markov>' => 'markovnick',
'<Noemie Pilleux-LOCAL>' => 'N-Plx',
'<Peter EJ Davies>' => '',
'<Pierre Chatagnon>' => 'PChatagnon',
'<Rafayel Paremuzyan>' => 'rafopar',
'<Raffaella De Vita>' => 'raffaelladevita',
'<Reynier Cruz Torres>' => '',
'<Rong Wang>' => '',
'<Silvia Nicolai>' => '',
'<Sylvester Joosten>' => 'sly2j',
'<Tongtong Cao>' => 'tongtongcao',
'<Vardan Gyurjyan>' => 'gurjyan',
'<Veronique Ziegler>' => 'zieglerv',
'<ajhobart>' => 'ajhobart',
'<colesmith>' => 'forcar',
'<cqplatt>' => 'cqplatt',
'<dcpayette>' => 'dcpayette',
'<dependabot[bot]>' => '',
'<efuchey>' => 'efuchey',
'<hattawy>' => 'Hattawy',
'<huckb>' => 'huckb',
'<jwgibbs>' => 'jwgibbs',
'<mariangela-bondi>' => 'mariangela-bondi',
'<marmstr4>' => 'marmstr4',
'<mcontalb>' => 'mcontalb',
'<mpaolone>' => 'mpaolone',
'<rtysonCLAS12>' => 'rtysonCLAS12',
'<tongtongcao>' => 'tongtongcao',
'<veronique>' => 'zieglerv',
}

codeowners = File.open('CODEOWNERS', 'w')
unknown_authors = []

File.readlines('.github/codeowners/main_dirs.txt').map(&:chomp).each do |line|
if line.match? /^#/ or line.empty?
codeowners.puts line
next
end

if line == '*'
codeowners.puts [line, '@baltzell', '@raffaelladevita', '@c-dilks'].join(' ')
next
end

puts line
these_authors = []
file_list = `git ls-files #{line.sub /\/\*$/, ''}`.split "\n"
file_list.each do |file|
puts " - #{file}"
authors = `git shortlog -s -n -- '#{file}'`.split("\n").map do |line|
"<" + line.split(' ')[1..-1].join(' ') + ">"
end
handles = authors.map do |author|
handle = GithubHandles[author]
if handle != ''
"@#{handle}"
else
unknown_authors << author
author
end
end.reject{|h|h.match?(/dependabot/)}
these_authors += handles
end
codeowners.puts "#{line.gsub(' ','\ ')} #{these_authors.uniq.join(' ')}"

end

unless unknown_authors.empty?
$stderr.puts "WARNING: the following authors have unknown GitHub handles:"
$stderr.puts unknown_authors.uniq.sort
end

codeowners.close
97 changes: 97 additions & 0 deletions .github/codeowners/main_dirs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# primary maintainers
*

# infrastructure
.github/*
bin/*
docs/*
external-dependencies/*
libexec/*
parent/*

# common-tools
common-tools/clara-io/*
common-tools/clas-analysis/*
common-tools/clas-io/*
common-tools/clas-jcsg/*
common-tools/clas-logging/*
common-tools/clas-math/*
common-tools/clas-physics/*
common-tools/clas-reco/*
common-tools/clas-tracking/*
common-tools/clas-utils/*
common-tools/cnuphys/*
common-tools/coat-lib/*
common-tools/parent/*
common-tools/swim-tools/*

# common-tools / clas-detector
common-tools/clas-detector/src/main/java/org/jlab/detector/banks/*
common-tools/clas-detector/src/main/java/org/jlab/detector/base/*
common-tools/clas-detector/src/main/java/org/jlab/detector/calib/*
common-tools/clas-detector/src/main/java/org/jlab/detector/decode/*
common-tools/clas-detector/src/main/java/org/jlab/detector/epics/*
common-tools/clas-detector/src/main/java/org/jlab/detector/examples/*
common-tools/clas-detector/src/main/java/org/jlab/detector/helicity/*
common-tools/clas-detector/src/main/java/org/jlab/detector/scalers/*
common-tools/clas-detector/src/main/java/org/jlab/detector/swaps/*
common-tools/clas-detector/src/main/java/org/jlab/detector/view/*
common-tools/clas-detector/src/test/*

# common-tools / clas-geometry
common-tools/clas-geometry/src/main/java/org/jlab/detector/*
common-tools/clas-geometry/src/main/java/org/jlab/geom/abs/*
common-tools/clas-geometry/src/main/java/org/jlab/geom/base/*
common-tools/clas-geometry/src/main/java/org/jlab/geom/component/*
common-tools/clas-geometry/src/main/java/org/jlab/geom/detector/*
common-tools/clas-geometry/src/main/java/org/jlab/geom/detector/alert/*
common-tools/clas-geometry/src/main/java/org/jlab/geom/detector/bst/*
common-tools/clas-geometry/src/main/java/org/jlab/geom/detector/cnd/*
common-tools/clas-geometry/src/main/java/org/jlab/geom/detector/dc/*
common-tools/clas-geometry/src/main/java/org/jlab/geom/detector/ec/*
common-tools/clas-geometry/src/main/java/org/jlab/geom/detector/fmt/*
common-tools/clas-geometry/src/main/java/org/jlab/geom/detector/ft/*
common-tools/clas-geometry/src/main/java/org/jlab/geom/detector/ftof/*
common-tools/clas-geometry/src/main/java/org/jlab/geom/fx/*
common-tools/clas-geometry/src/main/java/org/jlab/geom/geant/*
common-tools/clas-geometry/src/main/java/org/jlab/geom/gemc/*
common-tools/clas-geometry/src/main/java/org/jlab/geom/gui/*
common-tools/clas-geometry/src/main/java/org/jlab/geom/prim/*
common-tools/clas-geometry/src/main/java/org/jlab/geom/view/*

# etc
etc/bankdefs/*
etc/benchmarks/*
etc/data/*
etc/ejml/*
etc/logging/*
etc/nnet/*
etc/services/*

# reconstruction
reconstruction/alert/*
reconstruction/band/*
reconstruction/bg/*
reconstruction/cnd/*
reconstruction/cvt/*
reconstruction/dc/*
reconstruction/eb/*
reconstruction/ec/*
reconstruction/ec/src/*
reconstruction/fmt/*
reconstruction/ft/*
reconstruction/htcc/*
reconstruction/ltcc/*
reconstruction/mc/*
reconstruction/mltn/*
reconstruction/postproc/*
reconstruction/raster/*
reconstruction/rich/*
reconstruction/rtpc/*
reconstruction/swaps/*
reconstruction/tof/*
reconstruction/urwell/*
reconstruction/vtx/*

# validation
validation/*
97 changes: 97 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# primary maintainers
* @baltzell @raffaelladevita @c-dilks

# infrastructure
.github/* @c-dilks @baltzell
bin/* @c-dilks @baltzell @raffaelladevita @naharrison @zieglerv @gavalian @jwgibbs
docs/* @c-dilks @baltzell
external-dependencies/* @baltzell
libexec/* @c-dilks
parent/* @raffaelladevita @baltzell @c-dilks @naharrison @zieglerv

# common-tools
common-tools/clara-io/* @baltzell @raffaelladevita
common-tools/clas-analysis/* @raffaelladevita @baltzell @naharrison @zieglerv @marmstr4
common-tools/clas-io/* @raffaelladevita @baltzell @gavalian @naharrison @zieglerv @forcar @drewkenjo @huckb
common-tools/clas-jcsg/* @drewkenjo @naharrison @raffaelladevita @baltzell @zieglerv @gangel85 @mcontalb @cqplatt @mariangela-bondi @gavalian @cpecar
common-tools/clas-logging/* @baltzell @raffaelladevita
common-tools/clas-math/* @raffaelladevita @baltzell @zieglerv @tongtongcao
common-tools/clas-physics/* @raffaelladevita @baltzell @naharrison @zieglerv @drewkenjo @gavalian @fxgirod
common-tools/clas-reco/* @raffaelladevita @baltzell @naharrison @zieglerv @josnewton @mcontalb @gavalian @afilippi67 @N-Plx @drewkenjo @rafopar @gurjyan @dcpayette <Efrain Segarra> @hauenst
common-tools/clas-tracking/* @zieglerv @baltzell @raffaelladevita @tongtongcao
common-tools/clas-utils/* @raffaelladevita @baltzell @naharrison @zieglerv @gavalian
common-tools/cnuphys/* @heddle @naharrison @raffaelladevita @baltzell @zieglerv @tongtongcao
common-tools/coat-lib/* @raffaelladevita @baltzell @gavalian @naharrison @zieglerv @drewkenjo
common-tools/parent/* @raffaelladevita @baltzell @naharrison @zieglerv
common-tools/swim-tools/* @raffaelladevita @baltzell @zieglerv @heddle @tongtongcao @gurjyan

# common-tools / clas-detector
common-tools/clas-detector/src/main/java/org/jlab/detector/banks/* @baltzell @raffaelladevita
common-tools/clas-detector/src/main/java/org/jlab/detector/base/* @naharrison @baltzell @raffaelladevita @afilippi67 @forcar @mcontalb @zieglerv @drewkenjo
common-tools/clas-detector/src/main/java/org/jlab/detector/calib/* @naharrison @baltzell @gavalian @raffaelladevita
common-tools/clas-detector/src/main/java/org/jlab/detector/decode/* @baltzell @raffaelladevita @gavalian @drewkenjo @naharrison @forcar @mdefurne @zieglerv @fbossu @mholtrop @fxgirod @Guillaum-C
common-tools/clas-detector/src/main/java/org/jlab/detector/epics/* @raffaelladevita
common-tools/clas-detector/src/main/java/org/jlab/detector/examples/* @raffaelladevita @naharrison @gavalian @baltzell
common-tools/clas-detector/src/main/java/org/jlab/detector/helicity/* @baltzell @raffaelladevita
common-tools/clas-detector/src/main/java/org/jlab/detector/scalers/* @baltzell
common-tools/clas-detector/src/main/java/org/jlab/detector/swaps/* @baltzell
common-tools/clas-detector/src/main/java/org/jlab/detector/view/* @naharrison @drewkenjo <Justin Goodwill>
common-tools/clas-detector/src/test/* @naharrison

# common-tools / clas-geometry
common-tools/clas-geometry/src/main/java/org/jlab/detector/* @naharrison
common-tools/clas-geometry/src/main/java/org/jlab/geom/abs/* @naharrison
common-tools/clas-geometry/src/main/java/org/jlab/geom/base/* @naharrison
common-tools/clas-geometry/src/main/java/org/jlab/geom/component/* @naharrison @raffaelladevita
common-tools/clas-geometry/src/main/java/org/jlab/geom/detector/* @mathieuouillon @naharrison @raffaelladevita @gavalian
common-tools/clas-geometry/src/main/java/org/jlab/geom/detector/alert/* @mathieuouillon
common-tools/clas-geometry/src/main/java/org/jlab/geom/detector/bst/* @naharrison
common-tools/clas-geometry/src/main/java/org/jlab/geom/detector/cnd/* @naharrison @raffaelladevita
common-tools/clas-geometry/src/main/java/org/jlab/geom/detector/dc/* @gavalian @naharrison
common-tools/clas-geometry/src/main/java/org/jlab/geom/detector/ec/* @naharrison @raffaelladevita
common-tools/clas-geometry/src/main/java/org/jlab/geom/detector/fmt/* @raffaelladevita
common-tools/clas-geometry/src/main/java/org/jlab/geom/detector/ft/* @naharrison
common-tools/clas-geometry/src/main/java/org/jlab/geom/detector/ftof/* @naharrison
common-tools/clas-geometry/src/main/java/org/jlab/geom/fx/* @baltzell
common-tools/clas-geometry/src/main/java/org/jlab/geom/geant/* @naharrison
common-tools/clas-geometry/src/main/java/org/jlab/geom/gemc/* @naharrison
common-tools/clas-geometry/src/main/java/org/jlab/geom/gui/* @naharrison
common-tools/clas-geometry/src/main/java/org/jlab/geom/prim/* @naharrison @zieglerv @raffaelladevita @baltzell @gavalian @mcontalb
common-tools/clas-geometry/src/main/java/org/jlab/geom/view/* @naharrison

# etc
etc/bankdefs/* @hauenst <Efrain Segarra> @naharrison @raffaelladevita @zieglerv @gavalian @fxgirod @gangel85 @dcpayette @baltzell <Rong Wang> @drewkenjo @josnewton @afilippi67 @markovnick @rafopar @mathieuouillon @mpaolone @huckb @ajhobart @N-Plx @tongtongcao @forcar @mcontalb @rtysonCLAS12
etc/benchmarks/* @naharrison
etc/data/* @drewkenjo
etc/ejml/* @raffaelladevita @gavalian
etc/logging/* @baltzell
etc/nnet/* @gavalian
etc/services/* @baltzell @raffaelladevita @zieglerv

# reconstruction
reconstruction/alert/* @baltzell @raffaelladevita @mathieuouillon @mpaolone @efuchey
reconstruction/band/* @raffaelladevita @baltzell @zieglerv @hauenst <Efrain Segarra> <Efrain Patrick Segarra> <Reynier Cruz Torres>
reconstruction/bg/* @baltzell @raffaelladevita
reconstruction/cnd/* @raffaelladevita @baltzell @naharrison @zieglerv @PChatagnon @ajhobart <Rong Wang> <Silvia Nicolai>
reconstruction/cvt/* @zieglerv @raffaelladevita @baltzell @naharrison @drewkenjo @fbossu @N-Plx @Guillaum-C
reconstruction/dc/* @naharrison @raffaelladevita @baltzell @zieglerv @drewkenjo @tongtongcao @gurjyan @mcontalb @hauenst @latifkabir @gavalian @bleaktwig @N-Plx @marmstr4
reconstruction/eb/* @baltzell @naharrison @raffaelladevita @sly2j @zieglerv @josnewton
reconstruction/ec/* @naharrison @raffaelladevita @baltzell @zieglerv @forcar @gavalian @rafopar
reconstruction/ec/src/* @forcar @naharrison @raffaelladevita @baltzell @gavalian @rafopar
reconstruction/fmt/* @baltzell @raffaelladevita
reconstruction/ft/* @naharrison @raffaelladevita @baltzell @zieglerv @afilippi67
reconstruction/htcc/* @raffaelladevita @baltzell @naharrison @zieglerv @markovnick
reconstruction/ltcc/* @naharrison @raffaelladevita @baltzell @zieglerv @sly2j
reconstruction/mc/* @baltzell @raffaelladevita @rafopar @zieglerv
reconstruction/mltn/* @baltzell @raffaelladevita @gavalian
reconstruction/postproc/* @baltzell
reconstruction/raster/* @baltzell @raffaelladevita @N-Plx
reconstruction/rich/* @drewkenjo @raffaelladevita @baltzell @naharrison @zieglerv @mcontalb
reconstruction/rtpc/* @dcpayette @raffaelladevita @baltzell @mathieuouillon @zieglerv @Hattawy @dpayette
reconstruction/swaps/* @baltzell @raffaelladevita
reconstruction/tof/* @naharrison @zieglerv @raffaelladevita @baltzell @drewkenjo @gavalian
reconstruction/urwell/* @baltzell @raffaelladevita @tongtongcao
reconstruction/vtx/* @baltzell @raffaelladevita @zieglerv

# validation
validation/* @baltzell @naharrison @raffaelladevita @c-dilks @gurjyan @zieglerv