refactor: name release assets from the board's chip model

Review follow-up for #72.

- releaseAssetName() takes ConfigSettings::chipModel ("", "s3", "c3", "c6"),
  so GitOTA no longer keeps its own chip switch. C3 keeps its name for when
  the build comes back.
- hasFS is set only when this board's own LittleFS image is in the release.
  isFsAsset() is gone; it also matched the old unsuffixed littlefs.bin, which
  the updater no longer asks for.
- releaseAssetName() returns void: no caller checked the result and every
  name fits currentFile.
- Both manual-upload hints name this board's file.
- KNOWN_ISSUES: the "Main" install can't work, the repo holds no .bin files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
cjkas 2026-10-20 21:34:16 +02:00
parent ab7eae3d94
commit 8196bd20e6
6 changed files with 35 additions and 55 deletions

View file

@ -273,31 +273,23 @@ static void test_otaProven_not_without_network() {
}
/*********************************************************************
* releaseAssetName / isFsAsset
* releaseAssetName
********************************************************************/
static void test_releaseAssetName_matches_the_release_workflow() {
// .github/workflows/build.yaml fwname and fsname.
// .github/workflows/build.yaml fwname and fsname, from ConfigSettings::chipModel.
char buf[64];
TEST_ASSERT_TRUE(releaseAssetName(buf, sizeof(buf), "ino", "esp32"));
releaseAssetName(buf, sizeof(buf), "ino", "");
TEST_ASSERT_EQUAL_STRING("SomfyController.ino.esp32.bin", buf);
TEST_ASSERT_TRUE(releaseAssetName(buf, sizeof(buf), "littlefs", "esp32s3"));
releaseAssetName(buf, sizeof(buf), "littlefs", "s3");
TEST_ASSERT_EQUAL_STRING("SomfyController.littlefs.esp32s3.bin", buf);
releaseAssetName(buf, sizeof(buf), "littlefs", "c6");
TEST_ASSERT_EQUAL_STRING("SomfyController.littlefs.esp32c6.bin", buf);
}
static void test_releaseAssetName_too_small_buffer() {
char buf[16];
TEST_ASSERT_FALSE(releaseAssetName(buf, sizeof(buf), "littlefs", "esp32c6"));
TEST_ASSERT_EQUAL(sizeof(buf) - 1, strlen(buf));
}
static void test_isFsAsset_per_chip_images() {
TEST_ASSERT_TRUE(isFsAsset("SomfyController.littlefs.esp32.bin"));
TEST_ASSERT_TRUE(isFsAsset("SomfyController.littlefs.esp32c6.bin"));
TEST_ASSERT_TRUE(isFsAsset("SomfyController.littlefs.bin"));
}
static void test_isFsAsset_not_the_other_assets() {
TEST_ASSERT_FALSE(isFsAsset("SomfyController.ino.esp32.bin"));
TEST_ASSERT_FALSE(isFsAsset("SomfyController.onboard.esp32.bin.zip"));
TEST_ASSERT_FALSE(isFsAsset("SomfyController.littlefs.bin.sha256"));
TEST_ASSERT_FALSE(isFsAsset(""));
static void test_releaseAssetName_keeps_c3() {
// C3 is out of the IDF 5.5 builds for now (ADR 0003) but is coming back.
char buf[64];
releaseAssetName(buf, sizeof(buf), "ino", "c3");
TEST_ASSERT_EQUAL_STRING("SomfyController.ino.esp32c3.bin", buf);
}
/*********************************************************************
@ -431,9 +423,7 @@ int main(int argc, char **argv) {
RUN_TEST(test_otaProven_not_before_the_minimum_uptime);
RUN_TEST(test_otaProven_not_without_network);
RUN_TEST(test_releaseAssetName_matches_the_release_workflow);
RUN_TEST(test_releaseAssetName_too_small_buffer);
RUN_TEST(test_isFsAsset_per_chip_images);
RUN_TEST(test_isFsAsset_not_the_other_assets);
RUN_TEST(test_releaseAssetName_keeps_c3);
RUN_TEST(test_wifiAuthModeName_matches_the_idf_enum);
RUN_TEST(test_wifiAuthModeName_unknown_past_the_shared_values);
RUN_TEST(test_heapEmitTarget_one_client_always_gets_it);