Skip to content

Commit f48b3be

Browse files
authored
Merge branch 'develop' into fix/config-read-telemetry-path
2 parents f9d3cd7 + 909ecb8 commit f48b3be

17 files changed

Lines changed: 539 additions & 66 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@ jobs:
4949

5050
steps:
5151
- name: Checkout Repository
52-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
52+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
5353
with:
5454
fetch-depth: 0
5555
submodules: recursive
5656
token: ${{ secrets.SUBMODULES_TOKEN || github.token }}
5757

5858
- name: Cache NuGet packages
59-
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
59+
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
6060
with:
6161
path: ~/.nuget/packages
6262
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/Directory.Build.props', 'build/Build.csproj') }}
@@ -256,7 +256,7 @@ jobs:
256256

257257
steps:
258258
- name: Checkout Repository
259-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
259+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
260260
with:
261261
fetch-depth: 0
262262
ref: ${{ github.sha }}

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
docs:
2626
runs-on: ubuntu-latest
2727
steps:
28-
- uses: actions/checkout@v6
28+
- uses: actions/checkout@v7
2929

3030
- name: Prepare Python 3.14
3131
uses: actions/setup-python@v6

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636

3737
steps:
3838
- name: Checkout Repository
39-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
39+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
4040
with:
4141
fetch-depth: 0
4242

@@ -68,7 +68,7 @@ jobs:
6868
exit 1
6969
7070
- name: Download unsigned bin artifact
71-
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
71+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
7272
with:
7373
name: unsigned-bin-${{ github.sha }}
7474
run-id: ${{ steps.wait_ci.outputs.run_id }}
@@ -84,7 +84,7 @@ jobs:
8484
path: .
8585

8686
- name: Cache NuGet packages
87-
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
87+
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
8888
with:
8989
path: ~/.nuget/packages
9090
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/Directory.Build.props', 'build/Build.csproj') }}
@@ -161,7 +161,7 @@ jobs:
161161

162162
steps:
163163
- name: Checkout Repository
164-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
164+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
165165
with:
166166
fetch-depth: 0
167167
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.tag_ref || github.ref }}

.github/workflows/winget.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: windows-2025
1717
steps:
1818
- name: Checkout Repository
19-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
19+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
2020
with:
2121
fetch-depth: 0
2222

.github/workflows/wip.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
run: echo "run_id=${{ github.run_id }}" >> "$GITHUB_OUTPUT"
3939

4040
- name: Checkout Repository
41-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
41+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
4242
with:
4343
fetch-depth: 0
4444
ref: ${{ inputs.head_sha }}
@@ -60,7 +60,7 @@ jobs:
6060
path: .
6161

6262
- name: Cache NuGet packages
63-
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
63+
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
6464
with:
6565
path: ~/.nuget/packages
6666
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/Directory.Build.props', 'build/Build.csproj') }}

Pipfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ verify_ssl = true
55

66
[dev-packages]
77
mypy = "*"
8-
pylint = "==4.0.5"
8+
pylint = "==4.0.6"
99

1010
[packages]
1111
docopt = "*"

Pipfile.lock

Lines changed: 42 additions & 43 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dev/pyRevitLabs/pyRevitLabs.PyRevit/PyRevitClones.cs

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,20 @@ public static void RegisterClone(string cloneName, string repoPath, bool forceUp
4646

4747
var registeredClones = GetRegisteredClones();
4848

49-
if (forceUpdate && registeredClones.Contains(clone))
50-
registeredClones.Remove(clone);
51-
52-
if (!registeredClones.Contains(clone))
49+
if (forceUpdate)
5350
{
54-
registeredClones.Add(clone);
55-
SaveRegisteredClones(registeredClones);
51+
registeredClones.RemoveAll(
52+
registeredClone => registeredClone.Matches(cloneName) || registeredClone.Equals(clone));
5653
}
57-
else
54+
else if (registeredClones.Contains(clone))
55+
{
5856
throw new PyRevitException(
5957
string.Format("Clone with repo path \"{0}\" already exists.", clone.ClonePath)
6058
);
59+
}
60+
61+
registeredClones.Add(clone);
62+
SaveRegisteredClones(registeredClones);
6163
}
6264

6365
// renames a clone in a configs
@@ -241,6 +243,9 @@ public static void DeployFromRepo(string cloneName,
241243
// make sure destPath exists
242244
CommonUtils.EnsurePath(destPath);
243245

246+
// Drop stale registrations before cloning so a retried install can register cleanly.
247+
PruneStaleCloneRegistrations();
248+
244249
// check existing destination path
245250
if (CommonUtils.VerifyPath(destPath))
246251
{
@@ -273,7 +278,7 @@ public static void DeployFromRepo(string cloneName,
273278
PyRevitClone.VerifyCloneValidity(clonedPath);
274279
InstallBinariesForRepoClone(clonedPath, repoSourcePath, BinArtifactInstallMode.Clone);
275280
logger.Debug("Clone successful \"{0}\"", clonedPath);
276-
RegisterClone(cloneName, clonedPath);
281+
RegisterClone(cloneName, clonedPath, forceUpdate: true);
277282
}
278283
catch (pyRevitBinArtifactNotFoundException ex)
279284
{
@@ -287,6 +292,7 @@ public static void DeployFromRepo(string cloneName,
287292
{
288293
logger.Debug(string.Format("Exception occured after clone complete. Deleting clone \"{0}\" | {1}",
289294
clonedPath, ex.Message));
295+
UnregisterCloneAtPath(clonedPath);
290296
try
291297
{
292298
CommonUtils.DeleteDirectory(clonedPath);
@@ -346,6 +352,9 @@ public static void DeployFromImage(string cloneName,
346352

347353
logger.Debug("Destination path determined as \"{0}\"", destPath);
348354

355+
// Drop stale registrations before deploying so a retried install can register cleanly.
356+
PruneStaleCloneRegistrations();
357+
349358
// process source
350359
// decide to download if source is a url
351360
if (imageSource.IsValidHttpUrl())
@@ -463,6 +472,7 @@ public static void DeployFromImage(string cloneName,
463472
{
464473
logger.Debug(string.Format("Exception occured after clone from image complete. " +
465474
"Deleting clone \"{0}\" | {1}", destPath, ex.Message));
475+
UnregisterCloneAtPath(destPath);
466476
try
467477
{
468478
CommonUtils.DeleteDirectory(destPath);
@@ -506,12 +516,13 @@ private static void VerifyAndRegisterClone(string cloneName, string clonePath)
506516
{
507517
PyRevitClone.VerifyCloneValidity(clonePath);
508518
logger.Debug("Clone successful \"{0}\"", clonePath);
509-
RegisterClone(cloneName, clonePath);
519+
RegisterClone(cloneName, clonePath, forceUpdate: true);
510520
}
511521
catch (Exception ex)
512522
{
513523
logger.Debug(string.Format("Exception occured after clone complete. Deleting clone \"{0}\" | {1}",
514524
clonePath, ex.Message));
525+
UnregisterCloneAtPath(clonePath);
515526
try
516527
{
517528
CommonUtils.DeleteDirectory(clonePath);
@@ -731,6 +742,24 @@ private static void InstallBinariesForImageClone(
731742
}
732743
}
733744

745+
private static void PruneStaleCloneRegistrations()
746+
{
747+
GetRegisteredClones();
748+
}
749+
750+
private static void UnregisterCloneAtPath(string clonePath)
751+
{
752+
if (string.IsNullOrWhiteSpace(clonePath))
753+
return;
754+
755+
var normalizedPath = clonePath.NormalizeAsPath();
756+
foreach (var clone in GetRegisteredClones().ToList())
757+
{
758+
if (clone.ClonePath.Equals(normalizedPath, StringComparison.OrdinalIgnoreCase))
759+
UnregisterClone(clone);
760+
}
761+
}
762+
734763
private static void WarnIfBinEnginesMissing(string clonePath) {
735764
var netfxEngines = Path.Combine(clonePath, "bin", "netfx", "engines");
736765
var netcoreEngines = Path.Combine(clonePath, "bin", "netcore", "engines");

0 commit comments

Comments
 (0)