modularization_statistics 1.35.0 → 1.36.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 75ff0dc32b62d7a71ef4670809d77dfd7bac173f95529de171fc22f90f93ba41
4
- data.tar.gz: c453e59ffd54ee91e1d535ca55767506f82cc5f43db8418423ed44e80b646c3c
3
+ metadata.gz: 3684ee2e07b5f3cba3bb7093be91b88725808a8a3d203e4ede46c7aa116d920c
4
+ data.tar.gz: 7872ee6e03ff44a158e2274861c0de2700227e976078e3c905dc8f102d58cfaa
5
5
  SHA512:
6
- metadata.gz: a8087b6b892da279242b6e8e40daf3925ccc77e50d6f640712d9e1bc1554ef770785bf84d9fd83f77ab56cbccf2432bccf453139886749665956c5f317cebc7d
7
- data.tar.gz: 35d695c1e0f5fd13a5d9e5f97fc2a5f582cfbe1536a479c34f49c81f4e50e2ea0ce4ce5b12c0aee80b11d9a2f998609322801787df7ccbf781cc3e985a064f23
6
+ metadata.gz: c6d080bc0c7e9c199e37262c8949a9227510eae2e7cac98d8c90121f788aca0b5123da006ba4a3ade27b512b3a7373ea06f789f82d108d51dc6d83cdf3378291
7
+ data.tar.gz: 3333265a294391652a0d07199c897e6ff02f2e40536e9a3654f7cfa2c21d1bf91c4f6cff0d5771eeea581b3f17740621d317c7f2a4a058960fd1328a9a801457
@@ -83,7 +83,7 @@ module ModularizationStatistics
83
83
  all_metrics << GaugeMetric.for('child_packs.count', child_pack_count, package_tags)
84
84
  all_metrics << GaugeMetric.for('parent_packs.count', parent_pack_count, package_tags)
85
85
  all_metrics << GaugeMetric.for('all_pack_groups.privacy_violations.count', Metrics.file_count(all_cross_pack_group_violations.select(&:privacy?)), package_tags)
86
- all_metrics << GaugeMetric.for('all_pack_groups.dependency_violations.count', Metrics.file_count(all_cross_pack_group_violations.select(&:dependency?)), package_tags)
86
+ all_metrics << GaugeMetric.for('all_pack_groups.dependency_violations.count', Metrics.file_count(all_cross_pack_group_violations.select(&:dependency?)), package_tags)\
87
87
 
88
88
  packs_by_group = {}
89
89
  pack_groups.each do |pack_group|
@@ -92,6 +92,27 @@ module ModularizationStatistics
92
92
  end
93
93
  end
94
94
 
95
+ inbound_violations_by_pack_group = {}
96
+ all_cross_pack_group_violations.group_by(&:to_package_name).each do |to_package_name, violations|
97
+ violations.each do |violation|
98
+ pack_group_for_violation = packs_by_group[violation.to_package_name]
99
+ inbound_violations_by_pack_group[pack_group_for_violation] ||= []
100
+ inbound_violations_by_pack_group[pack_group_for_violation] << violation
101
+ end
102
+ end
103
+
104
+ pack_groups.each do |pack_group|
105
+ tags = [
106
+ *package_tags,
107
+ Tag.for('pack_group', Metrics.humanized_package_name(pack_group.name)),
108
+ ]
109
+
110
+ outbound_dependency_violations = pack_group.cross_group_violations.select(&:dependency?)
111
+ inbound_privacy_violations = inbound_violations_by_pack_group.fetch(pack_group.name, []).select(&:privacy?)
112
+ all_metrics << GaugeMetric.for('by_pack_group.outbound_dependency_violations.count', Metrics.file_count(outbound_dependency_violations), tags)
113
+ all_metrics << GaugeMetric.for('by_pack_group.inbound_privacy_violations.count', Metrics.file_count(inbound_privacy_violations), tags)
114
+ end
115
+
95
116
  pack_groups.each do |from_pack_group|
96
117
  violations_by_to_pack_group = from_pack_group.cross_group_violations.group_by do |violation|
97
118
  packs_by_group[violation.to_package_name]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: modularization_statistics
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.35.0
4
+ version: 1.36.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gusto Engineers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-18 00:00:00.000000000 Z
11
+ date: 2022-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: code_teams