Skip to content

Fix sample and update dependencies / lock file#251

Merged
MSNev merged 3 commits into
mainfrom
MSNev/UpdateComponents
Apr 9, 2026
Merged

Fix sample and update dependencies / lock file#251
MSNev merged 3 commits into
mainfrom
MSNev/UpdateComponents

Conversation

@MSNev
Copy link
Copy Markdown
Contributor

@MSNev MSNev commented Apr 9, 2026

No description provided.

@MSNev MSNev requested a review from a team as a code owner April 9, 2026 00:10
@MSNev MSNev enabled auto-merge (squash) April 9, 2026 00:11
@MSNev MSNev requested a review from Copilot April 9, 2026 00:11
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the Angular plugin sample to use the correct Application Insights configuration field and adjusts sample dependencies/release notes.

Changes:

  • Switch sample production environment config from instrumentationKey to connectionString.
  • Update router tracking in AppComponent to derive the activated component via ActivatedRoute.
  • Add npm overrides for transitive dependencies and add a full changelog link to RELEASES.md.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.

File Description
sample/applicationinsights-angularplugin-sample/src/environments/environment.prod.ts Aligns prod environment config with the connectionString field used by the telemetry service.
sample/applicationinsights-angularplugin-sample/src/app/app.component.ts Updates activated component resolution logic for page view tracking.
sample/applicationinsights-angularplugin-sample/package.json Adds dependency overrides intended to address transitive vulnerability updates.
RELEASES.md Adds a full changelog comparison link for the referenced release.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread sample/applicationinsights-angularplugin-sample/src/app/app.component.ts Outdated
Comment thread sample/applicationinsights-angularplugin-sample/package.json
MSNev and others added 2 commits April 8, 2026 17:20
…ort, function or class'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…ts/environment.prod.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

sample/applicationinsights-angularplugin-sample/src/app/app.component.ts:33

  • getActivatedComponent() returns route.component which can be a component type or a string (Angular router supports string component identifiers). In the string case, activatedComponent.name becomes undefined, so page view telemetry will have no name. Consider tightening the return type (e.g., Type<unknown> | string | null) and normalizing to a string name before calling trackPageView (use the string directly, otherwise use the component type’s .name).
        const activatedComponent = this.getActivatedComponent(this.route);
        if (activatedComponent) {
          this.appInsights.trackPageView({
            name: activatedComponent.name,
            uri: event.urlAfterRedirects,
          });

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

production: true,
// connectionString: 'YOUR CONNECTION STRING'
instrumentationKey: "instrumentationKey=abcd"
connectionString: 'instrumentationKey=abcd'
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

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

The sample connectionString value ('instrumentationKey=abcd') doesn’t match the typical Application Insights connection string format (e.g., InstrumentationKey=...;IngestionEndpoint=...). Since this file is intended as a production example, consider updating it to a correctly-formatted placeholder to avoid copy/paste misconfiguration.

Suggested change
connectionString: 'instrumentationKey=abcd'
connectionString: 'InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://YOUR-REGION.in.applicationinsights.azure.com/'

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This makes sense

Copy link
Copy Markdown
Member

@rads-1996 rads-1996 left a comment

Choose a reason for hiding this comment

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

LGTM

@MSNev MSNev merged commit 649a669 into main Apr 9, 2026
10 checks passed
@MSNev MSNev deleted the MSNev/UpdateComponents branch April 9, 2026 00:28
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.

4 participants