Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Sep 25, 2025

Problem

The @internal JSDoc tag was being used inappropriately throughout the Identity packages. By definition, @internal indicates that a reflection is not intended to be used by API consumers and should only be used for exported members that are truly internal to the package. However, many non-exported interfaces, classes, functions, and constants were incorrectly marked with @internal.

Solution

This PR systematically removes inappropriate @internal tags from non-exported members across all Identity packages while preserving legitimate usage on exported members that are not re-exported in index.ts.

Files Modified

  • Main Identity Package (@azure/identity):

    • src/credentials/defaultAzureCredential.ts - Removed @internal from non-exported validateRequiredEnvVars function
    • src/msal/browserFlows/msalBrowserCommon.ts - Removed @internal from non-exported generateMsalBrowserConfiguration function
    • src/msal/nodeFlows/msalClient.ts - Removed @internal from non-exported MsalClientState interface and createBaseInteractiveRequest function
    • src/msal/utils.ts - Removed @internal from non-exported constants like logger and LatestAuthenticationRecordVersion
    • src/plugins/consumer.ts - Removed @internal from non-exported pluginContext constant
  • Supporting Packages:

    • @azure/identity-broker - Removed @internal from non-exported AzurePluginContext interface
    • @azure/identity-cache-persistence - Removed @internal from non-exported constants, types, and functions
    • @azure/identity-vscode - Removed @internal from non-exported AzurePluginContext interface

Examples of Changes

Before:

/**
 * @internal
 */
const logger = credentialLogger("IdentityUtils");

After:

const logger = credentialLogger("IdentityUtils");

What Remains

The @internal tag is still appropriately used on exported members that are not re-exported in index.ts, such as exported utility functions and interfaces that are internal to the package but exported from their individual modules.

Validation

  • ✅ All existing linting rules pass with no new errors
  • ✅ No security vulnerabilities introduced
  • ✅ Only legitimate @internal tags remain on exported members
  • ✅ 12 inappropriate usages removed from non-exported members across 8 files

This change improves JSDoc consistency and ensures proper adherence to documentation standards by removing inappropriate @internal tags from non-exported members while maintaining backward compatibility.

Original prompt

This section details on the original issue you should resolve

<issue_title>[Identity] Remove Incorrect Use of @internal</issue_title>
<issue_description>Remove inappropriate use of the @internal tag in JS Doc inside the Identity repo. By definition, The @internal tag indicates that a reflection is not intended to be used by API consumers. Any usage for @internal in JS Doc for non-exported member is inappropriate. Ensure exported member are either exported in index.ts or used in the test folder.</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #36049

💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI changed the title [WIP] [Identity] Remove Incorrect Use of @internal [Identity] Remove inappropriate @internal tags from exported members Sep 25, 2025
Copilot AI requested a review from minhanh-phan September 25, 2025 22:48
Copilot finished work on behalf of minhanh-phan September 25, 2025 22:48
@minhanh-phan
Copy link
Member

@copilot Undo all the whitespace changes. Lots of @internal tags are removed incorrectly for exported members.

Copy link
Contributor Author

Copilot AI commented Sep 25, 2025

@copilot Undo all the whitespace changes. Lots of @internal tags are removed incorrectly for exported members.

I've corrected the implementation. I reverted all the previous changes and now only removed @internal tags from non-exported members (12 instances total). I avoided all whitespace changes and correctly kept @internal tags on exported members that aren't re-exported in index.ts. The fix is now surgical and minimal as requested. Commit: 6105810

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/Azure/Azure%2Fazure-sdk-for-js/languages
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [Identity] Remove inappropriate @internal tags from exported members [Identity] Remove inappropriate @internal tags from non-exported members Sep 25, 2025
Copilot finished work on behalf of minhanh-phan September 25, 2025 23:25
@minhanh-phan minhanh-phan marked this pull request as ready for review September 29, 2025 17:03
Copilot AI review requested due to automatic review settings September 29, 2025 17:03
@minhanh-phan minhanh-phan requested review from a team and maorleger as code owners September 29, 2025 17:03
Copy link
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

This PR removes inappropriate uses of the @internal JSDoc tag from non-exported members across Azure Identity packages. The @internal tag is meant to indicate that exported members are not intended for public API consumption, but it was incorrectly applied to non-exported functions, interfaces, constants, and types that are already private by nature.

  • Removed @internal tags from 12 non-exported members across 8 files
  • Maintained proper JSDoc documentation while adhering to documentation standards
  • Preserved legitimate @internal usage on exported members not re-exported in index.ts

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
sdk/identity/identity/src/plugins/consumer.ts Removed @internal from non-exported pluginContext constant
sdk/identity/identity/src/msal/utils.ts Removed @internal from non-exported logger constant and LatestAuthenticationRecordVersion constant
sdk/identity/identity/src/msal/nodeFlows/msalClient.ts Removed @internal from non-exported MsalClientState interface and createBaseInteractiveRequest function
sdk/identity/identity/src/msal/browserFlows/msalBrowserCommon.ts Removed @internal from non-exported generateMsalBrowserConfiguration function
sdk/identity/identity/src/credentials/defaultAzureCredential.ts Removed @internal from non-exported validateRequiredEnvVars function
sdk/identity/identity-vscode/src/index.ts Removed @internal from non-exported AzurePluginContext interface
sdk/identity/identity-cache-persistence/src/platforms.ts Removed @internal from non-exported constants and functions
sdk/identity/identity-broker/src/index.ts Removed @internal from non-exported AzurePluginContext interface

@minhanh-phan minhanh-phan enabled auto-merge (squash) October 3, 2025 19:36
@minhanh-phan
Copy link
Member

/check-enforcer evaluate

@minhanh-phan minhanh-phan merged commit 259da84 into main Oct 3, 2025
23 checks passed
@minhanh-phan minhanh-phan deleted the copilot/fix-9b7db221-b9e6-4ced-bd5b-c6651239d495 branch October 3, 2025 19:52
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.

[Identity] Remove Incorrect Use of @internal

4 participants