Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes an incorrect warning emitted by start-proxy when credentials use a PAT-like token with a configured username, and expands unit test coverage to validate the corrected behavior.
Changes:
- Adjust PAT-warning logic in
getCredentialsto only warn when a PAT is used and no username is provided. - Refactor/add test utilities (
RecordingLogger.hasMessage,assertNotLogged) and expandgetCredentialstests to cover username/no-username combinations. - Add a VS Code snippet file (unrelated to the warning fix).
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/start-proxy.ts | Fixes the PAT warning condition to account for username presence for both token and password configs. |
| src/start-proxy.test.ts | Adds macro-based tests covering PAT warning behavior with/without usernames for token and password inputs. |
| src/testing-utils.ts | Enhances the recording logger with message-search helpers and adds a negative-log assertion helper. |
| lib/start-proxy-action.js | Generated output reflecting the src/start-proxy.ts change. |
| .vscode/tests.code-snippets | Adds an editor snippet (not directly related to the PR’s stated purpose). |
Comment on lines
+271
to
+275
| const check = (val: string) => | ||
| typeof messageOrRegExp === "string" | ||
| ? val.includes(messageOrRegExp) | ||
| : messageOrRegExp.test(val); | ||
|
|
| * one of the `messages` matches `messageOrRegExp`. | ||
| */ | ||
| hasMessage(messageOrRegExp: string | RegExp): boolean { | ||
| return hasLoggedMessage(this.messages, messageOrRegExp); |
| }, | ||
|
|
||
| title: (providedTitle = "") => | ||
| `getCredentials logs a warning when a PAT is used - ${providedTitle}`, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This was missed in #3563 and caught in #3577 (comment).
Risk assessment
For internal use only. Please select the risk level of this change:
Which use cases does this change impact?
Workflow types:
dynamicworkflows (Default Setup, Code Quality, ...).Products:
analysis-kinds: code-scanning.analysis-kinds: code-quality.Environments:
github.comand/or GitHub Enterprise Cloud with Data Residency.How did/will you validate this change?
.test.tsfiles).pr-checks).If something goes wrong after this change is released, what are the mitigation and rollback strategies?
How will you know if something goes wrong after this change is released?
Are there any special considerations for merging or releasing this change?
Merge / deployment checklist