Skip to content

Commit 953f3e3

Browse files
calin-lupas_dsamcapscalin-lupas_dsamcaps
authored andcommitted
#39 Update localization and improve membership validation
- Added "within the organization" to error messages for non-existent team members in French and English localization files. - Enhanced logging in `DevExIssuesEventProcessorService.cs` to specify "Issue Comment" for bot events. - Modified membership check in `TeamService.cs` to use `GetOrganizationMembership` for more accurate validation.
1 parent 864e9a5 commit 953f3e3

4 files changed

Lines changed: 5 additions & 6 deletions

File tree

src/DevExcelerateApi/Resources/Services.LocalizationService.fr.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@
187187
<value>Cette équipe existe déjà au sein de l'organisation.</value>
188188
</data>
189189
<data name="ERROR_TEAM_MEMBER_DOES_NOT_EXISTS" xml:space="preserve">
190-
<value>Le membre d'équipe {0} n'existe pas.</value>
190+
<value>Le membre d'équipe {0} n'existe pas au sein de l'organisation.</value>
191191
</data>
192192
<data name="ERROR_INVAILD_REPO_NAME" xml:space="preserve">
193193
<value>Le nom du dépôt '{0}' est invalide.</value>

src/DevExcelerateApi/Resources/Services.LocalizationService.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@
187187
<value>This team name already exists within the organization.</value>
188188
</data>
189189
<data name="ERROR_TEAM_MEMBER_DOES_NOT_EXISTS" xml:space="preserve">
190-
<value>The team member {0} does not exist.</value>
190+
<value>The team member {0} does not exist within the organization.</value>
191191
</data>
192192
<data name="ERROR_INVAILD_REPO_NAME" xml:space="preserve">
193193
<value>The repository name '{0}' is invalid.</value>

src/DevExcelerateApi/Services/DevExIssuesEventProcessorService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public async Task SaveAndProcessIssueCommentEventAsync(WebhookHeaders headers, I
5757
// Validate if the issue comment is from a user vs bot
5858
if (issueCommentEvent?.Sender?.Type == UserType.Bot)
5959
{
60-
_logger.LogInformation("Bypassing GitHub Webhook event for Issue# {number} with action - {action}...", issueCommentEvent?.Issue.Number, issueCommentEvent?.Action);
60+
_logger.LogInformation("Bypassing GitHub Webhook Issue Comment event (Bot) for Issue# {number} with action - {action}...", issueCommentEvent?.Issue.Number, issueCommentEvent?.Action);
6161
return;
6262
}
6363

src/DevExcelerateApi/Services/TeamService.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,8 @@ public async Task ValidateTeam(IssuesEvent issuesEvent, bool createPullRequest)
143143
{
144144
try
145145
{
146-
// Check if the member exists
147-
await gitHubClient.User.Get(member);
148-
//await gitHubClient.Organization.Member.GetOrganizationMembership(teamRequest.TeamOwner, member);
146+
// Check if the member exists within the organization
147+
await gitHubClient.Organization.Member.GetOrganizationMembership(teamRequest.TeamOwner, member);
149148
}
150149
catch (NotFoundException)
151150
{

0 commit comments

Comments
 (0)