Skip to content

Commit 3a3a990

Browse files
committed
Removing redundant call to TryUpdateAutoUpdatedDependencies during post-publish step.
1 parent e3da716 commit 3a3a990

2 files changed

Lines changed: 13 additions & 18 deletions

File tree

src/PostSharp.Engineering.BuildTools/Build/Model/Product.cs

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1793,6 +1793,13 @@ public bool PrePublish( BuildContext context, PublishSettings settings )
17931793
return false;
17941794
}
17951795

1796+
if ( !TryUpdateAutoUpdatedDependencies( context, settings ) )
1797+
{
1798+
context.Console.WriteError( "Failed to update auto-updated dependencies." );
1799+
1800+
return false;
1801+
}
1802+
17961803
if ( !GitHelper.TryPullAndMergeAndPush( context, settings, targetBranch ) )
17971804
{
17981805
return false;
@@ -1883,13 +1890,6 @@ public bool Publish( BuildContext context, PublishSettings settings )
18831890
}
18841891
}
18851892

1886-
if ( !TryUpdateAutoUpdatedDependencies( context, settings ) )
1887-
{
1888-
context.Console.WriteError( "Failed to update auto-updated dependencies." );
1889-
1890-
return false;
1891-
}
1892-
18931893
if ( !this.TryAddTagToLastCommit( context, settings ) )
18941894
{
18951895
context.Console.WriteError( "Failed to tag the latest commit." );
@@ -1941,7 +1941,7 @@ public bool Publish( BuildContext context, PublishSettings settings )
19411941

19421942
public bool PostPublish( BuildContext context, PublishSettings settings )
19431943
{
1944-
context.Console.WriteHeading( "Finishing publishig" );
1944+
context.Console.WriteHeading( "Finishing publishing." );
19451945

19461946
if ( !this.PrepareVersionsFile( context, settings, out _ ) )
19471947
{
@@ -1973,13 +1973,6 @@ public bool PostPublish( BuildContext context, PublishSettings settings )
19731973

19741974
return false;
19751975
}
1976-
1977-
if ( !TryUpdateAutoUpdatedDependencies( context, settings ) )
1978-
{
1979-
context.Console.WriteError( "Failed to update auto-updated dependencies." );
1980-
1981-
return false;
1982-
}
19831976

19841977
if ( !this.TryAddTagToLastCommit( context, settings ) )
19851978
{
@@ -2312,8 +2305,7 @@ private bool TryReadDependencyVersionsFromSourceRepos(
23122305
}
23132306

23142307
var mainVersionFile = $"{dependency.EngineeringDirectory}/MainVersion.props";
2315-
context.Console.WriteMessage( $"Downloading '{mainVersionFile}' from '{dependency.VcsRepository}'." );
2316-
2308+
23172309
if ( !dependency.VcsRepository.TryDownloadTextFile( context.Console, dependency.Branch, mainVersionFile, out var mainVersionContent ) )
23182310
{
23192311
return false;

src/PostSharp.Engineering.BuildTools/ContinuousIntegration/AzureDevOpsRepository.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,10 @@ public override bool TryDownloadTextFile( ConsoleHelper console, string branch,
8181
var authString = Convert.ToBase64String( Encoding.UTF8.GetBytes( $@"{TeamCityHelper.TeamCityUsername}:{teamCitySourceReadToken}" ) );
8282
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue( "Basic", authString );
8383

84-
text = httpClient.GetString( $"{this.BaseUrl}/{this.Project}/_apis/git/repositories/{this.Name}/items?path={path}&versionDescriptor.version={branch}" );
84+
var uri = $"{this.BaseUrl}/{this.Project}/_apis/git/repositories/{this.Name}/items?path={path}&versionDescriptor.version={branch}";
85+
86+
console.WriteMessage( $"Downloading {uri}." );
87+
text = httpClient.GetString( uri );
8588

8689
return true;
8790
}

0 commit comments

Comments
 (0)