Skip to content

Create a centralized CommandAttributes and add attributes for DTS setup #4649

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 12, 2025

Conversation

MicroFish91
Copy link
Contributor

No description provided.

@MicroFish91 MicroFish91 requested a review from a team as a code owner August 11, 2025 18:13
import { type ActivityAttributes } from "@microsoft/vscode-azext-utils";

export class CommandAttributes {

Copy link
Member

Choose a reason for hiding this comment

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

Nit: Consider localizing user-facing strings. The description and troubleshooting entries appear user-visible via activity UI; wrapping in localize() would keep consistency with the extension’s localization pattern.

Review generated with Copilot

Copy link
Member

Choose a reason for hiding this comment

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

These are not user interfacing. maybe leave a comment in this file indicating that this is all for copilot?


export class CommandAttributes {

static readonly Deploy: ActivityAttributes = {
Copy link
Member

Choose a reason for hiding this comment

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

Question: Would links help? ActivityAttributes might benefit from optional doc links per troubleshooting item (e.g., Learn docs for deployment and DTS). A links?: string[] or docLinks?: Record<string, string> could improve guidance.

Review generated with Copilot

@@ -47,6 +48,8 @@ export async function getDTSConnectionIfNeeded(context: DTSConnectionContext, ap
const wizardContext: IDTSAzureConnectionWizardContext = {
...context,
...await createActivityContext({ withChildren: true }),
activityAttributes: CommandAttributes.DeployDTSSetup,
Copy link
Member

Choose a reason for hiding this comment

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

Telemetry correlation: callbackId: ${context.callbackId}.dtsSetup`` (line 51). Is this suffix convention documented/consumed elsewhere? If other components rely on exact formats, consider centralizing the pattern to avoid drift.

Review generated with Copilot

Copy link
Contributor Author

@MicroFish91 MicroFish91 Aug 12, 2025

Choose a reason for hiding this comment

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

We could also call with callWithTelemetryAndErrorHandling, but I thought that might be overkill when all we need to change is the callback id that shows up in the activity log. I wanted it to have its own callback id so it's easier for us to log in telemetry when users call into the activity log with copilot.

@@ -68,25 +69,11 @@ async function deploy(actionContext: IActionContext, arg1: vscode.Uri | string |
}

const context: IFuncDeployContext = Object.assign(actionContext, deployPaths, {
Copy link
Member

Choose a reason for hiding this comment

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

Import + duplication: You now call ...await createActivityContext() (line 71) and assign activityAttributes. Previously you spread a second createActivityContext() at the end. Verify there isn’t a second spread later (lines ~86–90) to prevent accidentally overwriting attributes.

Review generated with Copilot

Copy link
Member

Choose a reason for hiding this comment

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

Don't think that this is a concern.

@MicroFish91 MicroFish91 merged commit d93eab8 into main Aug 12, 2025
2 checks passed
@MicroFish91 MicroFish91 deleted the mwf/passive-pink branch August 12, 2025 17:30
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