pray-cli 1.12.0 → 1.12.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 +4 -0
- data/lib/pray/git_refresh.rb +69 -0
- data/lib/pray/invocation.rb +6 -2
- data/lib/pray/materialize.rb +9 -2
- data/lib/pray/resolve.rb +26 -10
- data/lib/pray/version.rb +2 -2
- data/lib/pray.rb +1 -0
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 58da4ada7990f04bc2acf64b33bca633828a586f0918e1e3ff00cc50ddaeb7c5
|
|
4
|
+
data.tar.gz: ffc0855f9f9dc6466fe1260905b23d9ab74a5d96905562f8307f472dde851849
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 20cab97de54d753c4f7191f6a68469bbc7f4801e16999e7ca8ee13c0e1c5c27e53b8e0c436695a6f457cb169e7f4389d41407f9e56752cf7fed33c329b5fa94b
|
|
7
|
+
data.tar.gz: 109496e4410f4bc43f63af51a73ec3439f87348a5c1e94dbed712799416d8e47286360f97bb50e37aaad096f8c0957fc3e2a9a26840167fefe7ea1d6dbb66abd
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 1.12.1 (2026-09-08)
|
|
6
|
+
|
|
7
|
+
- Refresh a locked git catalog during `pray install` when a newly declared package is missing from the pinned revision, and name that revision with `pray update` if it is still missing.
|
|
8
|
+
|
|
5
9
|
## 1.12.0 (2026-09-07)
|
|
6
10
|
|
|
7
11
|
- Speed up planning for large package trees and reuse the resolved lock during installation.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pray
|
|
4
|
+
module GitRefresh
|
|
5
|
+
module_function
|
|
6
|
+
|
|
7
|
+
def resolution_may_benefit_from_git_source_refresh?(error)
|
|
8
|
+
error.category == :resolution && catalog_miss_message?(error.message)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def catalog_miss_message?(message)
|
|
12
|
+
message.include?("no registry version") ||
|
|
13
|
+
message.include?("not found in distribution") ||
|
|
14
|
+
message.include?("not found in git source") ||
|
|
15
|
+
message.include?("v1/packages/")
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def annotate_missing_git_catalog(error, package_name:, source_name:, revision:)
|
|
19
|
+
return error unless error.category == :resolution
|
|
20
|
+
return error if revision.to_s.empty?
|
|
21
|
+
return error unless catalog_miss_message?(error.message)
|
|
22
|
+
return error if error.message.include?("not found in git source")
|
|
23
|
+
|
|
24
|
+
Error.resolution(
|
|
25
|
+
"package #{package_name} was not found in git source #{source_name} at revision #{revision}. " \
|
|
26
|
+
"Run `pray update` to advance the source pin."
|
|
27
|
+
)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def annotate_failed_refresh(lockfile_path, error)
|
|
31
|
+
return error unless error.category == :resolution
|
|
32
|
+
return error unless catalog_miss_message?(error.message)
|
|
33
|
+
|
|
34
|
+
pins = locked_git_revision_guidance(lockfile_path)
|
|
35
|
+
return error if pins.nil?
|
|
36
|
+
|
|
37
|
+
package = package_name_from_catalog_miss(error.message) || "the declared package"
|
|
38
|
+
Error.resolution(
|
|
39
|
+
"package #{package} was not found in locked git source (#{pins}). " \
|
|
40
|
+
"Run `pray update` to advance the source pin."
|
|
41
|
+
)
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def locked_git_revision_guidance(lockfile_path)
|
|
45
|
+
return unless File.exist?(lockfile_path)
|
|
46
|
+
|
|
47
|
+
lockfile = LockfileIO.read_lockfile(lockfile_path)
|
|
48
|
+
pins = lockfile.source.filter_map do |source|
|
|
49
|
+
next unless source.kind == "git" && source.revision
|
|
50
|
+
|
|
51
|
+
"#{source.name} at #{source.revision}"
|
|
52
|
+
end
|
|
53
|
+
pins.empty? ? nil : pins.join(", ")
|
|
54
|
+
rescue Error
|
|
55
|
+
nil
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def package_name_from_catalog_miss(message)
|
|
59
|
+
rest = message.delete_prefix("package ")
|
|
60
|
+
return if rest == message
|
|
61
|
+
|
|
62
|
+
ending = rest.index(" was not found") || rest.index(" not found")
|
|
63
|
+
return unless ending
|
|
64
|
+
|
|
65
|
+
name = rest[0, ending].strip
|
|
66
|
+
name.empty? ? nil : name
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
end
|
data/lib/pray/invocation.rb
CHANGED
|
@@ -49,10 +49,14 @@ module Pray
|
|
|
49
49
|
if allow_git_refresh_fallback &&
|
|
50
50
|
!options.offline &&
|
|
51
51
|
!options.refresh &&
|
|
52
|
-
|
|
52
|
+
GitRefresh.resolution_may_benefit_from_git_source_refresh?(error)
|
|
53
53
|
refreshed = options.dup
|
|
54
54
|
refreshed.refresh = true
|
|
55
|
-
|
|
55
|
+
begin
|
|
56
|
+
resolve_current_project(refreshed)
|
|
57
|
+
rescue Error => retry_error
|
|
58
|
+
raise GitRefresh.annotate_failed_refresh(lockfile_path, retry_error)
|
|
59
|
+
end
|
|
56
60
|
else
|
|
57
61
|
raise
|
|
58
62
|
end
|
data/lib/pray/materialize.rb
CHANGED
|
@@ -34,10 +34,17 @@ module Pray
|
|
|
34
34
|
if allow_git_refresh_fallback &&
|
|
35
35
|
!offline &&
|
|
36
36
|
!refresh &&
|
|
37
|
-
|
|
37
|
+
GitRefresh.resolution_may_benefit_from_git_source_refresh?(error)
|
|
38
38
|
refreshed = options.dup
|
|
39
39
|
refreshed.refresh = true
|
|
40
|
-
|
|
40
|
+
begin
|
|
41
|
+
Resolve.resolve_project_in_context(manifest_path, project_root, refreshed)
|
|
42
|
+
rescue Error => retry_error
|
|
43
|
+
raise GitRefresh.annotate_failed_refresh(
|
|
44
|
+
default_lockfile_path(project_root),
|
|
45
|
+
retry_error
|
|
46
|
+
)
|
|
47
|
+
end
|
|
41
48
|
else
|
|
42
49
|
raise
|
|
43
50
|
end
|
data/lib/pray/resolve.rb
CHANGED
|
@@ -127,14 +127,21 @@ module Pray
|
|
|
127
127
|
!refresh &&
|
|
128
128
|
resolution_may_benefit_from_git_source_refresh?(error)
|
|
129
129
|
refreshed = ResolveOptions.new(offline: offline, refresh: true, environment: environment)
|
|
130
|
-
|
|
130
|
+
begin
|
|
131
|
+
resolve_project_with_options(manifest_path, refreshed)
|
|
132
|
+
rescue Error => retry_error
|
|
133
|
+
raise GitRefresh.annotate_failed_refresh(
|
|
134
|
+
File.join(File.dirname(File.expand_path(manifest_path)), "Prayfile.lock"),
|
|
135
|
+
retry_error
|
|
136
|
+
)
|
|
137
|
+
end
|
|
131
138
|
else
|
|
132
139
|
raise
|
|
133
140
|
end
|
|
134
141
|
end
|
|
135
142
|
|
|
136
143
|
def resolution_may_benefit_from_git_source_refresh?(error)
|
|
137
|
-
|
|
144
|
+
GitRefresh.resolution_may_benefit_from_git_source_refresh?(error)
|
|
138
145
|
end
|
|
139
146
|
|
|
140
147
|
def missing_local_embed_guidance(path)
|
|
@@ -228,14 +235,23 @@ module Pray
|
|
|
228
235
|
clone_url = source.url.delete_prefix("git+")
|
|
229
236
|
distribution_root = GitSources.resolve_distribution_root(checkout.cache_directory, checkout.subdir)
|
|
230
237
|
source_key = checkout.revision.to_s.empty? ? clone_url : "#{clone_url}@#{checkout.revision}"
|
|
231
|
-
resolved =
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
238
|
+
resolved = begin
|
|
239
|
+
Registry.resolve_local_registry_package_root(
|
|
240
|
+
project_root,
|
|
241
|
+
source_key,
|
|
242
|
+
distribution_root,
|
|
243
|
+
declaration,
|
|
244
|
+
preferred_version: lockfile_preferred_version(lockfile, declaration.name),
|
|
245
|
+
offline: offline
|
|
246
|
+
)
|
|
247
|
+
rescue Error => error
|
|
248
|
+
raise GitRefresh.annotate_missing_git_catalog(
|
|
249
|
+
error,
|
|
250
|
+
package_name: declaration.name,
|
|
251
|
+
source_name: source.name,
|
|
252
|
+
revision: checkout.revision
|
|
253
|
+
)
|
|
254
|
+
end
|
|
239
255
|
return [resolved.root, resolved.registry_latest_version]
|
|
240
256
|
else
|
|
241
257
|
raise Error.unsupported("source kind #{source.kind} not implemented yet")
|
data/lib/pray/version.rb
CHANGED
data/lib/pray.rb
CHANGED
|
@@ -22,6 +22,7 @@ require_relative "pray/resolve_context"
|
|
|
22
22
|
require_relative "pray/resolve_source"
|
|
23
23
|
require_relative "pray/resolve_exports"
|
|
24
24
|
require_relative "pray/invocation"
|
|
25
|
+
require_relative "pray/git_refresh"
|
|
25
26
|
require_relative "pray/resolve"
|
|
26
27
|
require_relative "pray/compose_dest"
|
|
27
28
|
require_relative "pray/render_patch"
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: pray-cli
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.12.
|
|
4
|
+
version: 1.12.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Andrei Makarov
|
|
@@ -130,6 +130,7 @@ files:
|
|
|
130
130
|
- lib/pray/error.rb
|
|
131
131
|
- lib/pray/format_manifest.rb
|
|
132
132
|
- lib/pray/format_serialize.rb
|
|
133
|
+
- lib/pray/git_refresh.rb
|
|
133
134
|
- lib/pray/git_sources.rb
|
|
134
135
|
- lib/pray/hashing.rb
|
|
135
136
|
- lib/pray/http_body.rb
|