fix(scripts): attribute bumped versions to their own matrix entry
bump_image_versions.py now locates each matrix.include entry and rewrites the version: line of the entry whose name: it is, whatever the key order; an entry it cannot parse unambiguously is a one-line error, and the rewrite is verified against the YAML before it is written. Files are read and written as UTF-8 with newline="" so CRLF survives. A shallow clone without a merge-base names the fix (git fetch --unshallow). check_image_versions.py decodes git's stderr, so errors no longer print a bytes repr. Untracked files that git ignores were already skipped; a test now pins that. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
This commit is contained in:
1 parent
c03e492f81
commit
a57714342b
4 files changed
+194
-24
No files matched your search
@@ -280,6 +280,13 @@ class GitTest(unittest.TestCase):
|
||||
def test_unknown_base_ref_is_one_line(self):
|
||||
self.assert_clean_failure(self.bump_args("bump", "nope"), "git merge-base failed")
|
||||
|
||||
def test_git_errors_are_decoded_text_not_a_bytes_repr(self):
|
||||
code, err = self.bump_args("bump", "nope")
|
||||
self.assertEqual(code, 1)
|
||||
self.assertNotIn("b'", err)
|
||||
self.assertNotIn('b"', err)
|
||||
self.assertIn("fatal:", err)
|
||||
|
||||
def test_bad_version_in_matrix_is_one_line(self):
|
||||
self.write(".gitea/workflows/image.yml", IMAGE_YML.format(mol="latest", ci="0.2.0"))
|
||||
self.commit("bad version")
|
||||
|
||||
Reference in new issue
Block a user