net-connector 0.7.0 → 0.7.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 +6 -0
- data/docs/RELEASING.md +11 -8
- data/lib/net/connector/engine/transport.rb +20 -4
- data/lib/net/connector/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c770140c105728adde0de8c391e63b3395b9b510f952a79aa765f908392025ce
|
|
4
|
+
data.tar.gz: 1caefb941516cb4952a9cab5c5ff3fe923be7f6874dac1949ddfd737357adeee
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3599fed38a8898c826829ab5c93d7655d7f56ee64951eb5acbe6956c8c1f505e7db21de4f4fabd90978ae615831f7815641c6319d9cf2e6033db238195fbe467
|
|
7
|
+
data.tar.gz: 67c5750fd3da6e098bab3f4e3b5bbc28af323335cebc2874526334ff23672b0d528dea08ba714c883a4bdec66e0eb64baeb193bd90bdf4e8eb7e0e99cfdda02d
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## 未发布
|
|
4
4
|
|
|
5
|
+
## 0.7.1 - 2026-10-05
|
|
6
|
+
|
|
7
|
+
- 兼容 expect-pty 0.7 的 Session、expect 与 transcript 接口,保留旧版和输出限额语义。
|
|
8
|
+
|
|
9
|
+
- 版本标签触发 RubyGems OIDC 可信发布,不再依赖静态 `RUBYGEMS_API_KEY` Secret;保留完整 CI 矩阵、原始产物发布、敏感信息扫描和 GitHub/RubyGems SHA256 回读校验。
|
|
10
|
+
|
|
5
11
|
## 0.7.0 - 2026-09-28
|
|
6
12
|
|
|
7
13
|
- 统一内部参数、预算和声明校验的 `validate_*!` 命名;区分脚本发送前与响应后的预算检查,复用并发预检,简化状态计数并补充值对象复制边界测试。保持本轮增量重构的公开接口、错误及完成证据语义。
|
data/docs/RELEASING.md
CHANGED
|
@@ -56,16 +56,19 @@ ruby script/release.rb --artifact /path/to/verified/net-connector-X.Y.Z.gem
|
|
|
56
56
|
|
|
57
57
|
## GitHub Actions 发布
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
Runner 不继承本机 RubyGems 登录。GitHub 操作使用工作流自带的 token。
|
|
59
|
+
Actions 使用 RubyGems Trusted Publishing,通过 GitHub OIDC 交换短期发布凭据,不再需要仓库的 `RUBYGEMS_API_KEY` Secret。
|
|
61
60
|
|
|
62
|
-
|
|
63
|
-
`
|
|
64
|
-
|
|
65
|
-
gem,再执行 `--artifact`;发布阶段不重新构建。
|
|
61
|
+
首次在 [net-connector 的 Trusted publishers 页面](https://rubygems.org/gems/net-connector/trusted_publishers)
|
|
62
|
+
创建 GitHub Actions 发布者:Repository owner 为 `gatework`,Repository name 为 `net-connector`,Workflow filename 为
|
|
63
|
+
`release.yml`。可将 Environment 限定为 `release`;工作流始终使用该环境。需要审批时,在 GitHub 仓库 Settings → Environments 中配置。
|
|
66
64
|
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
提交和推送版本修改后,推送对应的 `vX.Y.Z` 标签会自动触发 Release。也可在 Actions → Release → Run workflow 选择同一版本标签恢复失败任务。
|
|
66
|
+
只允许标签与 Gem 版本一致且说明已归档的发布。避免本地与 Actions 同时上传同一版本,优先使用标签工作流。
|
|
67
|
+
|
|
68
|
+
工作流先复用完整 CI 矩阵,全部通过后下载 Ubuntu / Ruby 4.0 验证的同一个 Gem,配置 OIDC 凭据并执行 `--artifact`;
|
|
69
|
+
发布阶段不重新构建,源码、历史、包的敏感信息扫描及 SHA256 回读继续生效。
|
|
70
|
+
|
|
71
|
+
没有匹配的可信发布者时,OIDC 交换会失败;先补齐 RubyGems 配置再恢复原包发布。本地脚本仍使用既有 Gem 登录和 MFA。
|
|
69
72
|
|
|
70
73
|
## 失败后重试
|
|
71
74
|
|
|
@@ -41,14 +41,29 @@ module Net
|
|
|
41
41
|
@channel = if @channel_factory
|
|
42
42
|
@channel_factory.call
|
|
43
43
|
else
|
|
44
|
-
Expect
|
|
44
|
+
if defined?(Expect::Session)
|
|
45
|
+
Expect::Session.new(buffer_limit: nil, write_timeout: configuration.write_timeout)
|
|
46
|
+
else
|
|
47
|
+
Expect.new(raw_pty: true, reset_timeout_on_read: false, buffer_limit: nil,
|
|
45
48
|
preserve_buffer: false, log_stdout: false, log_listeners: false,
|
|
46
49
|
debug_level: 0, write_timeout: configuration.write_timeout)
|
|
50
|
+
end
|
|
47
51
|
end
|
|
48
52
|
# Profile 使用宽、高;PTY 使用行数、列数。
|
|
49
53
|
@channel.slave.winsize = @terminal_size.reverse if @terminal_size
|
|
50
|
-
@channel.
|
|
51
|
-
|
|
54
|
+
if @channel.respond_to?(:transcript=)
|
|
55
|
+
writer = Object.new
|
|
56
|
+
callback = method(:write_log_output)
|
|
57
|
+
writer.define_singleton_method(:write) do |bytes|
|
|
58
|
+
callback.call(bytes)
|
|
59
|
+
bytes.bytesize
|
|
60
|
+
end
|
|
61
|
+
@channel.transcript = writer
|
|
62
|
+
@channel.spawn(*argv, raw: true)
|
|
63
|
+
else
|
|
64
|
+
@channel.log_output = method(:write_log_output)
|
|
65
|
+
@channel.spawn(*argv)
|
|
66
|
+
end
|
|
52
67
|
self
|
|
53
68
|
rescue Exception # rubocop:disable Lint/RescueException -- A half-open PTY must be released on interrupts.
|
|
54
69
|
begin
|
|
@@ -61,7 +76,8 @@ module Net
|
|
|
61
76
|
|
|
62
77
|
# 从信道读取下一事件,并把字符串字段转换为字节字符串。
|
|
63
78
|
def read(patterns, timeout:)
|
|
64
|
-
|
|
79
|
+
reader = @channel.respond_to?(:expect_result) ? :expect_result : :expect
|
|
80
|
+
result = @channel.public_send(reader, *patterns, STREAM, timeout: timeout)
|
|
65
81
|
Event.new(index: result.number && (result.number - 1), before: result.before.to_s.b,
|
|
66
82
|
match: result.match.to_s.b, error: result.error)
|
|
67
83
|
end
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: net-connector
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.7.
|
|
4
|
+
version: 0.7.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- net-connector contributors
|
|
8
8
|
bindir: exe
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-
|
|
10
|
+
date: 2026-10-05 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: expect-pty
|