sase-github 0.1.5__tar.gz → 0.1.6__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 (37) hide show
  1. sase_github-0.1.6/.release-please-manifest.json +3 -0
  2. {sase_github-0.1.5 → sase_github-0.1.6}/CHANGELOG.md +12 -0
  3. {sase_github-0.1.5 → sase_github-0.1.6}/PKG-INFO +1 -1
  4. {sase_github-0.1.5 → sase_github-0.1.6}/README.md +1 -1
  5. {sase_github-0.1.5 → sase_github-0.1.6}/docs/configuration.md +1 -1
  6. {sase_github-0.1.5 → sase_github-0.1.6}/pyproject.toml +1 -1
  7. {sase_github-0.1.5 → sase_github-0.1.6}/src/sase_github/workspace_plugin.py +8 -2
  8. {sase_github-0.1.5 → sase_github-0.1.6}/tests/test_workspace_plugin.py +68 -0
  9. sase_github-0.1.5/.release-please-manifest.json +0 -3
  10. {sase_github-0.1.5 → sase_github-0.1.6}/.github/workflows/ci.yml +0 -0
  11. {sase_github-0.1.5 → sase_github-0.1.6}/.github/workflows/pr-title.yml +0 -0
  12. {sase_github-0.1.5 → sase_github-0.1.6}/.github/workflows/publish.yml +0 -0
  13. {sase_github-0.1.5 → sase_github-0.1.6}/.sase_beads/beads.db +0 -0
  14. {sase_github-0.1.5 → sase_github-0.1.6}/.sase_beads/config.json +0 -0
  15. {sase_github-0.1.5 → sase_github-0.1.6}/.sase_beads/issues.jsonl +0 -0
  16. {sase_github-0.1.5 → sase_github-0.1.6}/CLAUDE.md +0 -0
  17. {sase_github-0.1.5 → sase_github-0.1.6}/Justfile +0 -0
  18. {sase_github-0.1.5 → sase_github-0.1.6}/LICENSE +0 -0
  19. {sase_github-0.1.5 → sase_github-0.1.6}/docs/architecture.md +0 -0
  20. {sase_github-0.1.5 → sase_github-0.1.6}/docs/xprompts.md +0 -0
  21. {sase_github-0.1.5 → sase_github-0.1.6}/release-please-config.json +0 -0
  22. {sase_github-0.1.5 → sase_github-0.1.6}/src/sase_github/__init__.py +0 -0
  23. {sase_github-0.1.5 → sase_github-0.1.6}/src/sase_github/config.py +0 -0
  24. {sase_github-0.1.5 → sase_github-0.1.6}/src/sase_github/default_config.yml +0 -0
  25. {sase_github-0.1.5 → sase_github-0.1.6}/src/sase_github/plugin.py +0 -0
  26. {sase_github-0.1.5 → sase_github-0.1.6}/src/sase_github/scripts/__init__.py +0 -0
  27. {sase_github-0.1.5 → sase_github-0.1.6}/src/sase_github/scripts/gh_setup.py +0 -0
  28. {sase_github-0.1.5 → sase_github-0.1.6}/src/sase_github/scripts/new_pr_desc_get_context.py +0 -0
  29. {sase_github-0.1.5 → sase_github-0.1.6}/src/sase_github/xprompts/gh.yml +0 -0
  30. {sase_github-0.1.5 → sase_github-0.1.6}/src/sase_github/xprompts/new_pr_desc.yml +0 -0
  31. {sase_github-0.1.5 → sase_github-0.1.6}/src/sase_github/xprompts/pr_diff.yml +0 -0
  32. {sase_github-0.1.5 → sase_github-0.1.6}/src/sase_github/xprompts/prdd.yml +0 -0
  33. {sase_github-0.1.5 → sase_github-0.1.6}/tests/__init__.py +0 -0
  34. {sase_github-0.1.5 → sase_github-0.1.6}/tests/test_config.py +0 -0
  35. {sase_github-0.1.5 → sase_github-0.1.6}/tests/test_github_plugin.py +0 -0
  36. {sase_github-0.1.5 → sase_github-0.1.6}/tests/test_submit_with_recorded_pr.py +0 -0
  37. {sase_github-0.1.5 → sase_github-0.1.6}/uv.lock +0 -0
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.1.6"
3
+ }
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.1.6](https://github.com/sase-org/sase-github/compare/v0.1.5...v0.1.6) (2026-07-02)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * report closed GitHub PRs in submitted checks ([5ad2168](https://github.com/sase-org/sase-github/commit/5ad2168c1e36cca4b39e4435fff3076f3492dfb5))
9
+
10
+
11
+ ### Documentation
12
+
13
+ * drop `--python 3.12` pin from install commands ([4ecc344](https://github.com/sase-org/sase-github/commit/4ecc344987dd7609996d8ee9040a31e4adb7bb96))
14
+
3
15
  ## [0.1.5](https://github.com/sase-org/sase-github/compare/v0.1.4...v0.1.5) (2026-07-01)
4
16
 
5
17
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sase-github
3
- Version: 0.1.5
3
+ Version: 0.1.6
4
4
  Summary: GitHub VCS plugin for sase
5
5
  License-Expression: MIT
6
6
  License-File: LICENSE
@@ -30,7 +30,7 @@ and [`sase plugin` commands](https://github.com/sase-org/sase/blob/master/docs/p
30
30
  ### Alternative: install SASE and the plugin together
31
31
 
32
32
  ```bash
33
- uv tool install sase --python 3.12 --with sase-github
33
+ uv tool install sase --with sase-github
34
34
  ```
35
35
 
36
36
  Repeat `--with` for additional plugins, for example `--with sase-github --with sase-telegram`. Add `--force` to replace
@@ -6,7 +6,7 @@ Use this checklist for GitHub Enterprise Server or another self-hosted GitHub ho
6
6
 
7
7
  1. **Install SASE and `sase-github`.** Use the
8
8
  [README installation routes](../README.md#installation): the SASE Admin Center Updates tab is the recommended path
9
- for an existing managed install, while `uv tool install sase --python 3.12 --with sase-github` installs SASE and the
9
+ for an existing managed install, while `uv tool install sase --with sase-github` installs SASE and the
10
10
  plugin together. The core SASE [plugin docs](https://github.com/sase-org/sase/blob/master/docs/plugins.md) also cover
11
11
  `sase plugin install github` for existing installs.
12
12
  2. **Authenticate `gh` to the Enterprise host.**
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "sase-github"
7
- version = "0.1.5"
7
+ version = "0.1.6"
8
8
  description = "GitHub VCS plugin for sase"
9
9
  requires-python = ">=3.12"
10
10
  license = "MIT"
@@ -108,12 +108,18 @@ class GitHubWorkspacePlugin:
108
108
  def ws_generate_submitted_check_script(
109
109
  self, identifier: str, vcs_type: str
110
110
  ) -> str | None:
111
- """Generate script to check if a GitHub PR is merged."""
111
+ """Generate script to check if a GitHub PR is merged or closed."""
112
112
  if vcs_type != "git":
113
113
  return None
114
114
  return (
115
115
  f"state=$(gh pr view {identifier} --json state -q '.state' 2>/dev/null)\n"
116
- f'[ "$state" = "MERGED" ]'
116
+ 'echo "PR state: ${state:-<unavailable>}"\n'
117
+ 'case "$state" in\n'
118
+ " MERGED) true ;;\n"
119
+ " # Keep this literal in sync with SUBMITTED_CHECK_EXIT_CODE_CLOSED.\n"
120
+ " CLOSED) (exit 20) ;;\n"
121
+ " *) false ;;\n"
122
+ "esac"
117
123
  )
118
124
 
119
125
  @hookimpl
@@ -1,11 +1,13 @@
1
1
  """Tests for sase_github.workspace_plugin module (GitHub-specific functions)."""
2
2
 
3
3
  import os
4
+ import subprocess
4
5
  import tempfile
5
6
  from pathlib import Path
6
7
  from unittest.mock import MagicMock, patch
7
8
 
8
9
  import pytest
10
+ from sase.workspace_provider import SUBMITTED_CHECK_EXIT_CODE_CLOSED
9
11
 
10
12
  from sase_github.workspace_plugin import (
11
13
  GitHubWorkspacePlugin,
@@ -37,12 +39,78 @@ def _home_patches(home: Path) -> tuple[object, object]:
37
39
  )
38
40
 
39
41
 
42
+ def _run_submitted_check_script(
43
+ tmp_path: Path, gh_body: str
44
+ ) -> subprocess.CompletedProcess[str]:
45
+ bin_dir = tmp_path / "bin"
46
+ bin_dir.mkdir()
47
+ gh = bin_dir / "gh"
48
+ gh.write_text(f"#!/bin/bash\n{gh_body}\n", encoding="utf-8")
49
+ gh.chmod(0o755)
50
+
51
+ script = GitHubWorkspacePlugin().ws_generate_submitted_check_script("42", "git")
52
+ assert script is not None
53
+
54
+ script_path = tmp_path / "check.sh"
55
+ script_path.write_text(f"#!/bin/bash\n{script}\n", encoding="utf-8")
56
+ script_path.chmod(0o755)
57
+
58
+ env = {
59
+ **os.environ,
60
+ "PATH": f"{bin_dir}:{os.environ['PATH']}",
61
+ }
62
+ return subprocess.run(
63
+ [str(script_path)],
64
+ capture_output=True,
65
+ text=True,
66
+ check=False,
67
+ env=env,
68
+ )
69
+
70
+
40
71
  @pytest.fixture(autouse=True)
41
72
  def _default_github_host() -> object:
42
73
  with patch("sase_github.config.get_default_github_host", return_value="github.com"):
43
74
  yield
44
75
 
45
76
 
77
+ @pytest.mark.parametrize(
78
+ ("gh_body", "expected_code", "expected_state"),
79
+ [
80
+ ("printf 'MERGED\\n'", 0, "MERGED"),
81
+ ("printf 'CLOSED\\n'", SUBMITTED_CHECK_EXIT_CODE_CLOSED, "CLOSED"),
82
+ ("printf 'OPEN\\n'", 1, "OPEN"),
83
+ ("exit 2", 1, "<unavailable>"),
84
+ ],
85
+ )
86
+ def test_submitted_check_script_reports_pr_state(
87
+ tmp_path: Path,
88
+ gh_body: str,
89
+ expected_code: int,
90
+ expected_state: str,
91
+ ) -> None:
92
+ result = _run_submitted_check_script(tmp_path, gh_body)
93
+
94
+ assert result.returncode == expected_code
95
+ assert f"PR state: {expected_state}" in result.stdout
96
+
97
+
98
+ def test_submitted_check_script_has_no_bare_exit_statement() -> None:
99
+ script = GitHubWorkspacePlugin().ws_generate_submitted_check_script("42", "git")
100
+ assert script is not None
101
+
102
+ for line in script.splitlines():
103
+ stripped = line.strip()
104
+ assert stripped != "exit"
105
+ assert not stripped.startswith("exit ")
106
+
107
+
108
+ def test_submitted_check_closed_literal_matches_sase_contract() -> None:
109
+ script = GitHubWorkspacePlugin().ws_generate_submitted_check_script("42", "git")
110
+ assert script is not None
111
+ assert f"(exit {SUBMITTED_CHECK_EXIT_CODE_CLOSED})" in script
112
+
113
+
46
114
  class TestHostAwareWorkspace:
47
115
  def test_github_com_workspace_path_is_unchanged(self) -> None:
48
116
  with tempfile.TemporaryDirectory() as d:
@@ -1,3 +0,0 @@
1
- {
2
- ".": "0.1.5"
3
- }
File without changes
File without changes
File without changes
File without changes