mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-04 10:07:28 +01:00
release notes: test that a changed-file path keeps its spaces
pr_files moves to module level so the test can stub gh; main keeps the failure tracking around it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a957802c6d
commit
f400a0c696
2 files changed
+14
-4
No files matched your search
@@ -264,6 +264,10 @@ def gh(*args, stdin=None):
|
||||
return subprocess.run(["gh", *args], input=stdin, capture_output=True, text=True, check=True).stdout
|
||||
|
||||
|
||||
def pr_files(repo, num):
|
||||
return gh("pr", "view", str(num), "-R", repo, "--json", "files", "--jq", ".files[].path").splitlines()
|
||||
|
||||
|
||||
def main():
|
||||
ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
|
||||
ap.add_argument("--repo", default="seaweedfs/seaweedfs")
|
||||
@@ -275,17 +279,16 @@ def main():
|
||||
|
||||
failed = []
|
||||
|
||||
def pr_files(num):
|
||||
def files_of(num):
|
||||
try:
|
||||
out = gh("pr", "view", str(num), "-R", args.repo, "--json", "files", "--jq", ".files[].path")
|
||||
return pr_files(args.repo, num)
|
||||
except subprocess.CalledProcessError as e:
|
||||
print("warning: files of #%d: %s" % (num, e.stderr.strip()), file=sys.stderr)
|
||||
failed.append(num)
|
||||
return []
|
||||
return out.splitlines()
|
||||
|
||||
try:
|
||||
notes = regroup(body, pr_files)
|
||||
notes = regroup(body, files_of)
|
||||
except ValueError as e:
|
||||
sys.exit("release %s: %s" % (args.tag, e))
|
||||
sys.stdout.write(notes)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import importlib.util
|
||||
from pathlib import Path
|
||||
import unittest
|
||||
from unittest import mock
|
||||
|
||||
|
||||
def load():
|
||||
@@ -96,6 +97,12 @@ class ClassifyTest(unittest.TestCase):
|
||||
files=["weed/s3api/auth.go", "test/s3/iam/test_a.py", "test/s3/iam/test_b.py"])
|
||||
self.check("Cover more", "Tests and CI", files=["test/s3/iam/test_a.py"])
|
||||
|
||||
def test_path_with_space(self):
|
||||
with mock.patch.object(rn, "gh", return_value="test/s3/iam/policy cases.json\n"):
|
||||
files = rn.pr_files("seaweedfs/seaweedfs", 1)
|
||||
self.assertEqual(files, ["test/s3/iam/policy cases.json"])
|
||||
self.check("Cover more", "Tests and CI", files=files)
|
||||
|
||||
|
||||
NOTES = """## What's Changed
|
||||
* filer: fail health check when absent from lock ring by @a in https://github.com/seaweedfs/seaweedfs/pull/12709
|
||||
|
||||
Reference in new issue
Block a user