Skip to content

Commit bbd8911

Browse files
Dependencies: add PublishesFromReleaseBranch; set on Metalama.Vsx
Adds an init-only PublishesFromReleaseBranch flag on DependencyDefinition. PublishingBranch now resolves to ReleaseBranch when either the family has a consolidated product (existing rule) OR this flag is set. Set the flag in both MetalamaVsxDependencies.V2026_0 and V2026_1: Vsx publishes from release/<version> rather than develop/<version> even though it has no consolidated product, so its TC deployment branch and PublishCommand checkout target now resolve to the release branch. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 394eed0 commit bbd8911

3 files changed

Lines changed: 21 additions & 5 deletions

File tree

src/PostSharp.Engineering.BuildTools/Dependencies/Definitions/MetalamaVsxDependencies.V2026_0.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@ public MetalamaVsxDependencyDefinition(
4949
isVersioned,
5050
pullRequestRequiresStatusCheck: pullRequestRequiresStatusCheck,
5151
vcsRootProjectId: vcsRootProjectId ),
52-
isVersioned ) { }
52+
isVersioned )
53+
{
54+
this.PublishesFromReleaseBranch = true;
55+
}
5356
}
5457

5558
public static ProductFamily Family { get; } = new( _projectName, "2026.0", DevelopmentDependencies.Family, MetalamaDependencies.V2026_0.Family )

src/PostSharp.Engineering.BuildTools/Dependencies/Definitions/MetalamaVsxDependencies.V2026_1.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@ public MetalamaVsxDependencyDefinition(
4949
isVersioned,
5050
pullRequestRequiresStatusCheck: pullRequestRequiresStatusCheck,
5151
vcsRootProjectId: vcsRootProjectId ),
52-
isVersioned ) { }
52+
isVersioned )
53+
{
54+
this.PublishesFromReleaseBranch = true;
55+
}
5356
}
5457

5558
public static ProductFamily Family { get; } = new( _projectName, "2026.1", DevelopmentDependencies.Family, MetalamaDependencies.V2026_1.Family )

src/PostSharp.Engineering.BuildTools/Dependencies/Model/DependencyDefinition.cs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,19 @@ public class DependencyDefinition
4747
/// </remarks>
4848
public string? ReleaseBranch { get; }
4949

50-
// If the product is part of a consolidated build, pre-publishing takes place and the deployment is preformed from the release branch.
51-
// If not, the deployment is performed from the default branch, and post-publishing is is part of the publishing step.
52-
public string PublishingBranch => this.ReleaseBranch != null && this.ProductFamily.HasConsolidatedProduct ? this.ReleaseBranch : this.Branch;
50+
/// <summary>
51+
/// Forces <see cref="PublishingBranch"/> to resolve to <see cref="ReleaseBranch"/> for products that publish from
52+
/// the release branch even though they are not part of a consolidated build (e.g. Metalama.Vsx).
53+
/// </summary>
54+
public bool PublishesFromReleaseBranch { get; init; }
55+
56+
// If the product is part of a consolidated build, pre-publishing takes place and the deployment is performed from the release branch.
57+
// If not, the deployment is performed from the default branch, and post-publishing is part of the publishing step.
58+
// Products with PublishesFromReleaseBranch = true also publish from the release branch even without a consolidated build.
59+
public string PublishingBranch
60+
=> this.ReleaseBranch != null && (this.ProductFamily.HasConsolidatedProduct || this.PublishesFromReleaseBranch)
61+
? this.ReleaseBranch
62+
: this.Branch;
5363

5464
public CiProjectConfiguration CiConfiguration { get; }
5565

0 commit comments

Comments
 (0)