Skip to content

Feature/userinfo - #273

Open
JasonRobertFrancis wants to merge 48 commits into
mainfrom
feature/userinfo
Open

Feature/userinfo#273
JasonRobertFrancis wants to merge 48 commits into
mainfrom
feature/userinfo

Conversation

@JasonRobertFrancis

Copy link
Copy Markdown
Contributor

No description provided.

@codecov-commenter

codecov-commenter commented Jul 28, 2026

Copy link
Copy Markdown

Bundle Report

Bundle size has no change ✅

@codecov-commenter

codecov-commenter commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 10.40179% with 6400 lines in your changes missing coverage. Please review.
✅ Project coverage is 38.23%. Comparing base (394ae2d) to head (e39750e).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
web/Areas/Directory/Services/UserInfoService.cs 42.25% 753 Missing and 37 partials ⚠️
web/Areas/Directory/Views/UserInfo.cshtml 0.00% 501 Missing ⚠️
web/Models/PPS/VwUserinfoUser.cs 0.00% 149 Missing ⚠️
web/Models/PPS/PsJobV.cs 0.00% 125 Missing ⚠️
web/Models/PPS/JobDV.cs 0.00% 121 Missing ⚠️
web/Models/PPS/JpmJpItemDV.cs 0.00% 121 Missing ⚠️
web/Models/PPS/PositionDV.cs 0.00% 118 Missing ⚠️
web/Models/PPS/PsJpmJpItemsV.cs 0.00% 116 Missing ⚠️
web/Models/PPS/EdbperVc.cs 0.00% 104 Missing ⚠️
web/Models/PPS/VwAllJobPosOrg.cs 0.00% 102 Missing ⚠️
... and 190 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #273      +/-   ##
==========================================
- Coverage   41.88%   38.23%   -3.65%     
==========================================
  Files         986     1183     +197     
  Lines       49488    56796    +7308     
  Branches     5843     6173     +330     
==========================================
+ Hits        20726    21718     +992     
- Misses      27852    34102    +6250     
- Partials      910      976      +66     
Flag Coverage Δ
backend 36.20% <10.40%> (-3.74%) ⬇️
frontend 58.15% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
web/Areas/Directory/Models/IDCardResult.cs 100.00% <100.00%> (ø)
web/Areas/Directory/Models/InstinctResult.cs 100.00% <100.00%> (ø)
web/Areas/Directory/Models/LoanResult.cs 100.00% <100.00%> (ø)
.../Directory/Models/IndividualSearchResultWithIDs.cs 0.00% <0.00%> (ø)
web/Areas/Directory/Models/KeyResult.cs 83.33% <83.33%> (ø)
web/Areas/Directory/Models/LdapUserContact.cs 0.00% <0.00%> (ø)
web/Models/IDCards/DvtCardStatus.cs 80.00% <80.00%> (ø)
web/Models/EquipmentLoan/AppSetting.cs 0.00% <0.00%> (ø)
web/Models/EquipmentLoan/AssetType.cs 0.00% <0.00%> (ø)
web/Models/EquipmentLoan/O.cs 0.00% <0.00%> (ø)
... and 193 more

... and 51 files with indirect coverage changes

Comment thread test/Services/UserInfoServiceUnitTests.cs Fixed
Comment thread web/Areas/Directory/Services/UserInfoService.cs Fixed
Comment thread web/Areas/Directory/Services/UserInfoService.cs Fixed
Comment thread web/Areas/Directory/Services/UserInfoService.cs Fixed
Comment thread web/Areas/Directory/Services/UserInfoService.cs Fixed
Comment thread web/Classes/Utilities/IamApi.cs Fixed
Comment thread web/Areas/Directory/Services/UserInfoService.cs Fixed
Comment thread web/Areas/Directory/Services/UserInfoService.cs Fixed
Comment thread web/Areas/Directory/Services/UserInfoService.cs Fixed
Comment thread web/Areas/Directory/Views/UserInfo.cshtml Fixed

@github-advanced-security github-advanced-security AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

Comment thread web/Areas/Directory/Services/UserInfoService.cs Fixed
Comment thread web/Areas/Directory/Services/UserInfoService.cs Fixed
Comment thread web/Classes/Utilities/IamApi.cs Fixed
@rlorenzo

This comment was marked as resolved.

Comment thread web/Areas/Directory/Services/UserInfoService.cs Fixed
Comment thread web/Areas/Directory/Services/UserInfoService.cs Fixed
Comment thread web/Areas/Directory/Services/UserInfoService.cs Fixed
@rlorenzo

This comment was marked as resolved.

JasonRobertFrancis and others added 13 commits August 6, 2026 13:27
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
…ect'

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
…ect'

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
…ect'

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
…ect'

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
… IDisposable'

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Comment thread web/Areas/Directory/Services/UserInfoService.cs Fixed
Comment thread web/Areas/Directory/Services/UserInfoService.cs Fixed
Comment on lines +293 to +296
catch (Exception ex)
{
Console.WriteLine($"Warning: PopulateEmployeeInfoAsync failed: {ex.Message}");
}
Comment on lines +374 to +378
catch (Exception ex)
{
// Exceptions during student info retrieval are caught and ignored to allow other directory details to load.
Console.WriteLine($"Warning: PopulateStudentInfoAsync failed: {ex.Message}");
}
Comment thread web/Areas/Directory/Services/UserInfoService.cs Fixed
Comment thread web/Areas/Directory/Services/UserInfoService.cs Fixed
Comment thread web/Areas/Directory/Services/UserInfoService.cs Fixed
Comment thread web/Areas/Directory/Services/UserInfoService.cs Fixed
Comment thread web/Areas/Directory/Services/UserInfoService.cs Fixed
Comment thread web/Areas/Directory/Services/UserInfoService.cs Fixed
Comment thread web/Areas/Directory/Services/UserInfoService.cs Fixed
Comment on lines +1079 to +1083
catch (Exception ex)
{
Console.WriteLine($"IAM API EXCEPTION: {ex}");
// Log exception but don't fail the entire request
}
Comment on lines +1300 to +1303
catch (Exception ex)
{
Console.WriteLine($"Warning: PopulateUCPathInfoAsync failed: {ex.Message}");
}
Comment on lines +1339 to +1342
catch (Exception ex)
{
Console.WriteLine($"Warning: PopulateUCPathHistoryAsync failed: {ex.Message}");
}
Comment on lines +1373 to +1376
catch
{
// Return empty string on any error
}
Comment on lines +1411 to +1415
catch (Exception ex)
{
// Fall back to returning string.Empty if DB query fails.
Console.WriteLine($"Warning: GetReportsToTitleAsync failed: {ex.Message}");
}
Comment on lines +1460 to +1463
catch (Exception ex)
{
Console.WriteLine($"Warning: PopulateIDCardsAsync failed: {ex.Message}");
}
Comment on lines +1496 to +1499
catch (Exception ex)
{
Console.WriteLine($"Warning: PopulateKeysAsync failed: {ex.Message}");
}
Comment on lines +284 to +287
catch (Exception ex)
{
Console.WriteLine($"Warning: PopulateEmployeeInfoAsync failed: {ex.Message}");
}
Comment on lines +365 to +369
catch (Exception ex)
{
// Exceptions during student info retrieval are caught and ignored to allow other directory details to load.
Console.WriteLine($"Warning: PopulateStudentInfoAsync failed: {ex.Message}");
}
Comment on lines +1079 to +1083
catch (Exception ex)
{
Console.WriteLine($"IAM API EXCEPTION: {ex}");
// Log exception but don't fail the entire request
}
Comment on lines +1300 to +1303
catch (Exception ex)
{
Console.WriteLine($"Warning: PopulateUCPathInfoAsync failed: {ex.Message}");
}
Comment on lines +1339 to +1342
catch (Exception ex)
{
Console.WriteLine($"Warning: PopulateUCPathHistoryAsync failed: {ex.Message}");
}
Comment thread web/Areas/Directory/Services/UserInfoService.cs Fixed
Comment on lines +1561 to +1564
catch (Exception ex)
{
result.InstinctInfo = new InstinctResult { ErrorMessage = $"Populate Exception: {ex.Message}" };
}
Comment on lines +1650 to +1653
catch (Exception ex)
{
Console.WriteLine($"Error populating AD info: {ex.Message}");
}
Comment thread web/Areas/Directory/Services/UserInfoService.cs Fixed
Comment on lines +1883 to +1888
catch (Exception ex)
{
string errMsg = $"Token request exception: {ex.Message}";
Console.WriteLine($"[INSTINCT AUTH] {errMsg}");
AppendError(result, errMsg);
}
…ect'

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Comment on lines +1716 to +1725
foreach (var middleInitial in middleParts
.Where(middlePart => middlePart.Length > 0)
.Select(middlePart => middlePart[0]))
{
var variation = $"{name} {middleInitial}";
if (!nameVariations.Contains(variation))
{
nameVariations.Add(variation);
}
}
Comment thread web/Areas/Directory/Services/UserInfoService.cs Fixed
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 218 out of 220 changed files in this pull request and generated no new comments.

Suppressed comments (3)

web/Areas/Directory/Controllers/DirectoryController.cs:145

  • This refactor dropped the length guard that the original inline code (and the comment just below in AddVmacsContactInfoAsync) relied on. Nextel, LDPager, and Unit are string[]?, and empty XML element lists deserialize as empty (length‑0) arrays rather than null. With only a != null check, indexing [0] on an empty array will throw IndexOutOfRangeException. Restore the { Length: > 0 } guard (consistent with UserInfoService.cs which uses ?.Length > 0).
                if (vm.item.Nextel != null) result.Nextel = vm.item.Nextel[0];
                if (vm.item.LDPager != null) result.LDPager = vm.item.LDPager[0];
                if (vm.item.Unit != null) result.Department = vm.item.Unit[0];

web/Areas/Directory/Models/IndividualSearchResultWithIDs.cs:49

  • LdapUserContact.PostalAddress is declared = null! and is only assigned when the LDAP entry contains a postalAddress attribute, so it can be null at runtime. Removing the null guard here means PostalAddress.Replace(...) can throw a NullReferenceException. Note the base IndividualSearchResult constructor already uses the null-safe form (?.Replace(...) ?? ""); this override should match it.
                PostalAddress = ldapUserContact.PostalAddress.Replace("$", '\n'.ToString());

web/Classes/Utilities/LdapService.cs:123

  • The param documentation is inaccurate: this method looks up by MothraID (the filter uses ucdpersonuuid, which maps to LdapUserContact.MothraId), not by iamID. Describing the parameter as "iamID" could lead callers to pass the wrong identifier.

Comment on lines +1569 to +1572
catch (Exception ex)
{
result.InstinctInfo = new InstinctResult { ErrorMessage = $"Populate Exception: {ex.Message}" };
}
@@ -113,6 +136,24 @@ public IActionResult DirectoryResult(string mothraID)
return View("~/Areas/Directory/Views/UserInfo.cshtml");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JasonRobertFrancis This returns UserInfo.cshtml with no model, but the view is @model UserInfoResult and dereferences Model.DisplayFullName on line 3. Every request to /Directory/userInfo/{mothraID} is a 500. UserInfoController supersedes it and Card.cshtml now links to /UserInfo/{mothraId}, so this should be deleted.

Comment on lines +77 to +82
Console.WriteLine($"[INSTINCT SERVICE] mothraId: '{mothraId}', iamId: '{iamId}', result.MothraId: '{result.MothraId}'");
var individual = await _aaudContext.AaudUsers.FirstOrDefaultAsync(u => (u.MothraId == result.MothraId));
Console.WriteLine($"[INSTINCT SERVICE] individual is null: {individual == null}");
if (individual != null)
{
Console.WriteLine($"[INSTINCT SERVICE] individual: '{individual.DisplayFullName}', LastName: '{individual.LastName}', FirstName: '{individual.FirstName}'");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JasonRobertFrancis These run on every user info page load and write mothraId, iamId, and the person's full name to stdout. Looks like leftover debugging from the Instinct work. There are 30 Console.WriteLine calls in this file and no ILogger at all. Please drop the debug ones and move the rest to an injected logger, running route input through LogSanitizer first.

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

Successfully merging this pull request may close these issues.

6 participants