opsscript-gate 0.9.2__tar.gz → 0.9.5__tar.gz

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.
Files changed (67) hide show
  1. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/.github/workflow-templates/opsscript-gate.yml +1 -1
  2. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/.github/workflows/deploy-pages.yml +2 -0
  3. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/.github/workflows/release.yml +2 -1
  4. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/.gitignore +1 -0
  5. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/CHANGELOG.md +32 -1
  6. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/PKG-INFO +12 -7
  7. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/README.md +10 -6
  8. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/README.zh-CN.md +4 -4
  9. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/action.yml +17 -1
  10. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/docs/command-not-found.html +2 -1
  11. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5/docs}/index.html +49 -164
  12. opsscript_gate-0.9.5/docs/installer-smoke-test.html +73 -0
  13. opsscript_gate-0.9.5/docs/installer-smoke-test.md +55 -0
  14. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5/docs}/llms.txt +1 -0
  15. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/docs/sitemap.xml +1 -0
  16. opsscript_gate-0.9.5/examples/github-actions/README.md +11 -0
  17. opsscript_gate-0.9.5/examples/github-actions/installer-smoke.yml +54 -0
  18. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/examples/github-actions/workflow.yml +1 -1
  19. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/pyproject.toml +2 -1
  20. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/src/opsscript_gate/__init__.py +1 -1
  21. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/src/opsscript_gate/cli.py +26 -1
  22. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/src/opsscript_gate/config.py +1 -1
  23. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/src/opsscript_gate/discovery.py +15 -7
  24. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/src/opsscript_gate/models.py +27 -4
  25. opsscript_gate-0.9.5/src/opsscript_gate/remediation.py +260 -0
  26. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/src/opsscript_gate/reporter.py +45 -16
  27. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/src/opsscript_gate/runner.py +269 -107
  28. opsscript_gate-0.9.5/tests/conftest.py +17 -0
  29. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/tests/test_action_contract.py +3 -0
  30. opsscript_gate-0.9.5/tests/test_audit_coverage.py +723 -0
  31. opsscript_gate-0.9.5/tests/test_installer_example.py +76 -0
  32. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/tests/test_runner.py +94 -0
  33. opsscript_gate-0.9.2/.ai/v0.9.2_issues_report.md +0 -90
  34. opsscript_gate-0.9.2/examples/github-actions/README.md +0 -5
  35. opsscript_gate-0.9.2/src/opsscript_gate/remediation.py +0 -161
  36. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/.gitattributes +0 -0
  37. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
  38. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/.github/ISSUE_TEMPLATE/distro_request.yml +0 -0
  39. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
  40. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/.github/assets/social-preview.png +0 -0
  41. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/.github/pull_request_template.md +0 -0
  42. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/.github/workflow-templates/opsscript-gate.properties.json +0 -0
  43. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/.github/workflows/demo.yml +0 -0
  44. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/.github/workflows/test.yml +0 -0
  45. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/CITATION.cff +0 -0
  46. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/CONTRIBUTING.md +0 -0
  47. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/LICENSE +0 -0
  48. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/ROADMAP.md +0 -0
  49. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/SECURITY.md +0 -0
  50. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/demo.html +0 -0
  51. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/docs/command-not-found.md +0 -0
  52. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/docs/configuration.md +0 -0
  53. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/docs/gpt-oss.md +0 -0
  54. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/docs/robots.txt +0 -0
  55. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/docs/troubleshooting.md +0 -0
  56. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/examples/alpine-incompatibility/README.md +0 -0
  57. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/examples/alpine-incompatibility/apt_dependency.sh +0 -0
  58. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/examples/basic/README.md +0 -0
  59. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/examples/basic/clean_setup.sh +0 -0
  60. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/examples/interactive-hang/README.md +0 -0
  61. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/examples/interactive-hang/prompt_confirm.sh +0 -0
  62. {opsscript_gate-0.9.2/docs → opsscript_gate-0.9.5}/index.html +0 -0
  63. {opsscript_gate-0.9.2/docs → opsscript_gate-0.9.5}/llms.txt +0 -0
  64. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/tests/fixtures/fail_deps.sh +0 -0
  65. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/tests/fixtures/fail_hang.sh +0 -0
  66. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/tests/fixtures/pass_basic.sh +0 -0
  67. {opsscript_gate-0.9.2 → opsscript_gate-0.9.5}/tests/test_onboarding.py +0 -0
@@ -25,7 +25,7 @@ jobs:
25
25
  persist-credentials: false
26
26
 
27
27
  - name: Run OpsScript Gate
28
- uses: Mresyzz/opsscript-gate@v0.9.2
28
+ uses: Mresyzz/opsscript-gate@v0.9.4
29
29
  with:
30
30
  shell: auto
31
31
  network: none
@@ -25,6 +25,8 @@ jobs:
25
25
  uses: actions/checkout@v4
26
26
  - name: Setup Pages
27
27
  uses: actions/configure-pages@v5
28
+ - name: Stage downloadable installer workflow
29
+ run: cp examples/github-actions/installer-smoke.yml docs/installer-smoke.yml
28
30
  - name: Upload artifact
29
31
  uses: actions/upload-pages-artifact@v3
30
32
  with:
@@ -128,7 +128,8 @@ jobs:
128
128
  echo "Tag $TARGET_TAG was released from earlier commit ($TAG_SHA != ${{ github.sha }}). Skipping release."
129
129
  fi
130
130
  else
131
- echo "Target tag $TARGET_TAG does not exist. Creating it and handing publication to the tag workflow."
131
+ echo "Target tag $TARGET_TAG does not exist. Creating tag and publishing release."
132
+ IS_NEW_RELEASE="true"
132
133
  SHOULD_TAG="true"
133
134
  fi
134
135
  else
@@ -50,3 +50,4 @@ venv.bak/
50
50
  *~
51
51
  .DS_Store
52
52
  Thumbs.db
53
+ .ai/
@@ -1,6 +1,37 @@
1
1
  # Changelog
2
2
 
3
- ## [0.9.2] - Unreleased
3
+ ## [0.9.5] - 2026-11-08
4
+
5
+ ### Added
6
+ - Extended structured failure diagnostics to handle exit code 126 (`permission_denied` and `exec_format_error`) and exit code 137 (`oom_killed`) with targeted remediation suggestions.
7
+ - Added native distribution family detection for Amazon Linux (`amazonlinux`, `amzn`) and Oracle Linux (`oracle`, `ol:`) to support RHEL-family package recommendations.
8
+ - Added GitHub Composite Action `outputs` for `all-passed` and `report-file`, exporting execution status via `$GITHUB_OUTPUT`.
9
+ - Surfaced package installation recommendations and package names directly in Markdown compatibility tables, failure diagnostic log drawers, and terminal detail outputs.
10
+ - Added convenient counting properties (`passed_count`, `failed_count`, `total_count`) on `RunReport` and `MultiScriptReport`.
11
+
12
+ ## [0.9.4] - 2026-10-11
13
+
14
+ ### Fixed
15
+ - Fixed release workflow publishing deadlock where `main` pushes skipped distribution package builds and release creation due to GITHUB_TOKEN tag events not triggering new workflows.
16
+ - Unified command path extraction in remediation rules to ensure full-path commands (e.g. `/usr/bin/apt-get`, `/sbin/apk`, `/bin/yum`, `/usr/local/bin/bash`) accurately match package manager and shell hints.
17
+ - Added native RHEL/Fedora/CentOS package mappings in `COMMON_COMMAND_PACKAGES` to prevent fallback to invalid Debian package names.
18
+ - Added native container package pre-installation support for `dnf`, `microdnf`, and `yum` in `runner._wrap_with_package_setup`.
19
+ - Fixed `RunReport` and `MultiScriptReport` `__post_init__` to preserve explicitly passed `all_passed=False` when result collections are empty.
20
+ - Supported bare directory exclusions (e.g. `tests` or `tests/`) in `_matches_exclude` to match both directories and all contained files.
21
+
22
+ ## [0.9.3] - 2026-10-11
23
+
24
+ ### Added
25
+ - Added cross-distribution package name mapping and actionable remediation suggestions (`apt-get`, `apk`, `dnf`) for common missing operations commands (`curl`, `wget`, `jq`, `git`, `tar`, `python3`, `pip`, `sudo`, `make`, `gcc`, etc.).
26
+ - Extended `FailureDiagnostic` and SARIF output with structured `suggested_package` property.
27
+
28
+ ### Fixed
29
+ - Fixed unreadable shell script candidate misclassification during discovery.
30
+ - Ensured temporary script files are safely cleaned up during distribution preparation errors.
31
+ - Added preflight validation to reject directory and missing script paths before creating worker threads.
32
+ - Enforced consistent POSIX LF line endings in report output files across platforms.
33
+
34
+ ## [0.9.2] - 2026-10-05
4
35
 
5
36
  ### Fixed
6
37
  - Hardened SARIF, Markdown, terminal, and machine-readable output handling.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: opsscript-gate
3
- Version: 0.9.2
3
+ Version: 0.9.5
4
4
  Summary: Cross-distro shell script compatibility and portability checker for Debian, Ubuntu, and Alpine. Runs real containers to diagnose command not found.
5
5
  Project-URL: Homepage, https://mresyzz.github.io/opsscript-gate/
6
6
  Project-URL: Demo, https://mresyzz.github.io/opsscript-gate/
@@ -28,6 +28,7 @@ Requires-Dist: docker>=7.0.0
28
28
  Provides-Extra: test
29
29
  Requires-Dist: markdown-it-py>=3.0.0; extra == 'test'
30
30
  Requires-Dist: pytest>=8.0.0; extra == 'test'
31
+ Requires-Dist: pyyaml>=6.0.0; extra == 'test'
31
32
  Description-Content-Type: text/markdown
32
33
 
33
34
  # OpsScript Gate — cross-distro shell script runtime compatibility checker
@@ -80,7 +81,7 @@ apt-get --version
80
81
  Run it locally with `opsscript-gate run ./install.sh`, or add the following step to CI:
81
82
 
82
83
  ```yaml
83
- - uses: Mresyzz/opsscript-gate@v0.9.2
84
+ - uses: Mresyzz/opsscript-gate@v0.9.4
84
85
  with:
85
86
  script-path: install.sh
86
87
  ```
@@ -89,7 +90,7 @@ The result identifies the failing distribution, exit code, line, missing command
89
90
 
90
91
  ---
91
92
 
92
- ## Current version: v0.9.2 (local candidate)
93
+ ## Current release: v0.9.4
93
94
 
94
95
  The current release includes a project config file, a dry-run plan, presets, exclusions,
95
96
  saved reports, changed-script selection for pull requests, and repeat runs for detecting
@@ -119,6 +120,10 @@ image's native package manager before testing. Package setup is opt-in and
119
120
  requires bridge networking. See [configuration and migration](docs/configuration.md) and
120
121
  [why a shell script works on Ubuntu but fails on Alpine](docs/troubleshooting.md).
121
122
 
123
+ Testing an installer? Use the [installation smoke test workflow](docs/installer-smoke-test.md)
124
+ to check the installed binary inside each container. A script's zero exit status
125
+ alone does not prove it installed successfully.
126
+
122
127
  ## Quickstart
123
128
 
124
129
  ### In GitHub Actions
@@ -143,7 +148,7 @@ jobs:
143
148
  - uses: actions/checkout@v7
144
149
  with:
145
150
  persist-credentials: false
146
- - uses: Mresyzz/opsscript-gate@v0.9.2
151
+ - uses: Mresyzz/opsscript-gate@v0.9.4
147
152
  ```
148
153
 
149
154
  This zero-configuration form discovers shell scripts in the repository. Use
@@ -154,7 +159,7 @@ repository has a single installer. For self-hosted model installers, see the
154
159
  Or test a specific script with custom execution modes:
155
160
 
156
161
  ```yaml
157
- - uses: Mresyzz/opsscript-gate@v0.9.2
162
+ - uses: Mresyzz/opsscript-gate@v0.9.4
158
163
  with:
159
164
  script-path: scripts/install.sh
160
165
  shell: auto
@@ -188,7 +193,7 @@ unrelated scripts:
188
193
  with:
189
194
  persist-credentials: false
190
195
  fetch-depth: 0
191
- - uses: Mresyzz/opsscript-gate@v0.9.2
196
+ - uses: Mresyzz/opsscript-gate@v0.9.4
192
197
  with:
193
198
  changed-since: ${{ github.event.pull_request.base.sha }}
194
199
  preset: minimal
@@ -279,7 +284,7 @@ Use `sarif` when the result should appear in GitHub Code Scanning or another
279
284
  SARIF-compatible viewer. Upload it explicitly with the official upload action:
280
285
 
281
286
  ```yaml
282
- - uses: Mresyzz/opsscript-gate@v0.9.2
287
+ - uses: Mresyzz/opsscript-gate@v0.9.4
283
288
  with:
284
289
  script-path: scripts/install.sh
285
290
  format: sarif
@@ -48,7 +48,7 @@ apt-get --version
48
48
  Run it locally with `opsscript-gate run ./install.sh`, or add the following step to CI:
49
49
 
50
50
  ```yaml
51
- - uses: Mresyzz/opsscript-gate@v0.9.2
51
+ - uses: Mresyzz/opsscript-gate@v0.9.4
52
52
  with:
53
53
  script-path: install.sh
54
54
  ```
@@ -57,7 +57,7 @@ The result identifies the failing distribution, exit code, line, missing command
57
57
 
58
58
  ---
59
59
 
60
- ## Current version: v0.9.2 (local candidate)
60
+ ## Current release: v0.9.4
61
61
 
62
62
  The current release includes a project config file, a dry-run plan, presets, exclusions,
63
63
  saved reports, changed-script selection for pull requests, and repeat runs for detecting
@@ -87,6 +87,10 @@ image's native package manager before testing. Package setup is opt-in and
87
87
  requires bridge networking. See [configuration and migration](docs/configuration.md) and
88
88
  [why a shell script works on Ubuntu but fails on Alpine](docs/troubleshooting.md).
89
89
 
90
+ Testing an installer? Use the [installation smoke test workflow](docs/installer-smoke-test.md)
91
+ to check the installed binary inside each container. A script's zero exit status
92
+ alone does not prove it installed successfully.
93
+
90
94
  ## Quickstart
91
95
 
92
96
  ### In GitHub Actions
@@ -111,7 +115,7 @@ jobs:
111
115
  - uses: actions/checkout@v7
112
116
  with:
113
117
  persist-credentials: false
114
- - uses: Mresyzz/opsscript-gate@v0.9.2
118
+ - uses: Mresyzz/opsscript-gate@v0.9.4
115
119
  ```
116
120
 
117
121
  This zero-configuration form discovers shell scripts in the repository. Use
@@ -122,7 +126,7 @@ repository has a single installer. For self-hosted model installers, see the
122
126
  Or test a specific script with custom execution modes:
123
127
 
124
128
  ```yaml
125
- - uses: Mresyzz/opsscript-gate@v0.9.2
129
+ - uses: Mresyzz/opsscript-gate@v0.9.4
126
130
  with:
127
131
  script-path: scripts/install.sh
128
132
  shell: auto
@@ -156,7 +160,7 @@ unrelated scripts:
156
160
  with:
157
161
  persist-credentials: false
158
162
  fetch-depth: 0
159
- - uses: Mresyzz/opsscript-gate@v0.9.2
163
+ - uses: Mresyzz/opsscript-gate@v0.9.4
160
164
  with:
161
165
  changed-since: ${{ github.event.pull_request.base.sha }}
162
166
  preset: minimal
@@ -247,7 +251,7 @@ Use `sarif` when the result should appear in GitHub Code Scanning or another
247
251
  SARIF-compatible viewer. Upload it explicitly with the official upload action:
248
252
 
249
253
  ```yaml
250
- - uses: Mresyzz/opsscript-gate@v0.9.2
254
+ - uses: Mresyzz/opsscript-gate@v0.9.4
251
255
  with:
252
256
  script-path: scripts/install.sh
253
257
  format: sarif
@@ -17,9 +17,9 @@ Bash 依赖、包管理器假设和交互式阻塞。它与 ShellCheck 互补。
17
17
 
18
18
  也可以直接打开 [OpsScript Gate 在线演示](https://mresyzz.github.io/opsscript-gate/),先查看 ShellCheck 与运行时验证的差异,再复制 workflow 到自己的仓库。
19
19
 
20
- ## 当前版本 v0.9.2
20
+ ## 当前版本 v0.9.4
21
21
 
22
- v0.9.2 是当前本地候选版本;如果你要从源码验证当前分支,也可以执行:
22
+ v0.9.4 是当前已发布版本;如果你要从源码验证当前分支,也可以执行:
23
23
 
24
24
  ```bash
25
25
  pip install -e .
@@ -35,7 +35,7 @@ opsscript-gate run --dry-run
35
35
  opsscript-gate run --format json --output reports/compatibility.json
36
36
  ```
37
37
 
38
- `init` 生成配置和 GitHub 工作流,不覆盖已有文件。工作流引用 `v0.9.2`。
38
+ `init` 生成配置和 GitHub 工作流,不覆盖已有文件。工作流引用 `v0.9.4`。
39
39
  预览不需要 Docker;真实运行需要 Python 3.10+
40
40
  和可访问的 Linux Docker 引擎。
41
41
  `opsscript-gate doctor` 可以在真实运行前检查 Python 和 Docker。
@@ -74,7 +74,7 @@ Docker daemon 和可选的项目配置。
74
74
  - uses: actions/checkout@v7
75
75
  with:
76
76
  fetch-depth: 0
77
- - uses: Mresyzz/opsscript-gate@v0.9.2
77
+ - uses: Mresyzz/opsscript-gate@v0.9.4
78
78
  with:
79
79
  changed-since: ${{ github.event.pull_request.base.sha }}
80
80
  preset: minimal
@@ -80,6 +80,14 @@ inputs:
80
80
  required: false
81
81
  default: ''
82
82
 
83
+ outputs:
84
+ all-passed:
85
+ description: 'Whether all script compatibility checks passed (true or false)'
86
+ value: ${{ steps.gate.outputs.all-passed }}
87
+ report-file:
88
+ description: 'Path to saved report file if output input was set'
89
+ value: ${{ inputs.output }}
90
+
83
91
  runs:
84
92
  using: 'composite'
85
93
  steps:
@@ -94,6 +102,7 @@ runs:
94
102
  pip install "${{ github.action_path }}"
95
103
 
96
104
  - name: Run compatibility gate
105
+ id: gate
97
106
  shell: bash
98
107
  env:
99
108
  INPUT_SCRIPT_PATH: ${{ inputs.script-path }}
@@ -146,4 +155,11 @@ runs:
146
155
  echo "dry-run must be true or false" >&2
147
156
  exit 1
148
157
  fi
149
- python -m opsscript_gate.cli "${ARGS[@]}"
158
+ GATE_STATUS=0
159
+ python -m opsscript_gate.cli "${ARGS[@]}" || GATE_STATUS=$?
160
+ if [ "$GATE_STATUS" -eq 0 ]; then
161
+ echo "all-passed=true" >> "$GITHUB_OUTPUT"
162
+ else
163
+ echo "all-passed=false" >> "$GITHUB_OUTPUT"
164
+ fi
165
+ exit "$GATE_STATUS"
@@ -134,7 +134,7 @@ jobs:
134
134
  - uses: actions/checkout@v7
135
135
  with:
136
136
  persist-credentials: false
137
- - uses: Mresyzz/opsscript-gate@v0.9.2
137
+ - uses: Mresyzz/opsscript-gate@v0.9.4
138
138
  with:
139
139
  script-path: install.sh
140
140
  shell: auto
@@ -186,6 +186,7 @@ opsscript-gate run ./install.sh</code></pre>
186
186
  <a href="https://github.com/Mresyzz/opsscript-gate/blob/main/docs/troubleshooting.md">troubleshooting</a>,
187
187
  or <a href="https://github.com/Mresyzz/opsscript-gate/blob/main/SECURITY.md">security boundaries</a>.
188
188
  <a href="./">Open the interactive demo</a>.</footer>
189
+ <p>Installer returns zero but the program is missing? <a href="installer-smoke-test.html">Verify the installed binary in the same container.</a></p>
189
190
  </main>
190
191
  </body>
191
192
  </html>