-
Notifications
You must be signed in to change notification settings - Fork 509
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 Gitlab: Commit/Commitor Exceptions (#3026)
* feat: Added paging for contributor/users against gitlab projects Signed-off-by: Robison, Jim B <[email protected]> * refactor: Updated the bot flag for unmatched users Signed-off-by: Robison, Jim B <[email protected]> * fix: Not all commit users are in the git registry instance Signed-off-by: Robison, Jim B <[email protected]> * fix: Skipping check if the email is empty, as well as if the "email" doesn't contain a "." char. Signed-off-by: Robison, Jim B <[email protected]> * fix: Updated to allow for commits with PRs to be accounted/added to the client.commits Signed-off-by: Robison, Jim B <[email protected]> * refactor: Updated to prevent linting issue regarding nested if's Signed-off-by: Robison, Jim B <[email protected]> * test: Adding coverage for commits and contributors for gitlab Signed-off-by: Robison, Jim B <[email protected]> * refactor: Moved queries from the client to their own functions Signed-off-by: Robison, Jim B <[email protected]> * bug: Need to pass the ProjectID value to the contributor query Signed-off-by: Robison, Jim B <[email protected]> * bug: Updating project title versus projectID values for api querying Signed-off-by: Robison, Jim B <[email protected]> * test: Updated tests to match expected property set for projectID Signed-off-by: Robison, Jim B <[email protected]> * revert: Reverted based on feedback during review Signed-off-by: Robison, Jim B <[email protected]> --------- Signed-off-by: Robison, Jim B <[email protected]>
- Loading branch information
1 parent
ad161bb
commit 03dc18d
Showing
19 changed files
with
307 additions
and
66 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,3 +62,42 @@ func Test_Setup(t *testing.T) { | |
}) | ||
} | ||
} | ||
|
||
func TestParsingEmail(t *testing.T) { | ||
t.Parallel() | ||
|
||
tests := []struct { | ||
name string | ||
email string | ||
expected string | ||
}{ | ||
{ | ||
name: "Perfect Match Email Parser", | ||
email: "[email protected]", | ||
expected: "john doe", | ||
}, | ||
{ | ||
name: "Valid Email Not Formatted as expected", | ||
email: "[email protected]", | ||
expected: "johndoe@nowhere com", | ||
}, | ||
{ | ||
name: "Invalid email format", | ||
email: "johndoe@nowherecom", | ||
expected: "johndoe@nowherecom", | ||
}, | ||
} | ||
|
||
for _, tt := range tests { | ||
tt := tt | ||
|
||
t.Run(tt.name, func(t *testing.T) { | ||
t.Parallel() | ||
result := parseEmailToName(tt.email) | ||
|
||
if tt.expected != result { | ||
t.Errorf("Parser didn't work as expected: %s != %s", tt.expected, result) | ||
} | ||
}) | ||
} | ||
} |
This file contains 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
Oops, something went wrong.