Skip to content
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

[gei] Align code and tests for secret scanning and code scanning #1248

Open
dlinares-linux opened this issue May 21, 2024 · 0 comments
Open

Comments

@dlinares-linux
Copy link

Description

Following the review done #1241, some potential improvement have been identified, aligning the code and tests for secret scanning and code scanning.

Changes

Use default null value instead of string.Empty

  • for the secret scanning resolution_comment
  • for the code scanning dismissed_comment (example of patch below to check)
       var payload = state == "open"
            ? (new { state })
            : (object)(new
            {
                state,
                dismissed_reason = dismissedReason,
---             dismissed_comment = dismissedComment ?? string.Empty
+++             dismissed_comment = dismissedComment
            });
        await _client.PatchAsync(url, payload);

Remove null to string.Empty conversion tests

Following the change done above, the following tests could probably be deleted:

  • UpdateSecretScanningAlert_Replaces_Null_Resolution_Comment_With_Empty_String()
  • UpdateCodeScanningAlert_Replaces_Null_Dismissed_Comment_With_Empty_String()
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

No branches or pull requests

1 participant