From 8a3f8c0ce0f37277e5552def35629d9df2a99159 Mon Sep 17 00:00:00 2001 From: Seun Akanni Date: Thu, 6 Aug 2026 12:47:30 +0100 Subject: [PATCH 1/2] test(validate): declare a removal in the calling repo's Versioning_93.json Reproduces the shape seen on a prod Revit PR: a method present in the v9.2 dataset is removed from source and the removal is declared with MessageForDeleted in the calling repo's Versioning_93.json. Control leg, action pinned to 8bbbaea, which carries the AssemblyInfo gate fix but not the calling-repo upgrade scan. The declaration must be ignored and the check must report Error/1. --- .github/workflows/versioning.yml | 2 +- File_Engine/Compute/NewFilenameIfExists.cs | 76 ---------------------- File_Engine/Versioning_93.json | 5 ++ 3 files changed, 6 insertions(+), 77 deletions(-) delete mode 100644 File_Engine/Compute/NewFilenameIfExists.cs create mode 100644 File_Engine/Versioning_93.json diff --git a/.github/workflows/versioning.yml b/.github/workflows/versioning.yml index bf138c43..0d0b0f09 100644 --- a/.github/workflows/versioning.yml +++ b/.github/workflows/versioning.yml @@ -19,7 +19,7 @@ jobs: timeout-minutes: 90 steps: - name: Run ci-versioning - uses: BuroHappoldEngineeringAdmin/CI_Toolkit/.github/actions/ci-versioning@develop + uses: BuroHappoldEngineeringAdmin/CI_Toolkit/.github/actions/ci-versioning@8bbbaea4f15e89c0492adc5468cd00daaa1ec82f with: app_id: ${{ secrets.BHOM_APP_ID }} private_key: ${{ secrets.BHOM_APP_PRIVATE_KEY }} diff --git a/File_Engine/Compute/NewFilenameIfExists.cs b/File_Engine/Compute/NewFilenameIfExists.cs deleted file mode 100644 index d5000f25..00000000 --- a/File_Engine/Compute/NewFilenameIfExists.cs +++ /dev/null @@ -1,76 +0,0 @@ -/* - * This file is part of the Buildings and Habitats object Model (BHoM) - * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. - * - * Each contributor holds copyright over their respective contributions. - * The project versioning (Git) records all such contribution source information. - * - * - * The BHoM is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3.0 of the License, or - * (at your option) any later version. - * - * The BHoM is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this code. If not, see . - */ - -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace BH.Engine.Adapters.File -{ - public static partial class Compute - { - [Description("If the targetPath points to a file that exists, return the same filepath with appended `- Copy (i)`, " + - "where `i` is the first index pointing to a non existing file.")] - public static string NewFilenameIfExists(string targetPath) - { - int i = 0; - do - { - string copyFileName = Path.GetFileNameWithoutExtension(targetPath); - - string copyStr = $" - Copy"; - - if (copyFileName.Substring(copyFileName.Length - copyStr.Length - 4).Contains($" - Copy (")) - { - copyFileName = copyFileName.Remove(copyFileName.Length - copyStr.Length - 4) + $" - Copy ({i})"; - } - - if (copyFileName.EndsWith(copyStr)) - copyFileName = copyFileName.Replace(copyStr, $" - Copy ({i})"); - - if (copyFileName.EndsWith(" - Copy (0)")) - copyFileName.Replace(" - Copy (0)", copyStr); - - if (!copyFileName.Substring(copyFileName.Length - copyStr.Length - 4).Contains($" - Copy")) - { - copyFileName += $" - Copy"; - } - - targetPath = Path.Combine(Path.GetDirectoryName(targetPath), copyFileName + Path.GetExtension(targetPath)); - i++; - } - while (System.IO.File.Exists(targetPath)); - - return targetPath; - } - } -} - - - - - - diff --git a/File_Engine/Versioning_93.json b/File_Engine/Versioning_93.json new file mode 100644 index 00000000..29e0944b --- /dev/null +++ b/File_Engine/Versioning_93.json @@ -0,0 +1,5 @@ +{ + "MessageForDeleted": { + "BH.Engine.Adapters.File.Compute.NewFilenameIfExists(System.String)": "Removed to reproduce the ElementRelationships false-fail. Not a real deprecation." + } +} From e04f04da287a012a537d88fb700197136cb3da2f Mon Sep 17 00:00:00 2001 From: Seun Akanni Date: Thu, 6 Aug 2026 12:57:04 +0100 Subject: [PATCH 2/2] test(validate): flip to develop, which carries the calling-repo scan Treatment leg. Source is identical, only the action ref changes, so the declaration must now be honoured and the check must pass. --- .github/workflows/versioning.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/versioning.yml b/.github/workflows/versioning.yml index 0d0b0f09..bf138c43 100644 --- a/.github/workflows/versioning.yml +++ b/.github/workflows/versioning.yml @@ -19,7 +19,7 @@ jobs: timeout-minutes: 90 steps: - name: Run ci-versioning - uses: BuroHappoldEngineeringAdmin/CI_Toolkit/.github/actions/ci-versioning@8bbbaea4f15e89c0492adc5468cd00daaa1ec82f + uses: BuroHappoldEngineeringAdmin/CI_Toolkit/.github/actions/ci-versioning@develop with: app_id: ${{ secrets.BHOM_APP_ID }} private_key: ${{ secrets.BHOM_APP_PRIVATE_KEY }}