From 4a2f0e20a3fc32a80ff53abc448f4c39edebb9ea Mon Sep 17 00:00:00 2001 From: Bruce Haley Date: Mon, 30 Aug 2021 16:00:18 -0700 Subject: [PATCH 01/11] Fix Activity.java for build --- .../src/main/java/com/microsoft/bot/schema/Activity.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Activity.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Activity.java index b4a62a26a..0dc8ffa26 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Activity.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Activity.java @@ -1266,7 +1266,7 @@ public void setAction(String withAction) { * {@link ActivityTypes#TRACE}. * * @param withName The name of the trace operation to create. - * @return >The new trace activity. + * @return The new trace activity. */ public Activity createTrace(String withName) { return createTrace(withName, null, null, null); @@ -1281,7 +1281,7 @@ public Activity createTrace(String withName) { * @param withValueType Optional, identifier for the format of withValue. * Default is the name of type of the withValue. * @param withLabel Optional, a descriptive label for this trace operation. - * @return >The new trace activity. + * @return The new trace activity. */ public Activity createTrace( String withName, @@ -1447,7 +1447,7 @@ public boolean hasContent() { /** * Resolves the mentions from the entities of this activity. * - * This method is defined on the class, but is only + * This method is defined on the {@link Activity} class, but is only * intended for use with a message activity, where the activity * {@link Activity#type} is set to {@link ActivityTypes#MESSAGE}. * From 874131453213dabf475dd4b3bd72fdb3f679c24a Mon Sep 17 00:00:00 2001 From: Bruce Haley Date: Mon, 30 Aug 2021 16:14:19 -0700 Subject: [PATCH 02/11] Drop @throws from Serialization.java --- .../src/main/java/com/microsoft/bot/schema/Serialization.java | 1 - 1 file changed, 1 deletion(-) diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Serialization.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Serialization.java index e3353867d..c09420d8f 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Serialization.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Serialization.java @@ -162,7 +162,6 @@ public static String toString(Object source) throws JsonProcessingException { * * @param source The object to convert. * @return The JSON string value. - * @throws JsonProcessingException Error converting to JSON */ public static String toStringSilent(Object source) { try { From 7dd5b555f7bb739a12a757120b087c4cc02a8c08 Mon Sep 17 00:00:00 2001 From: Bruce Haley Date: Mon, 30 Aug 2021 16:57:24 -0700 Subject: [PATCH 03/11] Fixes to "Error while generating Javadoc" --- .../bot/ai/qna/dialogs/QnAMakerDialog.java | 4 ++-- .../microsoft/bot/builder/ActivityHandler.java | 4 ++-- .../com/microsoft/bot/connector/UserAgent.java | 2 +- .../AllowedCallersClaimsValidator.java | 2 +- .../authentication/JwtTokenValidation.java | 2 +- .../authentication/SkillValidation.java | 16 ++++++++-------- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/libraries/bot-ai-qna/src/main/java/com/microsoft/bot/ai/qna/dialogs/QnAMakerDialog.java b/libraries/bot-ai-qna/src/main/java/com/microsoft/bot/ai/qna/dialogs/QnAMakerDialog.java index 9c5480071..606caef8a 100644 --- a/libraries/bot-ai-qna/src/main/java/com/microsoft/bot/ai/qna/dialogs/QnAMakerDialog.java +++ b/libraries/bot-ai-qna/src/main/java/com/microsoft/bot/ai/qna/dialogs/QnAMakerDialog.java @@ -731,9 +731,9 @@ protected CompletableFuture getQnAMakerClient(DialogContext dc) * Gets the options for the QnA Maker client that the dialog will use to query * the knowledge base. * - * @param dc The for the current turn of + * @param dc The {@link "DialogContext"} for the current turn of * conversation. - * @return A representing the asynchronous operation. If the + * @return A {@link "Task"} representing the asynchronous operation. If the * task is successful, the result contains the QnA Maker options to use. */ protected CompletableFuture getQnAMakerOptions(DialogContext dc) { diff --git a/libraries/bot-builder/src/main/java/com/microsoft/bot/builder/ActivityHandler.java b/libraries/bot-builder/src/main/java/com/microsoft/bot/builder/ActivityHandler.java index f7a729426..567a03a24 100644 --- a/libraries/bot-builder/src/main/java/com/microsoft/bot/builder/ActivityHandler.java +++ b/libraries/bot-builder/src/main/java/com/microsoft/bot/builder/ActivityHandler.java @@ -636,8 +636,8 @@ protected CompletableFuture onInstallationUpdateRemove(TurnContext turnCon * * @return A task that represents the work queued to execute. * - * When the {@link OnInvokeActivity(TurnContext{InvokeActivity})} method - * receives an Invoke with a {@link InvokeActivity#name} of + * When the {@link OnInvokeActivity(TurnContext(InvokeActivity))} method + * receives an Invoke with a {@link InvokeActivity.name} of * `adaptiveCard/action`, it calls this method. */ protected CompletableFuture onAdaptiveCardInvoke( diff --git a/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/UserAgent.java b/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/UserAgent.java index 8b8b7af40..fb5d66bd8 100644 --- a/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/UserAgent.java +++ b/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/UserAgent.java @@ -13,7 +13,7 @@ *

* Conforms to spec: * https://github.com/Microsoft/botbuilder-dotnet/blob/d342cd66d159a023ac435aec0fdf791f93118f5f/doc/UserAgents.md - *

+ * */ public final class UserAgent { // os/java and botbuilder will never change - static initialize once diff --git a/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/authentication/AllowedCallersClaimsValidator.java b/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/authentication/AllowedCallersClaimsValidator.java index da3eff071..71cc7bd77 100644 --- a/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/authentication/AllowedCallersClaimsValidator.java +++ b/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/authentication/AllowedCallersClaimsValidator.java @@ -20,7 +20,7 @@ public class AllowedCallersClaimsValidator extends ClaimsValidator { /** * Creates an instance of an {@link AllowedCallersClaimsValidator}. - * @param withAllowedCallers A List that contains the list of allowed callers. + * @param withAllowedCallers A {@link List} that contains the list of allowed callers. */ public AllowedCallersClaimsValidator(List withAllowedCallers) { this.allowedCallers = withAllowedCallers != null ? withAllowedCallers : new ArrayList(); diff --git a/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/authentication/JwtTokenValidation.java b/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/authentication/JwtTokenValidation.java index 34a77a78f..26639614c 100644 --- a/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/authentication/JwtTokenValidation.java +++ b/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/authentication/JwtTokenValidation.java @@ -250,7 +250,7 @@ public static String getAppIdFromClaims(Map claims) throws Illeg /** * Internal helper to check if the token has the shape we expect "Bearer [big long string]". * - * @param authHeader >A string containing the token header. + * @param authHeader A string containing the token header. * @return True if the token is valid, false if not. */ public static boolean isValidTokenFormat(String authHeader) { diff --git a/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/authentication/SkillValidation.java b/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/authentication/SkillValidation.java index cbf1885be..ededd5a65 100644 --- a/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/authentication/SkillValidation.java +++ b/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/authentication/SkillValidation.java @@ -78,18 +78,18 @@ public static boolean isSkillToken(String authHeader) { /** * Checks if the given list of claims represents a skill. * - * A skill claim should contain: An {@link AuthenticationConstants#versionClaim} - * claim. An {@link AuthenticationConstants#audienceClaim} claim. An - * {@link AuthenticationConstants#appIdClaim} claim (v1) or an a - * {@link AuthenticationConstants#authorizedParty} claim (v2). And the appId + * A skill claim should contain: An {@link AuthenticationConstants.VERSION_CLAIM} + * claim. An {@link AuthenticationConstants.AUTIENCE_CLAIM} claim. An + * {@link AuthenticationConstants.APPID_CLAIM} claim (v1) or an a + * {@link AuthenticationConstants.AUTHORIZED_PARTY} claim (v2). And the appId * claim should be different than the audience claim. When a channel (webchat, - * teams, etc.) invokes a bot, the {@link AuthenticationConstants#audienceClaim} - * is set to {@link AuthenticationConstants#toBotFromChannelTokenIssuer} but + * teams, etc.) invokes a bot, the {@link AuthenticationConstants.AUTIENCE_CLAIM} + * is set to {@link AuthenticationConstants.TO_BOT_FROM_CHANNEL_TOKEN_ISSUER} but * when a bot calls another bot, the audience claim is set to the appId of the * bot being invoked. The protocol supports v1 and v2 tokens: For v1 tokens, the - * {@link AuthenticationConstants#appIdClaim} is present and set to the app Id + * {@link AuthenticationConstants.APPID_CLAIM} is present and set to the app Id * of the calling bot. For v2 tokens, the - * {@link AuthenticationConstants#authorizedParty} is present and set to the app + * {@link AuthenticationConstants.AUTHORIZED_PARTY} is present and set to the app * Id of the calling bot. * * @param claims A list of claims. From 1fee25d26ab84255e3ff21d23a8330cd65510ee0 Mon Sep 17 00:00:00 2001 From: Bruce Haley Date: Mon, 30 Aug 2021 18:01:59 -0700 Subject: [PATCH 04/11] More generating Javadoc error fixes. --- .gitignore | 2 ++ .../com/microsoft/bot/dialogs/ComponentDialog.java | 8 ++++---- .../java/com/microsoft/bot/dialogs/DialogContext.java | 4 ++-- .../com/microsoft/bot/dialogs/DialogTurnResult.java | 8 ++++---- .../java/com/microsoft/bot/dialogs/ObjectPath.java | 4 ++-- .../java/com/microsoft/bot/dialogs/Recognizer.java | 4 ++-- .../java/com/microsoft/bot/dialogs/SkillDialog.java | 6 +++--- .../microsoft/bot/dialogs/SkillInvokeException.java | 2 +- .../com/microsoft/bot/dialogs/WaterfallDialog.java | 4 ++-- .../microsoft/bot/dialogs/WaterfallStepContext.java | 4 ++-- .../bot/dialogs/memory/DialogStateManager.java | 8 ++++---- .../memory/DialogStateManagerConfiguration.java | 4 ++-- .../memory/pathresolvers/AliasPathResolver.java | 2 +- .../dialogs/memory/pathresolvers/AtAtPathResolver.java | 2 +- .../dialogs/memory/pathresolvers/AtPathResolver.java | 2 +- .../dialogs/memory/pathresolvers/HashPathResolver.java | 2 +- .../memory/pathresolvers/PercentPathResolver.java | 2 +- .../dialogs/memory/scopes/ConversationMemoryScope.java | 2 +- .../memory/scopes/DialogContextMemoryScope.java | 2 +- .../bot/dialogs/memory/scopes/DialogMemoryScope.java | 2 +- .../bot/dialogs/memory/scopes/MemoryScope.java | 6 +++--- .../bot/dialogs/memory/scopes/ThisMemoryScope.java | 2 +- .../bot/dialogs/memory/scopes/UserMemoryScope.java | 2 +- .../microsoft/bot/dialogs/prompts/ActivityPrompt.java | 4 ++-- .../bot/dialogs/prompts/AttachmentPrompt.java | 10 +++++----- .../microsoft/bot/dialogs/prompts/ChoicePrompt.java | 6 ++---- 26 files changed, 52 insertions(+), 52 deletions(-) diff --git a/.gitignore b/.gitignore index 660bbe29e..ad9e563bc 100644 --- a/.gitignore +++ b/.gitignore @@ -66,3 +66,5 @@ libraries/swagger/generated /.vs/slnx.sqlite /.vs/botbuilder-java/v16/.suo /.vs/ProjectSettings.json +/.vs/botbuilder-java/v16/TestStore/0/000.testlog +/.vs/botbuilder-java/v16/TestStore/0/testlog.manifest diff --git a/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/ComponentDialog.java b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/ComponentDialog.java index a66b080fb..cefcc8e8b 100644 --- a/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/ComponentDialog.java +++ b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/ComponentDialog.java @@ -130,12 +130,12 @@ public CompletableFuture continueDialog(DialogContext outerDc) * If the task is successful, the result indicates whether this dialog * is still active after this dialog turn has been processed. Generally, * the child dialog was started with a call to - * {@link BeginDialog(DialogContext, Object)} in the parent's context. + * BeginDialog(DialogContext, Object) in the parent's context. * However, if the {@link DialogContext#replaceDialog(String, Object)} * method is called, the logical child dialog may be different than the * original. If this method is *not* overridden, the dialog - * automatically calls its {@link RepromptDialog(TurnContext, - * DialogInstance)} when the user replies. + * automatically calls its RepromptDialog(TurnContext, + * DialogInstance) when the user replies. */ @Override public CompletableFuture resumeDialog(DialogContext outerDc, DialogReason reason, Object result) { @@ -277,7 +277,7 @@ protected CompletableFuture onInitialize(DialogContext dc) { * default, this calls the * {@link Dialog#beginDialog(DialogContext, Object)} method of the * component dialog's initial dialog, as defined by - * {@link InitialDialogId} . Override this method in a derived class to + * InitialDialogId . Override this method in a derived class to * implement interrupt logic. */ protected CompletableFuture onBeginDialog(DialogContext innerDc, Object options) { diff --git a/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/DialogContext.java b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/DialogContext.java index 1bd9c7a0b..46fede141 100644 --- a/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/DialogContext.java +++ b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/DialogContext.java @@ -471,7 +471,7 @@ public Dialog findDialog(String dialogId) { /** * @param name Name of the event to raise. - * @return CompletableFuture + * @return emitEvent */ public CompletableFuture emitEvent(String name) { return emitEvent(name, null, true, false); @@ -483,7 +483,7 @@ public CompletableFuture emitEvent(String name) { * @param bubble Flag to control whether the event should be bubbled to its parent if not handled locally. * Defaults to a value of `true`. * @param fromLeaf Whether the event is emitted from a leaf node. - * @return CompletableFuture + * @return completedFuture */ public CompletableFuture emitEvent(String name, Object value, boolean bubble, boolean fromLeaf) { // Initialize event diff --git a/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/DialogTurnResult.java b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/DialogTurnResult.java index 484d01111..f4f342c42 100644 --- a/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/DialogTurnResult.java +++ b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/DialogTurnResult.java @@ -49,11 +49,11 @@ public void setStatus(DialogTurnStatus withStatus) { * Gets or sets the result returned by a dialog that was just ended. * *

This will only be populated in certain cases: - *
- The bot calls `DialogContext.BeginDialogAsync()` to start a new dialog and the dialog - * ends immediately. - *
- The bot calls `DialogContext.ContinueDialogAsync()` and a dialog that was active ends.

+ *
- The bot calls `DialogContext.BeginDialogAsync()` to start a new dialog and the dialog + * ends immediately.
+ *
- The bot calls `DialogContext.ContinueDialogAsync()` and a dialog that was active ends.

* - *

In all cases where it's populated, will be `null`.

+ *

In all cases where it's populated, {@link "DialogContext.ActiveDialog"} will be `null`.

* @return The result returned by a dialog that was just ended. */ public Object getResult() { diff --git a/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/ObjectPath.java b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/ObjectPath.java index 114c2ffc6..66f4b7a33 100644 --- a/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/ObjectPath.java +++ b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/ObjectPath.java @@ -489,7 +489,7 @@ public static T mapValueTo(Object val, Class valueType) { /** * Given an root Object and property path, resolve to a constant if eval = true or a constant path otherwise. - * conversation[user.name][user.age] => ['conversation', 'joe', 32]. + * conversation[user.name][user.age] to ['conversation', 'joe', 32]. * @param Type of T * @param obj root Object. * @param propertyPath property path to resolve. @@ -501,7 +501,7 @@ public static Segments tryResolvePath(Object obj, String propertyPath) { /** * Given an root Object and property path, resolve to a constant if eval = true or a constant path otherwise. - * conversation[user.name][user.age] => ['conversation', 'joe', 32]. + * conversation[user.name][user.age] to ['conversation', 'joe', 32]. * @param Type of T * @param obj root Object. * @param propertyPath property path to resolve. diff --git a/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/Recognizer.java b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/Recognizer.java index dd00ab798..411081038 100644 --- a/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/Recognizer.java +++ b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/Recognizer.java @@ -135,7 +135,7 @@ public CompletableFuture recognize( /** * Returns ChooseIntent between multiple recognizer results. * - * @param recognizerResults >recognizer Id => recognizer results map. + * @param recognizerResults recognizer Id to recognizer results map. * @return recognizerResult which is ChooseIntent. */ protected static RecognizerResult createChooseIntentResult(Map recognizerResults) { @@ -219,7 +219,7 @@ public void setTelemetryClient(BotTelemetryClient withTelemetryClient) { * @param recognizerResult Recognizer Result. * @param telemetryProperties A list of properties to append or override the properties * created using the RecognizerResult. - * @param dialogContext >Dialog Context. + * @param dialogContext Dialog Context. * @return A dictionary that can be included when calling the TrackEvent method on the * TelemetryClient. */ diff --git a/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/SkillDialog.java b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/SkillDialog.java index 0c74a9cc4..ab7df729c 100644 --- a/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/SkillDialog.java +++ b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/SkillDialog.java @@ -31,7 +31,7 @@ /** * A specialized {@link Dialog} that can wrap remote calls to a skill. * - * The options parameter in {@link BeginDialog} must be a + * The options parameter in BeginDialog must be a * {@link BeginSkillDialogOptions} instancewith the initial parameters for the * dialog. */ @@ -238,12 +238,12 @@ private CompletableFuture onEndDialog(TurnContext turnContext, DialogInsta } /** - * Validates the activity sent during {@link ContinueDialog} . + * Validates the activity sent during ContinueDialog . * * @param activity The {@link Activity} for the current turn of conversation. * * Override this method to implement a custom validator for the - * activity being sent during the {@link ContinueDialog} . This + * activity being sent during the ContinueDialog . This * method can be used to ignore activities of a certain type if * needed. If this method returns false, the dialog will end the * turn without processing the activity. diff --git a/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/SkillInvokeException.java b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/SkillInvokeException.java index afda96063..bb04873ff 100644 --- a/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/SkillInvokeException.java +++ b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/SkillInvokeException.java @@ -1,7 +1,7 @@ package com.microsoft.bot.dialogs; /** - * Exception used to report issues during the invoke method of the {@link SkillsDialog} class. + * Exception used to report issues during the invoke method of the {@link SkillDialog} class. */ public class SkillInvokeException extends RuntimeException { diff --git a/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/WaterfallDialog.java b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/WaterfallDialog.java index 28e0b8bd9..679a8fc19 100644 --- a/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/WaterfallDialog.java +++ b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/WaterfallDialog.java @@ -73,7 +73,7 @@ public WaterfallDialog addStep(WaterfallStep step) { * * @param dc The * @param options Optional, initial information to pass to the dialog. - * @return A CompletableFuture representing the asynchronous operation. + * @return A CompletableFuture representing the asynchronous operation. * * If the task is successful, the result indicates whether the dialog is * still active after the turn has been processed by the dialog. @@ -110,7 +110,7 @@ public CompletableFuture beginDialog(DialogContext dc, Object * dialog and the user replies with a new activity. * * @param dc The - * @return A CompletableFuture representing the asynchronous operation. + * @return A CompletableFuture representing the asynchronous operation. * * If the task is successful, the result indicates whether the dialog is * still active after the turn has been processed by the dialog. The diff --git a/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/WaterfallStepContext.java b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/WaterfallStepContext.java index 91794a485..9a3a325ee 100644 --- a/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/WaterfallStepContext.java +++ b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/WaterfallStepContext.java @@ -9,9 +9,9 @@ import com.microsoft.bot.connector.Async; /** - * Provides context for a step in a {@link waterfallDialog} . + * Provides context for a step in a {@link WaterfallDialog} . * - * The {@link DialogContext#context} property contains the {@link TurnContext} + * The {@link DialogContext} property contains the {@link TurnContext} * for the current turn. */ public class WaterfallStepContext extends DialogContext { diff --git a/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/DialogStateManager.java b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/DialogStateManager.java index ced24ab76..135e3289d 100644 --- a/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/DialogStateManager.java +++ b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/DialogStateManager.java @@ -40,7 +40,7 @@ * The DialogStateManager manages memory scopes and pathresolvers MemoryScopes * are named root level Objects, which can exist either in the dialogcontext or * off of turn state PathResolvers allow for shortcut behavior for mapping - * things like $foo -> dialog.foo. + * things like $foo to dialog.foo. */ public class DialogStateManager implements Map { @@ -268,7 +268,7 @@ public String transformPath(String path) { * clone of value). * * @param the value type to return. - * @param path >path expression to use. + * @param path path expression to use. * @param clsType the Type that is being requested as a result * @return ResultPair with boolean and requested type TypeT as a result */ @@ -503,7 +503,7 @@ public CompletableFuture saveAllChanges() { * Delete the memory for a scope. * * @param name name of the scope - * @return Completed CompletableFuture + * @return Completed CompletableFuture */ public CompletableFuture deleteScopesMemory(String name) { // Make a copy here that is final so it can be used in lamdba expression below @@ -648,7 +648,7 @@ public Iterable> getEnumerator() { * Track when specific paths are changed. * * @param paths Paths to track. - * @return Normalized paths to pass to AnyPathChanged/>. + * @return Normalized paths to pass to AnyPathChanged. */ public List trackPaths(Iterable paths) { List allPaths = new ArrayList(); diff --git a/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/DialogStateManagerConfiguration.java b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/DialogStateManagerConfiguration.java index 0d39d3547..fd7bc2a71 100644 --- a/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/DialogStateManagerConfiguration.java +++ b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/DialogStateManagerConfiguration.java @@ -19,7 +19,7 @@ public class DialogStateManagerConfiguration { /** - * @return List Returns the list of PathResolvers. + * @return Returns the list of PathResolvers. */ public List getPathResolvers() { return this.pathResolvers; @@ -35,7 +35,7 @@ public void setPathResolvers(List withPathResolvers) { /** - * @return List Returns the list of MemoryScopes. + * @return Returns the list of MemoryScopes. */ public List getMemoryScopes() { return this.memoryScopes; diff --git a/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/pathresolvers/AliasPathResolver.java b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/pathresolvers/AliasPathResolver.java index 7d3e4f99f..f5ff47df8 100644 --- a/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/pathresolvers/AliasPathResolver.java +++ b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/pathresolvers/AliasPathResolver.java @@ -6,7 +6,7 @@ import com.microsoft.bot.dialogs.memory.PathResolver; /** - * Maps aliasXXX -> path.xxx ($foo => dialog.foo). + * Maps aliasXXX to path.xxx ($foo to dialog.foo). */ public class AliasPathResolver implements PathResolver { diff --git a/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/pathresolvers/AtAtPathResolver.java b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/pathresolvers/AtAtPathResolver.java index df00ffa20..7c60062ee 100644 --- a/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/pathresolvers/AtAtPathResolver.java +++ b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/pathresolvers/AtAtPathResolver.java @@ -4,7 +4,7 @@ package com.microsoft.bot.dialogs.memory.pathresolvers; /** - * Maps @@ => turn.recognized.entitites.xxx array. + * Maps @@ to turn.recognized.entitites.xxx array. */ public class AtAtPathResolver extends AliasPathResolver { diff --git a/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/pathresolvers/AtPathResolver.java b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/pathresolvers/AtPathResolver.java index 170597619..553b28008 100644 --- a/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/pathresolvers/AtPathResolver.java +++ b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/pathresolvers/AtPathResolver.java @@ -4,7 +4,7 @@ package com.microsoft.bot.dialogs.memory.pathresolvers; /** - * Maps @@ => turn.recognized.entitites.xxx array. + * Maps @@ to turn.recognized.entitites.xxx array. */ public class AtPathResolver extends AliasPathResolver { diff --git a/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/pathresolvers/HashPathResolver.java b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/pathresolvers/HashPathResolver.java index 0f01b3a0c..8f04f13bc 100644 --- a/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/pathresolvers/HashPathResolver.java +++ b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/pathresolvers/HashPathResolver.java @@ -4,7 +4,7 @@ package com.microsoft.bot.dialogs.memory.pathresolvers; /** - * Maps #xxx => turn.recognized.intents.xxx. + * Maps #xxx to turn.recognized.intents.xxx. */ public class HashPathResolver extends AliasPathResolver { diff --git a/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/pathresolvers/PercentPathResolver.java b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/pathresolvers/PercentPathResolver.java index 6822bfff7..03f5bb9d8 100644 --- a/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/pathresolvers/PercentPathResolver.java +++ b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/pathresolvers/PercentPathResolver.java @@ -4,7 +4,7 @@ package com.microsoft.bot.dialogs.memory.pathresolvers; /** - * Maps %xxx => settings.xxx (aka activeDialog.Instance.xxx). + * Maps %xxx to settings.xxx (aka activeDialog.Instance.xxx). */ public class PercentPathResolver extends AliasPathResolver { diff --git a/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/scopes/ConversationMemoryScope.java b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/scopes/ConversationMemoryScope.java index 4c076515b..e32031dc5 100644 --- a/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/scopes/ConversationMemoryScope.java +++ b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/scopes/ConversationMemoryScope.java @@ -11,7 +11,7 @@ */ public class ConversationMemoryScope extends BotStateMemoryScope { /** - * DialogMemoryScope maps "this" -> dc.ActiveDialog.State. + * DialogMemoryScope maps "this" to dc.ActiveDialog.State. */ public ConversationMemoryScope() { super(ConversationState.class, ScopePath.CONVERSATION); diff --git a/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/scopes/DialogContextMemoryScope.java b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/scopes/DialogContextMemoryScope.java index bccccf058..e665ef042 100644 --- a/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/scopes/DialogContextMemoryScope.java +++ b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/scopes/DialogContextMemoryScope.java @@ -13,7 +13,7 @@ import com.microsoft.bot.dialogs.ScopePath; /** - * DialogContextMemoryScope maps "dialogcontext" -> properties. + * DialogContextMemoryScope maps "dialogcontext" to properties. */ public class DialogContextMemoryScope extends MemoryScope { diff --git a/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/scopes/DialogMemoryScope.java b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/scopes/DialogMemoryScope.java index bbaa23134..7c03e0e9e 100644 --- a/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/scopes/DialogMemoryScope.java +++ b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/scopes/DialogMemoryScope.java @@ -11,7 +11,7 @@ import com.microsoft.bot.dialogs.ScopePath; /** - * DialogMemoryScope maps "dialog" -> dc.Parent?.ActiveDialog.State ?? ActiveDialog.State. + * DialogMemoryScope maps "dialog" to dc.Parent?.ActiveDialog.State ?? ActiveDialog.State. */ public class DialogMemoryScope extends MemoryScope { /** diff --git a/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/scopes/MemoryScope.java b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/scopes/MemoryScope.java index eb3ede696..f546dbc1c 100644 --- a/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/scopes/MemoryScope.java +++ b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/scopes/MemoryScope.java @@ -82,7 +82,7 @@ public void setIncludeInSnapshot(Boolean withIncludeInSnapshot) { * @param dialogContext The dialog context object for this turn. * @param force True to overwrite any existing state cache or false to load state from storage only * if the cache doesn't already exist. - * @return CompletableFuture A future that represents the work queued to execute. + * @return CompletableFuture A future that represents the work queued to execute. */ public CompletableFuture load(DialogContext dialogContext, Boolean force) { return CompletableFuture.completedFuture(null); @@ -95,7 +95,7 @@ public CompletableFuture load(DialogContext dialogContext, Boolean force) * @param dialogContext The dialog context Object for this turn. * @param force True to save the state cache to storage. or false to save state to storage only * if a property in the cache has changed. - * @return CompletableFuture A future that represents the work queued to execute. + * @return CompletableFuture A future that represents the work queued to execute. */ public CompletableFuture saveChanges(DialogContext dialogContext, Boolean force) { return CompletableFuture.completedFuture(null); @@ -105,7 +105,7 @@ public CompletableFuture saveChanges(DialogContext dialogContext, Boolean * Deletes any state in storage and the cache for this. * * @param dialogContext The dialog context Object for this turn. - * @return CompletableFuture A future that represents the work queued to execute. + * @return CompletableFuture A future that represents the work queued to execute. */ public CompletableFuture delete(DialogContext dialogContext) { return CompletableFuture.completedFuture(null); diff --git a/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/scopes/ThisMemoryScope.java b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/scopes/ThisMemoryScope.java index 5eb375d4a..5e43ed86f 100644 --- a/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/scopes/ThisMemoryScope.java +++ b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/scopes/ThisMemoryScope.java @@ -11,7 +11,7 @@ */ public class ThisMemoryScope extends MemoryScope { /** - * DialogMemoryScope maps "this" -> dc.ActiveDialog.State. + * DialogMemoryScope maps "this" to dc.ActiveDialog.State. */ public ThisMemoryScope() { super(ScopePath.THIS, true); diff --git a/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/scopes/UserMemoryScope.java b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/scopes/UserMemoryScope.java index b5ae8806c..09bb1d7c5 100644 --- a/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/scopes/UserMemoryScope.java +++ b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/memory/scopes/UserMemoryScope.java @@ -11,7 +11,7 @@ */ public class UserMemoryScope extends BotStateMemoryScope { /** - * DialogMemoryScope maps "this" -> dc.ActiveDialog.State. + * DialogMemoryScope maps "this" to dc.ActiveDialog.State. */ public UserMemoryScope() { super(UserState.class, ScopePath.USER); diff --git a/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/prompts/ActivityPrompt.java b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/prompts/ActivityPrompt.java index f3cb1e230..9f24fd7df 100644 --- a/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/prompts/ActivityPrompt.java +++ b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/prompts/ActivityPrompt.java @@ -39,10 +39,10 @@ public class ActivityPrompt extends Dialog { * class. * * @param dialogId The ID to assign to this prompt. - * @param validator A {@link PromptValidator{Activity}} that contains validation + * @param validator A {@link PromptValidator} that contains validation * for this prompt. * - * The value of {@link dialogId} must be unique within the + * The value of dialogId must be unique within the * {@link DialogSet} or {@link ComponentDialog} to which the * prompt is added. */ diff --git a/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/prompts/AttachmentPrompt.java b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/prompts/AttachmentPrompt.java index 958c427d4..74dbbc514 100644 --- a/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/prompts/AttachmentPrompt.java +++ b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/prompts/AttachmentPrompt.java @@ -23,7 +23,7 @@ public class AttachmentPrompt extends Prompt> { * * @param dialogId The ID to assign to this prompt. * - * The value of {@link dialogId} must be unique within the {@link DialogSet} or + * The value of dialogId must be unique within the {@link DialogSet} or * {@link ComponentDialog} to which the prompt is added. */ public AttachmentPrompt(String dialogId) { @@ -34,10 +34,10 @@ public AttachmentPrompt(String dialogId) { * Initializes a new instance of the {@link AttachmentPrompt} class. * * @param dialogId The ID to assign to this prompt. - * @param validator Optional, a {@link PromptValidator{T}} that contains additional, + * @param validator Optional, a {@link PromptValidator} that contains additional, * custom validation for this prompt. * - * The value of {@link dialogId} must be unique within the {@link DialogSet} or + * The value of dialogId must be unique within the {@link DialogSet} or * {@link ComponentDialog} to which the prompt is added. */ public AttachmentPrompt(String dialogId, PromptValidator> validator) { @@ -51,7 +51,7 @@ public AttachmentPrompt(String dialogId, PromptValidator> valid * @param state Contains state for the current instance of the prompt on the * dialog stack. * @param options A prompt options Object constructed from the options initially - * provided in the call to {@link DialogContext#prompt(String, PromptOptions)} . + * provided in the call to {@link DialogContext(String, PromptOptions)} . * @param isRetry true if this is the first time this prompt dialog instance on the * stack is prompting the user for input; otherwise, false. * @@ -88,7 +88,7 @@ protected CompletableFuture onPrompt(TurnContext turnContext, Map Date: Mon, 30 Aug 2021 18:30:25 -0700 Subject: [PATCH 05/11] Fix CopyFiles@2 in .yml --- pipelines/BotBuilder-Java-4.0-daily.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pipelines/BotBuilder-Java-4.0-daily.yml b/pipelines/BotBuilder-Java-4.0-daily.yml index 0de23ec37..b88659071 100644 --- a/pipelines/BotBuilder-Java-4.0-daily.yml +++ b/pipelines/BotBuilder-Java-4.0-daily.yml @@ -193,14 +193,14 @@ jobs: - task: CopyFiles@2 displayName: Copy deployment files to staging packages directory inputs: - SourceFolder: $(system.defaultworkingdirectory) + SourceFolder: '$(system.defaultworkingdirectory)' Contents: >- libraries/*/target/*.jar libraries/*/target/*.jar.asc libraries/*/pom.xml settings.xml pom.xml - TargetFolder: $(Build.ArtifactStagingDirectory)/packages + TargetFolder: '$(Build.ArtifactStagingDirectory)/packages' - task: PublishBuildArtifacts@1 displayName: Publish deployment files to artifacts inputs: From 8e19d925f76ba0225f22242a77fed453e1c05db6 Mon Sep 17 00:00:00 2001 From: Bruce Haley Date: Tue, 31 Aug 2021 12:23:07 -0700 Subject: [PATCH 06/11] Fix CopyFiles@2 #2 --- pipelines/BotBuilder-Java-4.0-daily.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pipelines/BotBuilder-Java-4.0-daily.yml b/pipelines/BotBuilder-Java-4.0-daily.yml index b88659071..7726919da 100644 --- a/pipelines/BotBuilder-Java-4.0-daily.yml +++ b/pipelines/BotBuilder-Java-4.0-daily.yml @@ -191,10 +191,10 @@ jobs: options: --settings $(Build.SourcesDirectory)/settings.xml -Dinternal.repo.username=$(JavaMygetUserName) -Dinternal.repo.password=$(JavaMygetApiKey) -e --no-transfer-progress publishJUnitResults: false - task: CopyFiles@2 - displayName: Copy deployment files to staging packages directory + displayName: 'Copy deployment files to staging packages directory' inputs: - SourceFolder: '$(system.defaultworkingdirectory)' - Contents: >- + SourceFolder: '$(Build.SourcesDirectory)' + Contents: | libraries/*/target/*.jar libraries/*/target/*.jar.asc libraries/*/pom.xml From ecb5f6d10dae3c7334e507e80fe85ab938c7028c Mon Sep 17 00:00:00 2001 From: Bruce Haley Date: Tue, 31 Aug 2021 13:13:17 -0700 Subject: [PATCH 07/11] Add Resolve package version variable --- pipelines/BotBuilder-Java-4.0-daily.yml | 50 ++++++++++--------------- 1 file changed, 20 insertions(+), 30 deletions(-) diff --git a/pipelines/BotBuilder-Java-4.0-daily.yml b/pipelines/BotBuilder-Java-4.0-daily.yml index 7726919da..1a794dea6 100644 --- a/pipelines/BotBuilder-Java-4.0-daily.yml +++ b/pipelines/BotBuilder-Java-4.0-daily.yml @@ -15,10 +15,23 @@ jobs: steps: - checkout: self persistCredentials: True + + - powershell: | + # Replace {DateStamp} and {CommitHash} tokens with the actual values in var PackageVersion + $dateStamp = (Get-Date -format "yyyyMMdd"); + $commitHash = "$(Build.SourceVersion)".SubString(0,7); + + "Raw PackageVersion = $(PackageVersion)"; + $v = "$(PackageVersion)".Replace("{DateStamp}",$dateStamp).Replace("{CommitHash}",$commitHash); + Write-Host "##vso[task.setvariable variable=PackageVersion;]$v"; + "Resolved PackageVersion = $v"; + displayName: 'Resolve package version variable' + - task: tagBuildOrRelease@0 displayName: Tag Build with package version inputs: tags: PackageVersion=$(PackageVersion) + - task: PowerShell@2 displayName: Maven set versions in pom files inputs: @@ -30,6 +43,7 @@ jobs: mvn versions:set -DnewVersion="$(PackageVersion)" --no-transfer-progress Write-Host "Completed" + - task: PowerShell@2 displayName: Import signing keys continueOnError: True @@ -39,69 +53,41 @@ jobs: script: >+ gpg --version - Write-Host "Public key:" - $file = "public.pgp"; - $key = "$(PgpSigningPublicKey)"; - # Restore the missing newlines to the key - $cut1 = $key.Substring(0, 80).LastIndexOf('-') + 2; - $cut2 = $key.Substring($cut1).IndexOf('-') + $cut1; - $firstLine = $key.Substring(0, $cut1) - $lastLine = $key.Substring($cut2) - $middleLine = $key.Substring($cut1, $cut2 - $cut1); - $middleLine = $middleLine.Replace(" ", "`r`n"); - $key2 = -Join ($firstLine, "`r`n", $middleLine, $lastLine); - New-Item -Path $file -ItemType "file" -Value $key2; #'-------------'; get-content "$file"; '===================' gpg --import $file - Remove-Item $file - Write-Host "Private key:" - $file = "private.pgp"; - $key = "$(PgpSigningPrivateKey)"; - $passPhrase = "$(PassPhrase)"; - $cut1 = $key.Substring(0, 80).LastIndexOf('-') + 2; - $cut2 = $key.Substring($cut1).IndexOf('-') + $cut1; - $firstLine = $key.Substring(0, $cut1) - $lastLine = $key.Substring($cut2) - $middleLine = $key.Substring($cut1, $cut2 - $cut1); - $middleLine = $middleLine.Replace(" ", "`r`n"); - $key2 = -Join ($firstLine, "`r`n", $middleLine, $lastLine); - New-Item -Path $file -ItemType "file" -Value $key2; - gpg --allow-secret-key-import --import $file - Remove-Item $file - - task: PowerShell@2 displayName: '[Diagnostics] Show pom files' condition: succeededOrFailed() @@ -133,7 +119,6 @@ jobs: Write-Host $element.InnerText get-content $file; - $file = "$(Build.SourcesDirectory)\libraries\bot-schema\pom.xml"; $xml = New-Object XML; $xml.Load($file); @@ -165,6 +150,7 @@ jobs: options: -e --no-transfer-progress -Drepo.id=ConversationalAI -Drepo.url=https://pkgs.dev.azure.com/ConversationalAI/BotFramework/_packaging/SDK/maven/v1 -Dexclude.tests= codeCoverageTool: JaCoCo findbugsAnalysisEnabled: true + - task: Maven@3 displayName: 'Maven Package ' enabled: False @@ -172,6 +158,7 @@ jobs: goals: package -P devops options: -e --no-transfer-progress findbugsAnalysisEnabled: true + - task: Maven@3 displayName: Maven Deploy condition: "and(succeeded(), or(eq(variables['Build.Reason'], 'Schedule'), eq(variables['publish'], 'true'))) " @@ -183,6 +170,7 @@ jobs: checkstyleAnalysisEnabled: true pmdAnalysisEnabled: true findbugsAnalysisEnabled: true + - task: Maven@3 displayName: Maven deploy to scratch enabled: False @@ -190,6 +178,7 @@ jobs: goals: deploy options: --settings $(Build.SourcesDirectory)/settings.xml -Dinternal.repo.username=$(JavaMygetUserName) -Dinternal.repo.password=$(JavaMygetApiKey) -e --no-transfer-progress publishJUnitResults: false + - task: CopyFiles@2 displayName: 'Copy deployment files to staging packages directory' inputs: @@ -201,10 +190,12 @@ jobs: settings.xml pom.xml TargetFolder: '$(Build.ArtifactStagingDirectory)/packages' + - task: PublishBuildArtifacts@1 displayName: Publish deployment files to artifacts inputs: PathtoPublish: $(Build.ArtifactStagingDirectory)/packages + - task: PowerShell@2 displayName: Dir workspace condition: succeededOrFailed() @@ -213,6 +204,5 @@ jobs: targetType: inline script: >- pushd .. - Get-ChildItem -Recurse -Force ... From fa2052ec8e9c75cb379637b029807ccea40112a3 Mon Sep 17 00:00:00 2001 From: Bruce Haley Date: Tue, 31 Aug 2021 13:30:51 -0700 Subject: [PATCH 08/11] Fix powershell steps --- pipelines/BotBuilder-Java-4.0-daily.yml | 45 +++++++++---------------- 1 file changed, 16 insertions(+), 29 deletions(-) diff --git a/pipelines/BotBuilder-Java-4.0-daily.yml b/pipelines/BotBuilder-Java-4.0-daily.yml index 1a794dea6..519729871 100644 --- a/pipelines/BotBuilder-Java-4.0-daily.yml +++ b/pipelines/BotBuilder-Java-4.0-daily.yml @@ -25,43 +25,34 @@ jobs: $v = "$(PackageVersion)".Replace("{DateStamp}",$dateStamp).Replace("{CommitHash}",$commitHash); Write-Host "##vso[task.setvariable variable=PackageVersion;]$v"; "Resolved PackageVersion = $v"; - displayName: 'Resolve package version variable' + displayName: 'Resolve variable PackageVersion' - task: tagBuildOrRelease@0 displayName: Tag Build with package version inputs: tags: PackageVersion=$(PackageVersion) - - task: PowerShell@2 - displayName: Maven set versions in pom files - inputs: - targetType: inline - script: > + - powershell: | Write-Host "Setting module versions" Write-Host "version = $(PackageVersion)" mvn versions:set -DnewVersion="$(PackageVersion)" --no-transfer-progress Write-Host "Completed" + displayName: Maven set versions in pom files - - task: PowerShell@2 - displayName: Import signing keys - continueOnError: True - timeoutInMinutes: 1 - inputs: - targetType: inline - script: >+ + - powershell: | gpg --version - Write-Host "Public key:" + Write-Host "Public key:"; $file = "public.pgp"; $key = "$(PgpSigningPublicKey)"; # Restore the missing newlines to the key $cut1 = $key.Substring(0, 80).LastIndexOf('-') + 2; $cut2 = $key.Substring($cut1).IndexOf('-') + $cut1; - $firstLine = $key.Substring(0, $cut1) - $lastLine = $key.Substring($cut2) + $firstLine = $key.Substring(0, $cut1); + $lastLine = $key.Substring($cut2); $middleLine = $key.Substring($cut1, $cut2 - $cut1); $middleLine = $middleLine.Replace(" ", "`r`n"); $key2 = -Join ($firstLine, "`r`n", $middleLine, $lastLine); @@ -69,8 +60,8 @@ jobs: #'-------------'; get-content "$file"; '===================' - gpg --import $file - Remove-Item $file + gpg --import $file; + Remove-Item $file; Write-Host "Private key:" $file = "private.pgp"; @@ -79,22 +70,17 @@ jobs: $cut1 = $key.Substring(0, 80).LastIndexOf('-') + 2; $cut2 = $key.Substring($cut1).IndexOf('-') + $cut1; - $firstLine = $key.Substring(0, $cut1) - $lastLine = $key.Substring($cut2) + $firstLine = $key.Substring(0, $cut1); + $lastLine = $key.Substring($cut2); $middleLine = $key.Substring($cut1, $cut2 - $cut1); $middleLine = $middleLine.Replace(" ", "`r`n"); $key2 = -Join ($firstLine, "`r`n", $middleLine, $lastLine); New-Item -Path $file -ItemType "file" -Value $key2; - gpg --allow-secret-key-import --import $file - Remove-Item $file + gpg --allow-secret-key-import --import $file; + Remove-Item $file; + displayName: Import signing keys - - task: PowerShell@2 - displayName: '[Diagnostics] Show pom files' - condition: succeededOrFailed() - enabled: False - inputs: - targetType: inline - script: >- + - powershell: | $file = "$(Build.SourcesDirectory)\pom.xml"; $xml = New-Object XML; $xml.Load($file); @@ -142,6 +128,7 @@ jobs: Write-Host $file '+++++++++++++++++++++++++++++++++++'; Write-Host $element.InnerText get-content $file; + displayName: '[Diagnostics] Show pom files' - task: Maven@3 displayName: Maven Install (this signs) From e0b074904018880ad38e5370edd03e606df3fbdf Mon Sep 17 00:00:00 2001 From: Bruce Haley Date: Tue, 31 Aug 2021 13:32:57 -0700 Subject: [PATCH 09/11] powershell tweaks --- pipelines/BotBuilder-Java-4.0-daily.yml | 40 ++++++++++++------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/pipelines/BotBuilder-Java-4.0-daily.yml b/pipelines/BotBuilder-Java-4.0-daily.yml index 519729871..e63c7d826 100644 --- a/pipelines/BotBuilder-Java-4.0-daily.yml +++ b/pipelines/BotBuilder-Java-4.0-daily.yml @@ -33,12 +33,12 @@ jobs: tags: PackageVersion=$(PackageVersion) - powershell: | - Write-Host "Setting module versions" - Write-Host "version = $(PackageVersion)" + Write-Host "Setting module versions"; + Write-Host "version = $(PackageVersion)"; - mvn versions:set -DnewVersion="$(PackageVersion)" --no-transfer-progress + mvn versions:set -DnewVersion="$(PackageVersion)" --no-transfer-progress; - Write-Host "Completed" + Write-Host "Completed"; displayName: Maven set versions in pom files - powershell: | @@ -84,49 +84,49 @@ jobs: $file = "$(Build.SourcesDirectory)\pom.xml"; $xml = New-Object XML; $xml.Load($file); - $nsm = New-Object Xml.XmlNamespaceManager($xml.NameTable) - $nsm.AddNamespace('ns', $xml.DocumentElement.NamespaceURI) - $element = $xml.SelectSingleNode('//ns:version', $nsm) + $nsm = New-Object Xml.XmlNamespaceManager($xml.NameTable); + $nsm.AddNamespace('ns', $xml.DocumentElement.NamespaceURI); + $element = $xml.SelectSingleNode('//ns:version', $nsm); #$element.InnerText = "$(PackageVersion)" #$xml.Save($file); Write-Host $file '+++++++++++++++++++++++++++++++++++'; - Write-Host $element.InnerText + Write-Host $element.InnerText; get-content $file; $file = "$(Build.SourcesDirectory)\libraries\bot-builder\pom.xml"; $xml = New-Object XML; $xml.Load($file); - $nsm = New-Object Xml.XmlNamespaceManager($xml.NameTable) - $nsm.AddNamespace('ns', $xml.DocumentElement.NamespaceURI) - $element = $xml.SelectSingleNode('//ns:version', $nsm) + $nsm = New-Object Xml.XmlNamespaceManager($xml.NameTable); + $nsm.AddNamespace('ns', $xml.DocumentElement.NamespaceURI); + $element = $xml.SelectSingleNode('//ns:version', $nsm); #$element.InnerText = "$(PackageVersion)" #$xml.Save($file); Write-Host $file '+++++++++++++++++++++++++++++++++++'; - Write-Host $element.InnerText + Write-Host $element.InnerText; get-content $file; $file = "$(Build.SourcesDirectory)\libraries\bot-schema\pom.xml"; $xml = New-Object XML; $xml.Load($file); - $nsm = New-Object Xml.XmlNamespaceManager($xml.NameTable) - $nsm.AddNamespace('ns', $xml.DocumentElement.NamespaceURI) - $element = $xml.SelectSingleNode('//ns:version', $nsm) + $nsm = New-Object Xml.XmlNamespaceManager($xml.NameTable); + $nsm.AddNamespace('ns', $xml.DocumentElement.NamespaceURI); + $element = $xml.SelectSingleNode('//ns:version', $nsm); #$element.InnerText = "$(PackageVersion)" #$xml.Save($file); Write-Host $file '+++++++++++++++++++++++++++++++++++'; - Write-Host $element.InnerText + Write-Host $element.InnerText; get-content $file; $file = "$(Build.SourcesDirectory)\libraries\bot-connector\pom.xml"; $xml = New-Object XML; $xml.Load($file); - $nsm = New-Object Xml.XmlNamespaceManager($xml.NameTable) - $nsm.AddNamespace('ns', $xml.DocumentElement.NamespaceURI) - $element = $xml.SelectSingleNode('//ns:version', $nsm) + $nsm = New-Object Xml.XmlNamespaceManager($xml.NameTable); + $nsm.AddNamespace('ns', $xml.DocumentElement.NamespaceURI); + $element = $xml.SelectSingleNode('//ns:version', $nsm); #$element.InnerText = "$(PackageVersion)" #$xml.Save($file); Write-Host $file '+++++++++++++++++++++++++++++++++++'; - Write-Host $element.InnerText + Write-Host $element.InnerText; get-content $file; displayName: '[Diagnostics] Show pom files' From 8609e943540a10d792cd313ff351f0ed954b229e Mon Sep 17 00:00:00 2001 From: Bruce Haley Date: Tue, 31 Aug 2021 14:00:30 -0700 Subject: [PATCH 10/11] Mo re powershell fixes --- pipelines/BotBuilder-Java-4.0-daily.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/pipelines/BotBuilder-Java-4.0-daily.yml b/pipelines/BotBuilder-Java-4.0-daily.yml index e63c7d826..7a395298c 100644 --- a/pipelines/BotBuilder-Java-4.0-daily.yml +++ b/pipelines/BotBuilder-Java-4.0-daily.yml @@ -183,13 +183,8 @@ jobs: inputs: PathtoPublish: $(Build.ArtifactStagingDirectory)/packages - - task: PowerShell@2 + - powershell: | + pushd ..; + Get-ChildItem -Recurse -Force; displayName: Dir workspace - condition: succeededOrFailed() - continueOnError: True - inputs: - targetType: inline - script: >- - pushd .. - Get-ChildItem -Recurse -Force ... From 83b9ee0e4e3f2093a0f994ea8ebb883c945c94ba Mon Sep 17 00:00:00 2001 From: Bruce Haley Date: Tue, 31 Aug 2021 14:19:00 -0700 Subject: [PATCH 11/11] Set build id, other tweaks --- pipelines/BotBuilder-Java-4.0-daily.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/pipelines/BotBuilder-Java-4.0-daily.yml b/pipelines/BotBuilder-Java-4.0-daily.yml index 7a395298c..fa7f5eff0 100644 --- a/pipelines/BotBuilder-Java-4.0-daily.yml +++ b/pipelines/BotBuilder-Java-4.0-daily.yml @@ -6,16 +6,21 @@ # Variable Group 'JavaVariableGroup' was defined in the Variables tab # Variable Group 'JavaSigningVariableGroup' was defined in the Variables tab # Cron Schedules have been converted using UTC Time Zone and may need to be updated for your location + +# "name" here defines the build number format. Build number is accessed via $(Build.BuildNumber) +name: $(Build.BuildId) + +pool: + vmImage: windows-2019 + +trigger: none # ci trigger is set in ADO +pr: none # pr trigger is set in ADO + jobs: - job: Phase_1 displayName: Phase 1 - cancelTimeoutInMinutes: 1 - pool: - vmImage: windows-2019 - steps: - - checkout: self - persistCredentials: True + steps: - powershell: | # Replace {DateStamp} and {CommitHash} tokens with the actual values in var PackageVersion $dateStamp = (Get-Date -format "yyyyMMdd");