File tree Expand file tree Collapse file tree
lib/code_ownership/private
spec/lib/code_ownership/private/validations Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11PATH
22 remote: .
33 specs:
4- code_ownership (1.32.6 )
4+ code_ownership (1.32.7 )
55 code_teams (~> 1.0 )
66 packs
77 sorbet-runtime
Original file line number Diff line number Diff line change 11Gem ::Specification . new do |spec |
22 spec . name = "code_ownership"
3- spec . version = '1.32.6 '
3+ spec . version = '1.32.7 '
44 spec . authors = [ 'Gusto Engineers' ]
55 spec . email = [ 'dev@gusto.com' ]
66 spec . summary = 'A gem to help engineering teams declare ownership of code'
Original file line number Diff line number Diff line change @@ -56,14 +56,15 @@ def self.expected_contents_lines
5656 ownership_map_cache . each do |path , code_team |
5757 team_mapping = github_team_map [ code_team . name ]
5858 next if team_mapping . nil?
59- next if ignored_teams . include? ( code_team . name )
60- entry = "/#{ path } #{ team_mapping } "
61- # In order to use the codeowners file as a proper cache, we'll need to insert commented out entries for ignored teams
62- # entry = if ignored_teams.include?(code_team.name)
63- # "# /#{path} #{team_mapping}"
64- # else
65- # "/#{path} #{team_mapping}"
66- # end
59+
60+ # Leaving a commented out entry has two major benefits:
61+ # 1) It allows the CODEOWNERS file to be used as a cache for validations
62+ # 2) It allows users to specifically see what their team will not be notified about.
63+ entry = if ignored_teams . include? ( code_team . name )
64+ "# /#{ path } #{ team_mapping } "
65+ else
66+ "/#{ path } #{ team_mapping } "
67+ end
6768 ownership_entries << entry
6869 end
6970
Original file line number Diff line number Diff line change @@ -150,6 +150,23 @@ module CodeOwnership
150150 # code/file owner is notified. Reference GitHub docs for more details:
151151 # https://help.github.com/en/articles/about-code-owners
152152
153+
154+ # Annotations at the top of file
155+ # /frontend/javascripts/packages/my_package/owned_file.jsx @MyOrg/bar-team
156+ # /packs/my_pack/owned_file.rb @MyOrg/bar-team
157+
158+ # Team-specific owned globs
159+ # /app/services/bar_stuff/** @MyOrg/bar-team
160+ # /frontend/javascripts/bar_stuff/** @MyOrg/bar-team
161+
162+ # Owner metadata key in package.yml
163+ # /packs/my_other_package/**/** @MyOrg/bar-team
164+
165+ # Owner metadata key in package.json
166+ # /frontend/javascripts/packages/my_other_package/**/** @MyOrg/bar-team
167+
168+ # Team YML ownership
169+ # /config/teams/bar.yml @MyOrg/bar-team
153170 EXPECTED
154171 end
155172 end
You can’t perform that action at this time.
0 commit comments