Skip to content

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

Open
@dlinares-linux

Description

@dlinares-linux

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()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions