Skip to content

Refactor publish-mavenpackages#24070

Merged
hallipr merged 1 commit intoAzure:mainfrom
hallipr:hallipr/refactor-maven-publish
Sep 21, 2021
Merged

Refactor publish-mavenpackages#24070
hallipr merged 1 commit intoAzure:mainfrom
hallipr:hallipr/refactor-maven-publish

Conversation

@hallipr
Copy link
Member

@hallipr hallipr commented Sep 11, 2021

  • Stop publishing to ADO when ShouldPublish is false
  • To ensure there's are gpg signatures to publish as build artifacts, do a local gpg deployment when not publishing to a repository
  • Only check remote repo content when deployment fails. Checking before maven deployment was taking more time than letting the first attempt fail for conflict.
  • Restructure the script to let the url parameter dictate a set of variables (shouldPublishPackage, releaseType, packageUrl) rather than repeating logic in each url based conditional block

@hallipr hallipr requested a review from weshaggard September 11, 2021 00:21
if ($packageReposityUrl -match "https://pkgs.dev.azure.com/azure-sdk/\b(internal|public)\b/*") {
# Azure DevOps feeds don't support staging
$shouldPublishPackage = $ShouldPublish -and !$StageOnly
$releaseType = 'AzureDevOps'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should make releaseType an input parameter to the script?

Copy link
Member Author

@hallipr hallipr Sep 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's reliably implicit from the uri. As is, there's no chance of conflict, just the possibility of someone calling us with an incorrect uri. If we add the parameter, then we'd have to check for an unsupported uri and for uris that don't match the releaseType parameter.

}

#Local GPG deployment is required when we're not going to publish a package, or when we're publishing to maven central
$requiresLocalGpg = !$shouldPublishPackage -or ($releaseType -eq 'MavenCentralStaging') -or ($releaseType -eq 'MavenCentral')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this all cases?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind I think I understand the logic now. For DevOps or Snapshot you will already be doing the steps that will generate the gpg files so you don't need to do it explicitly in those cases.

Copy link
Member

@weshaggard weshaggard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@hallipr hallipr marked this pull request as ready for review September 21, 2021 17:42
@hallipr hallipr force-pushed the hallipr/refactor-maven-publish branch from 090bfdb to ab8fdf3 Compare September 21, 2021 18:14
@hallipr hallipr enabled auto-merge (squash) September 21, 2021 18:14
@hallipr hallipr merged commit 4d66dd5 into Azure:main Sep 21, 2021
@hallipr hallipr deleted the hallipr/refactor-maven-publish branch September 23, 2021 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants