Skip to content

Commit 69bb49e

Browse files
devversionalxhub
authored andcommitted
refactor(dev-infra): cleanup comments in git utilities (angular#38656)
Cleans up outdated comments in the shared dev-infra Git utilities. We also export the Graphql client for consistency as we expose the `GithubClient` and `GitClient` too. PR Close angular#38656
1 parent 9dccaa9 commit 69bb49e

File tree

2 files changed

+12
-15
lines changed

2 files changed

+12
-15
lines changed

dev-infra/utils/git/github.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,18 +69,13 @@ export class GithubClient extends Octokit {
6969
}
7070

7171
/**
72-
* An object representation of a GraphQL Query to be used as a response type and to generate
73-
* a GraphQL query string.
72+
* An object representation of a GraphQL Query to be used as a response type and
73+
* to generate a GraphQL query string.
7474
*/
75-
type GraphQLQueryObject = Parameters<typeof query>[1];
75+
export type GraphQLQueryObject = Parameters<typeof query>[1];
7676

77-
/**
78-
* A client for interacting with Github's GraphQL API.
79-
*
80-
* This class is intentionally not exported as it should always be access/used via a
81-
* _GithubClient instance.
82-
*/
83-
class GithubGraphqlClient {
77+
/** A client for interacting with Github's GraphQL API. */
78+
export class GithubGraphqlClient {
8479
/** The Github GraphQL (v4) API. */
8580
private graqhql = graphql;
8681

dev-infra/utils/git/index.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@ export class GitCommandError extends Error {
3333
}
3434

3535
/**
36-
* Common client for performing Git interactions.
36+
* Common client for performing Git interactions with a given remote.
3737
*
3838
* Takes in two optional arguments:
39-
* _githubToken: the token used for authentifation in github interactions, by default empty
39+
* `githubToken`: the token used for authentication in Github interactions, by default empty
4040
* allowing readonly actions.
41-
* _config: The dev-infra configuration containing GitClientConfig information, by default
42-
* loads the config from the default location.
41+
* `config`: The dev-infra configuration containing information about the remote. By default
42+
* the dev-infra configuration is loaded with its Github configuration.
4343
**/
4444
export class GitClient {
45-
/** Short-hand for accessing the remote configuration. */
45+
/** Short-hand for accessing the default remote configuration. */
4646
remoteConfig = this._config.github;
4747
/** Octokit request parameters object for targeting the configured remote. */
4848
remoteParams = {owner: this.remoteConfig.owner, repo: this.remoteConfig.name};
@@ -91,6 +91,8 @@ export class GitClient {
9191
// commands unless the `stdio` is explicitly to `ignore` (which is equivalent to silent).
9292
// Note that we do not want to print the token if is contained in the command. It's common
9393
// to share errors with others if the tool failed, and we do not want to leak tokens.
94+
// TODO: Add support for configuring this on a per-client basis. Some tools do not want
95+
// to print the Git command messages to the console at all (e.g. to maintain clean output).
9496
const printFn = options.stdio !== 'ignore' ? info : debug;
9597
printFn('Executing: git', this.omitGithubTokenFromMessage(args.join(' ')));
9698

0 commit comments

Comments
 (0)