git-pkgs 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/lib/git/pkgs/commands/blame.rb +6 -1
- data/lib/git/pkgs/commands/list.rb +5 -5
- data/lib/git/pkgs/commands/search.rb +2 -2
- data/lib/git/pkgs/commands/stale.rb +6 -1
- data/lib/git/pkgs/commands/stats.rb +6 -5
- data/lib/git/pkgs/database.rb +8 -4
- data/lib/git/pkgs/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: da979135545dc93ed1b362560e7a5f9659097512603a522e6665bc2268b46466
|
|
4
|
+
data.tar.gz: 7b1a2838c823ec205761288f9126f0015597e890e7ba768c3e071ecdd14efb4b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 801260e17dabe686670fbcc10a5c0e760ef5f39df0273029c1f3ab9ef2502f0f7ea78d6a3cfc633fb547f6df604d2d895411c5921c345365d6ea85dd12578403
|
|
7
|
+
data.tar.gz: 138cdd14d12798c7d1d2ea6c7c7cd920805c008f10ce4057c8f3c9ebf6db7b7191720d88cb228e53786e50b7c077c17c9014c73be037a1582592965ef46889f3
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [0.6.1] - 2026-01-05
|
|
4
|
+
|
|
5
|
+
- Fix `stats` command crash on most changed dependencies query
|
|
6
|
+
- Fix `search` command SQL alias error when displaying results
|
|
7
|
+
- Fix `blame` and `stale` commands eager loading error
|
|
8
|
+
- Fix `list` command returning empty output when ecosystem filter matches nothing
|
|
9
|
+
|
|
3
10
|
## [0.6.0] - 2026-01-05
|
|
4
11
|
|
|
5
12
|
- Replace ActiveRecord with Sequel (~3x faster init, ~2x faster queries)
|
|
@@ -24,12 +24,17 @@ module Git
|
|
|
24
24
|
error "No analysis found for branch '#{branch_name}'. Run 'git pkgs init' first." unless branch&.last_analyzed_sha
|
|
25
25
|
|
|
26
26
|
current_commit = Models::Commit.first(sha: branch.last_analyzed_sha)
|
|
27
|
-
|
|
27
|
+
|
|
28
|
+
return empty_result("No dependencies found") unless current_commit
|
|
29
|
+
|
|
30
|
+
snapshots = current_commit.dependency_snapshots_dataset.eager(:manifest)
|
|
28
31
|
|
|
29
32
|
if @options[:ecosystem]
|
|
30
33
|
snapshots = snapshots.where(ecosystem: @options[:ecosystem])
|
|
31
34
|
end
|
|
32
35
|
|
|
36
|
+
snapshots = snapshots.all
|
|
37
|
+
|
|
33
38
|
if snapshots.empty?
|
|
34
39
|
empty_result "No dependencies found"
|
|
35
40
|
return
|
|
@@ -24,11 +24,6 @@ module Git
|
|
|
24
24
|
|
|
25
25
|
deps = compute_dependencies_at_commit(target_commit, repo)
|
|
26
26
|
|
|
27
|
-
if deps.empty?
|
|
28
|
-
empty_result "No dependencies found"
|
|
29
|
-
return
|
|
30
|
-
end
|
|
31
|
-
|
|
32
27
|
# Apply filters
|
|
33
28
|
if @options[:ecosystem]
|
|
34
29
|
deps = deps.select { |d| d[:ecosystem] == @options[:ecosystem] }
|
|
@@ -38,6 +33,11 @@ module Git
|
|
|
38
33
|
deps = deps.select { |d| d[:dependency_type] == @options[:type] }
|
|
39
34
|
end
|
|
40
35
|
|
|
36
|
+
if deps.empty?
|
|
37
|
+
empty_result "No dependencies found"
|
|
38
|
+
return
|
|
39
|
+
end
|
|
40
|
+
|
|
41
41
|
if @options[:format] == "json"
|
|
42
42
|
require "json"
|
|
43
43
|
puts JSON.pretty_generate(deps)
|
|
@@ -72,7 +72,7 @@ module Git
|
|
|
72
72
|
.where(name: name, ecosystem: platform)
|
|
73
73
|
.eager(:commit)
|
|
74
74
|
.association_join(:commit)
|
|
75
|
-
.order(Sequel[:
|
|
75
|
+
.order(Sequel[:commit][:committed_at])
|
|
76
76
|
.all
|
|
77
77
|
|
|
78
78
|
first = changes.first
|
|
@@ -98,7 +98,7 @@ module Git
|
|
|
98
98
|
.where(name: name, ecosystem: platform)
|
|
99
99
|
.eager(:commit)
|
|
100
100
|
.association_join(:commit)
|
|
101
|
-
.order(Sequel[:
|
|
101
|
+
.order(Sequel[:commit][:committed_at])
|
|
102
102
|
.all
|
|
103
103
|
|
|
104
104
|
first = changes.first
|
|
@@ -23,12 +23,17 @@ module Git
|
|
|
23
23
|
error "No analysis found for branch '#{branch_name}'. Run 'git pkgs init' first." unless branch&.last_analyzed_sha
|
|
24
24
|
|
|
25
25
|
current_commit = Models::Commit.first(sha: branch.last_analyzed_sha)
|
|
26
|
-
|
|
26
|
+
|
|
27
|
+
return empty_result("No dependencies found") unless current_commit
|
|
28
|
+
|
|
29
|
+
snapshots = current_commit.dependency_snapshots_dataset.eager(:manifest)
|
|
27
30
|
|
|
28
31
|
if @options[:ecosystem]
|
|
29
32
|
snapshots = snapshots.where(ecosystem: @options[:ecosystem])
|
|
30
33
|
end
|
|
31
34
|
|
|
35
|
+
snapshots = snapshots.all
|
|
36
|
+
|
|
32
37
|
if snapshots.empty?
|
|
33
38
|
empty_result "No dependencies found"
|
|
34
39
|
return
|
|
@@ -79,14 +79,15 @@ module Git
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
most_changed = changes
|
|
82
|
+
.select(Sequel[:dependency_changes][:name], Sequel[:dependency_changes][:ecosystem])
|
|
83
|
+
.select_append { count.function.*.as(:change_count) }
|
|
82
84
|
.group(Sequel[:dependency_changes][:name], Sequel[:dependency_changes][:ecosystem])
|
|
83
|
-
.order(Sequel.desc(:
|
|
85
|
+
.order(Sequel.desc(:change_count))
|
|
84
86
|
.limit(10)
|
|
85
|
-
.
|
|
86
|
-
.select_map([:name, :ecosystem, :count])
|
|
87
|
+
.all
|
|
87
88
|
|
|
88
|
-
data[:most_changed] = most_changed.map do |
|
|
89
|
-
{ name: name, ecosystem:
|
|
89
|
+
data[:most_changed] = most_changed.map do |row|
|
|
90
|
+
{ name: row[:name], ecosystem: row[:ecosystem], changes: row[:change_count] }
|
|
90
91
|
end
|
|
91
92
|
|
|
92
93
|
manifests = Models::Manifest.dataset
|
data/lib/git/pkgs/database.rb
CHANGED
|
@@ -85,14 +85,18 @@ module Git
|
|
|
85
85
|
Git::Pkgs::Models::DependencySnapshot
|
|
86
86
|
].each do |model|
|
|
87
87
|
model.dataset = @db[model.table_name]
|
|
88
|
-
# Clear cached association
|
|
88
|
+
# Clear all cached association data that may reference old db
|
|
89
89
|
model.association_reflections.each_value do |reflection|
|
|
90
|
+
reflection.delete(:_dataset)
|
|
91
|
+
reflection.delete(:associated_eager_dataset)
|
|
92
|
+
reflection.delete(:placeholder_eager_loader)
|
|
93
|
+
reflection.delete(:placeholder_eager_graph_loader)
|
|
90
94
|
if reflection[:cache]
|
|
91
|
-
reflection[:cache].
|
|
92
|
-
reflection[:cache].delete(:associated_eager_dataset)
|
|
93
|
-
reflection[:cache].delete(:placeholder_eager_loader)
|
|
95
|
+
reflection[:cache].clear
|
|
94
96
|
end
|
|
95
97
|
end
|
|
98
|
+
# Clear model instance caches
|
|
99
|
+
model.instance_variable_set(:@columns, nil) if model.instance_variable_defined?(:@columns)
|
|
96
100
|
rescue Sequel::Error
|
|
97
101
|
# Table may not exist yet
|
|
98
102
|
end
|
data/lib/git/pkgs/version.rb
CHANGED