From 33dd5bb6ba1a5a3f58a38f976aac29bbaac86c4f Mon Sep 17 00:00:00 2001 From: "ci[bot]" Date: Wed, 1 Apr 2026 13:55:55 +0800 Subject: [PATCH] :bug: fix(thirdparty): preserve optional manifest fields --- .gitea/ci/sync_thirdparty_skills.sh | 16 +++++++++++----- .gitea/ci/update_thirdparty_skills.sh | 4 ++-- tests/test_thirdparty_skills_pipeline.py | 6 ++++++ 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/.gitea/ci/sync_thirdparty_skills.sh b/.gitea/ci/sync_thirdparty_skills.sh index 6f51ef0..aacea86 100644 --- a/.gitea/ci/sync_thirdparty_skills.sh +++ b/.gitea/ci/sync_thirdparty_skills.sh @@ -18,7 +18,7 @@ with open(sys.argv[1], encoding="utf-8") as fh: for entry in data["sources"]: print( - "\t".join( + "\x1f".join( [ entry["id"], entry["snapshot_dir"], @@ -125,7 +125,13 @@ git checkout -B "$TARGET_BRANCH" "origin/$TARGET_BRANCH" mkdir -p "codex/skills/.sources" -while IFS=$'\t' read -r source_id snapshot_dir sync_mode source_list skills_subdir output_name platform_config template_root data_dir scripts_dir; do +sources_file="$tmp_dir/sources.tsv" +if ! emit_sources_tsv > "$sources_file"; then + echo "ERROR: failed to load third-party manifest: $MANIFEST_PATH" >&2 + exit 1 +fi + +while IFS=$'\x1f' read -r source_id snapshot_dir sync_mode source_list skills_subdir output_name platform_config template_root data_dir scripts_dir; do [ -n "$source_id" ] || continue if [ -f "$source_list" ]; then @@ -134,10 +140,10 @@ while IFS=$'\t' read -r source_id snapshot_dir sync_mode source_list skills_subd rm -rf "codex/skills/$name" done < "$source_list" fi -done < <(emit_sources_tsv) +done < "$sources_file" declare -A owners=() -while IFS=$'\t' read -r source_id snapshot_dir sync_mode source_list skills_subdir output_name platform_config template_root data_dir scripts_dir; do +while IFS=$'\x1f' read -r source_id snapshot_dir sync_mode source_list skills_subdir output_name platform_config template_root data_dir scripts_dir; do [ -n "$source_id" ] || continue git archive --format=tar "origin/${THIRDPARTY_BRANCH}" "$snapshot_dir" | tar -xf - -C "$tmp_dir" @@ -192,7 +198,7 @@ while IFS=$'\t' read -r source_id snapshot_dir sync_mode source_list skills_subd esac printf "%s\n" "${names[@]}" | sort > "$source_list" -done < <(emit_sources_tsv) +done < "$sources_file" git add codex/skills diff --git a/.gitea/ci/update_thirdparty_skills.sh b/.gitea/ci/update_thirdparty_skills.sh index d51de57..7780ef5 100644 --- a/.gitea/ci/update_thirdparty_skills.sh +++ b/.gitea/ci/update_thirdparty_skills.sh @@ -81,7 +81,7 @@ with open(sys.argv[1], encoding="utf-8") as fh: for entry in data["sources"]: print( - "\t".join( + "\x1f".join( [ entry["id"], entry["upstream_repo"], @@ -124,7 +124,7 @@ if ! emit_sources_tsv > "$sources_file"; then fi changed=0 -while IFS=$'\t' read -r source_id upstream_repo upstream_ref snapshot_dir sync_mode; do +while IFS=$'\x1f' read -r source_id upstream_repo upstream_ref snapshot_dir sync_mode; do [ -n "$source_id" ] || continue gh_repo="" diff --git a/tests/test_thirdparty_skills_pipeline.py b/tests/test_thirdparty_skills_pipeline.py index 50f4738..bd5a0d3 100644 --- a/tests/test_thirdparty_skills_pipeline.py +++ b/tests/test_thirdparty_skills_pipeline.py @@ -92,6 +92,12 @@ class ThirdpartySkillsPipelineTests(unittest.TestCase): text.index('git checkout -B "$TARGET_BRANCH" "origin/$TARGET_BRANCH"'), ) + def test_sync_script_uses_non_whitespace_separator_for_optional_fields(self): + text = SYNC_SCRIPT.read_text(encoding="utf-8") + self.assertIn('"\\x1f".join(', text) + self.assertIn("while IFS=$'\\x1f' read -r", text) + self.assertNotIn("while IFS=$'\\t' read -r", text) + if __name__ == "__main__": unittest.main()