From 0e4288326ff3878b934806b9309c534ec8131b3f Mon Sep 17 00:00:00 2001 From: rulasg Date: Tue, 9 Sep 2025 12:27:00 +0200 Subject: [PATCH 01/11] docs(.github): add Copilot usage, commit message, and PR description instructions --- .../copilot-commit-message-instructions.md | 34 ++++++++++++++ .github/copilot-instructions.md | 44 +++++++++++++++++++ ...t-pull-request-description-instructions.md | 44 +++++++++++++++++++ 3 files changed, 122 insertions(+) create mode 100644 .github/copilot-commit-message-instructions.md create mode 100644 .github/copilot-instructions.md create mode 100644 .github/copilot-pull-request-description-instructions.md diff --git a/.github/copilot-commit-message-instructions.md b/.github/copilot-commit-message-instructions.md new file mode 100644 index 0000000..2297468 --- /dev/null +++ b/.github/copilot-commit-message-instructions.md @@ -0,0 +1,34 @@ +# Semantic Commit Messages + +See how a minor change to your commit message style can make you a better programmer. + +Format: `(): ` + +`` is optional + +## Example + +``` +feat: add hat wobble +^--^ ^------------^ +| | +| +-> Summary in present tense. +| ++-------> Type: chore, docs, feat, fix, refactor, style, or test. +``` + +More Examples: + +- `feat`: (new feature for the user, not a new feature for build script) +- `fix`: (bug fix for the user, not a fix to a build script) +- `docs`: (changes to the documentation) +- `style`: (formatting, missing semi colons, etc; no production code change) +- `refactor`: (refactoring production code, eg. renaming a variable) +- `test`: (adding missing tests, refactoring tests; no production code change) +- `chore`: (updating grunt tasks etc; no production code change) + +References: + +- https://www.conventionalcommits.org/ +- https://seesparkbox.com/foundry/semantic_commit_messages +- http://karma-runner.github.io/1.0/dev/git-commit-msg.html diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 0000000..aea90af --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,44 @@ +# Copilot Instructions + +## Powershell Modules Code Instructions + +### PowerShell Functions Instructions + +Every powershell function will contain the `CmdletBinding` attribute and the `parm`iven if there are no parameters. +If the function is on the public folder of the module, we will add the Èxport-ModuleFunction` statement in the same line as the closing `}` of the function + +Sample of function will be: + +```powershell + +function Get-UserName{ + [CmdletBinding()] + param() + + #Logic of the function +} Export-ModuleFunction -FunctionName 'Get-UserName' +``` + +### PowerShell Test Instructions + +Every public function on the Test module will have the following format + +- Name will start with `Test_` will follow the name of the function that we are testing with no '-'. It will follow the intention of the test splited with a '_' +- Every time we create a new function with no body we will add the `Assert-NotImplemented` statement at the end +- We will add the 3 sections as with comments `Arrange`, `Act` and `Assert` to make the test more readable. +- Sample of a test function to test `Get-UserName` function will be `Test_GetUserName_UserNotFound` + +Full sample will be as follows + +```powershell +function Test_GetUserName_UserNotFound{ + + # Arrange + + # Act + + # Assert + + Assert-NotImplemented +} +``` diff --git a/.github/copilot-pull-request-description-instructions.md b/.github/copilot-pull-request-description-instructions.md new file mode 100644 index 0000000..31a8730 --- /dev/null +++ b/.github/copilot-pull-request-description-instructions.md @@ -0,0 +1,44 @@ +# Pull Request Code Instructions + +## PR TITLE + +Follow this guidelines to construct the title of your pull request. + +Format: `(): ` + +`` is optional + +## Example + +``` +feat: add hat wobble +^--^ ^------------^ +| | +| +-> Summary in present tense. +| ++-------> Type: chore, docs, feat, fix, refactor, style, or test. +``` + +More Examples: + +- `feat`: (new feature for the user, not a new feature for build script) +- `fix`: (bug fix for the user, not a fix to a build script) +- `docs`: (changes to the documentation) +- `style`: (formatting, missing semi colons, etc; no production code change) +- `refactor`: (refactoring production code, eg. renaming a variable) +- `test`: (adding missing tests, refactoring tests; no production code change) +- `chore`: (updating grunt tasks etc; no production code change) + +References: + +- https://www.conventionalcommits.org/ +- https://seesparkbox.com/foundry/semantic_commit_messages +- http://karma-runner.github.io/1.0/dev/git-commit-msg.html + +## Pull Reques description + +- Add a summery of the intention of the PR. Use the title and the messages of the commits to create a summary. +- Add a list with all the commit messages in the PR. + + + From 526669022f3e5d7a3d72dbce7dd08f5bc6bec621 Mon Sep 17 00:00:00 2001 From: rulasg Date: Tue, 9 Sep 2025 12:27:20 +0200 Subject: [PATCH 02/11] fix(getNotes): sort returned notes by Name in descending order --- public/getNotes.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/getNotes.ps1 b/public/getNotes.ps1 index d841e61..045d531 100644 --- a/public/getNotes.ps1 +++ b/public/getNotes.ps1 @@ -40,7 +40,7 @@ function Get-Notes () { } # Sort by Parent name - $ret = $ret | Sort-Object -Property Category + $ret = $ret | Sort-Object -Property Name -Descending return $ret From d58939a1cc43319ce8ea1189146c64251d4010ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20=28Dibildos=29=20Gonz=C3=A1lez?= Date: Tue, 16 Sep 2025 15:32:56 +0200 Subject: [PATCH 03/11] refactor(getNotes): add warning when empty notes list --- public/getNotes.ps1 | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/public/getNotes.ps1 b/public/getNotes.ps1 index 045d531..60bf492 100644 --- a/public/getNotes.ps1 +++ b/public/getNotes.ps1 @@ -34,7 +34,7 @@ function Get-Notes () { $ret = $ret | ForEach-Object { [PSCustomObject]@{ Name = $_ | Split-Path -Leaf - Category = $_ | Get-NotesCategory + Category = $_ | GetNotesCategory FullName = $_.FullName } } @@ -42,6 +42,11 @@ function Get-Notes () { # Sort by Parent name $ret = $ret | Sort-Object -Property Name -Descending + #if $ret is empty and $all is not set write a message sugesting to use -All + if (-not $All -and $ret.Count -eq 0) { + Write-Host "No notes found in the last 30 days. Use -All to see all notes." -ForegroundColor Yellow + } + return $ret } Export-ModuleMember -Function Get-Notes -Alias "notes" @@ -62,7 +67,7 @@ function GetNotes () { } -function Get-NotesCategory { +function GetNotesCategory { [CmdletBinding()] param( [Parameter(Mandatory,ValueFromPipeline)][object]$Path @@ -74,4 +79,4 @@ function Get-NotesCategory { -} Export-ModuleMember -Function Get-NotesCategory \ No newline at end of file +} \ No newline at end of file From 7af218084f6a540c2cb3b7885099a95064cdaf81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20=28Dibildos=29=20Gonz=C3=A1lez?= Date: Wed, 8 Oct 2025 09:47:55 +0200 Subject: [PATCH 04/11] refactor(newNotes): New-Note and refactor --- private/resolveNotesPath.ps1 | 1 + public/newNotes.ps1 | 130 ++++++++++++++++++++++++ public/notes/templates/none.template.md | 7 -- 3 files changed, 131 insertions(+), 7 deletions(-) diff --git a/private/resolveNotesPath.ps1 b/private/resolveNotesPath.ps1 index d6662bd..82dbe90 100644 --- a/private/resolveNotesPath.ps1 +++ b/private/resolveNotesPath.ps1 @@ -36,6 +36,7 @@ function Get-NoteFolder{ $notesPath = $notesPath | Join-Path -ChildPath $Category } + # Add the section if needed if(-Not [string]::IsNullOrWhiteSpace($Section)) { $notesPath = $notesPath | Join-Path -ChildPath $Section } diff --git a/public/newNotes.ps1 b/public/newNotes.ps1 index 34094af..b782273 100644 --- a/public/newNotes.ps1 +++ b/public/newNotes.ps1 @@ -1,3 +1,133 @@ + +function New-Note{ + # Add Force parameter to support creation of client folder if it doesn't exist + [CmdletBinding()] + [alias("note")] + param( + [Parameter(Mandatory,Position = 0)][string] $Category, + [Parameter(Mandatory,Position = 1)][string] $Title, + [Parameter()][string] $Date, + [Parameter()][string] $Section, + [Parameter()][string] $Notes, + [Parameter()][string] $IssueUrl, + [Parameter()][string] [ValidateSet("none","meetingmini")] $Template = "none", + [Parameter()][switch] $NoOpen, + [Parameter()][switch] $AvoidChildFolder, + [Parameter()][switch] $Force + ) + + # FILENAME + + $folder = Get-NoteFolder -Category $Category -Section $Section -Force:$Force + + if(-Not $folder) { + Write-Error "Failed to create the folder for the note. Try -Force." + return + } + + if(-Not (Test-Path -Path $folder)) { + Write-Error "Base folder for note does not exist '$folder'. Try -Force." + return + } + + $fullTitle = getFullTitle $Category $Section $Title $Date + + # Create the note base folder + if($AvoidChildFolder){ + # use folder as the parent folder of the note + $fullPath = Join-Path -Path $folder -ChildPath "$fullTitle.md" + } else { + # Create full path for the note file + $noteFolder = Join-Path -Path $folder -ChildPath $fullTitle + + if (-not (Test-Path -Path $noteFolder)) { + New-Item -Path $noteFolder -ItemType Directory -Force | Out-Null + Write-Verbose "Created note folder: $noteFolder" + } + + $fullPath =$noteFolder | Join-Path -ChildPath "$fullTitle.md" + } + + # Check if file already exists + if (-Not (Test-Path -Path $fullPath)) { + + $header = [string]::IsNullOrWhiteSpace($Section) ? $Category : $Section + + $content = getFileContent $Template $Title $header -Notes $Notes -IssueUrl $IssueUrl + + # If $Force check that the folders of $fullPath exists and if not create it + if ($Force) { + $parentFolder = Split-Path -Path $fullPath -Parent + if (-Not (Test-Path -Path $parentFolder)) { + New-Item -Path $parentFolder -ItemType Directory -Force | Out-Null + Write-Verbose "Created folder: $parentFolder" + } + } + + # Create the file with content + Set-Content -Path $fullPath -Value $content -Force + } + + if( -not $NoOpen) { + # Open file in VS Code with cursor at the end + $gotocmd = "{0}{1}" -f $fullPath, ":9999" + code --goto $gotocmd + } + + # Return file just created + return $fullPath + +} Export-ModuleMember -Function New-Note -Alias "note" + +function getFullTitle{ + [CmdletBinding()] + param( + [Parameter(Mandatory,Position=0)][string] $Category, + [Parameter(Mandatory,Position=1)][string] $Section, + [Parameter(Mandatory,Position=2)][string] $Title, + [Parameter(Position=3)][string] $Date + ) + + # Create FullTitle using folder name and title, replacing spaces with underscores + + $header = [string]::IsNullOrWhiteSpace($Section) ? $Category : $Section + + if([string]::IsNullOrWhiteSpace($Date)) { + $fullTitle = "{0}-{1}" -f $header, $Title + } else{ + $fullTitle = "{0}-{1}-{2}" -f $Date, $header, $Title + } + + # Normilize fullTitle by removing special characters and replacing spaces with underscores + $fullTitle = $fullTitle -replace '\s+', '_' + + return $fullTitle +} + +function getFileContent{ + [CmdletBinding()] + param( + [Parameter(Mandatory,Position = 0)][string] $Template, + [Parameter(Mandatory,Position = 1)][string] $Title, + [Parameter(Mandatory,Position = 2)][string] $header, + [Parameter(Position = 3)][string] $Date, + [Parameter()][string] $Notes, + [Parameter()][string] $IssueUrl + ) + + # Get template content + $content = Get-TemplatePath $Template | Get-FileContent + + # Replace placeholders in the template with actual values + $content = $content -replace '{title}' , $Title + $content = $content -replace '{header}' , $header + $content = $content -replace '{date}' , $Date + $content = $content -replace '{notes}' , ([string]::IsNullOrWhiteSpace($Notes) ? '-' : $Notes) + $content = $content -replace '{issueurl}' , ([string]::IsNullOrWhiteSpace($IssueUrl) ? '' : $IssueUrl) + + return $content +} + function New-NoteToday{ # Add Force parameter to support creation of client folder if it doesn't exist [CmdletBinding()] diff --git a/public/notes/templates/none.template.md b/public/notes/templates/none.template.md index 27e88b1..bf534d6 100644 --- a/public/notes/templates/none.template.md +++ b/public/notes/templates/none.template.md @@ -2,10 +2,3 @@ > {issueurl} -## Notes - -{notes} - -## Next Steps - -- \ No newline at end of file From 167831a4a7e55bc91d6110fbc46970d3352c62e7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 1 Dec 2025 14:57:21 +0000 Subject: [PATCH 05/11] Initial plan From c2e049670c86aea3e1fa5c8d664c8fe1b9960ec1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 1 Dec 2025 15:06:45 +0000 Subject: [PATCH 06/11] Add Convert-MeetingMembersToMarkdown cmdlet with helper functions and tests Co-authored-by: rulasg <6884408+rulasg@users.noreply.github.com> --- .../convertMeetingMembersToMarkdown.test.ps1 | 163 ++++++++++++++++++ private/parseMemberEmail.ps1 | 76 ++++++++ public/convertMeetingMembersToMarkdown.ps1 | 59 +++++++ 3 files changed, 298 insertions(+) create mode 100644 Test/public/convertMeetingMembersToMarkdown.test.ps1 create mode 100644 private/parseMemberEmail.ps1 create mode 100644 public/convertMeetingMembersToMarkdown.ps1 diff --git a/Test/public/convertMeetingMembersToMarkdown.test.ps1 b/Test/public/convertMeetingMembersToMarkdown.test.ps1 new file mode 100644 index 0000000..a98364a --- /dev/null +++ b/Test/public/convertMeetingMembersToMarkdown.test.ps1 @@ -0,0 +1,163 @@ +$TESTED_MODULE_PATH = $PSScriptRoot | split-path -Parent | split-path -Parent + +function Test_ConvertMeetingMembersToMarkdown_SingleCompany { + + # Arrange + $testedModulePath = $TESTED_MODULE_PATH | Join-Path -ChildPath "NotesHelper.psd1" + $testedModule = Import-Module -Name $testedModulePath -Force -PassThru + + $input = "Gisela Torres <0gis0@github.com>, `"David (GitHub) Losert`" " + + # Act + $result = & $testedModule { + param($input) + Convert-MeetingMembersToMarkdown -MeetingMembers $input + } -args $input + + # Assert + $expected = @" +- Github + - Gisela Torres <0gis0@github.com> + - "David (GitHub) Losert" +"@ + Assert-AreEqual -Expected $expected -Presented $result -Comment "Single company output should match expected format" +} + +function Test_ConvertMeetingMembersToMarkdown_MultipleCompanies { + + # Arrange + $testedModulePath = $TESTED_MODULE_PATH | Join-Path -ChildPath "NotesHelper.psd1" + $testedModule = Import-Module -Name $testedModulePath -Force -PassThru + + $input = "Gisela Torres <0gis0@github.com>, `"David (GitHub) Losert`" , Gisela Torres , `"Martin Fernandez, Borja`" , `"Jovanovic Obradovic, Mat`" , `"Molina Merchan, Jesus`" " + + # Act + $result = & $testedModule { + param($input) + Convert-MeetingMembersToMarkdown -MeetingMembers $input + } -args $input + + # Assert + $expected = @" +- Github + - Gisela Torres <0gis0@github.com> + - "David (GitHub) Losert" +- Mapfre + - "Martin Fernandez, Borja" + - "Jovanovic Obradovic, Mat" + - "Molina Merchan, Jesus" +- Microsoft + - Gisela Torres +"@ + Assert-AreEqual -Expected $expected -Presented $result -Comment "Multiple companies should be sorted alphabetically" +} + +function Test_ConvertMeetingMembersToMarkdown_DuplicateMemberDifferentCompanies { + + # Arrange + $testedModulePath = $TESTED_MODULE_PATH | Join-Path -ChildPath "NotesHelper.psd1" + $testedModule = Import-Module -Name $testedModulePath -Force -PassThru + + $input = "Gisela Torres <0gis0@github.com>, Gisela Torres " + + # Act + $result = & $testedModule { + param($input) + Convert-MeetingMembersToMarkdown -MeetingMembers $input + } -args $input + + # Assert + # Same person with different emails should appear in both company groups + $expected = @" +- Github + - Gisela Torres <0gis0@github.com> +- Microsoft + - Gisela Torres +"@ + Assert-AreEqual -Expected $expected -Presented $result -Comment "Same person with different emails should appear in both companies" +} + +function Test_ConvertMeetingMembersToMarkdown_SpecialCharactersInName { + + # Arrange + $testedModulePath = $TESTED_MODULE_PATH | Join-Path -ChildPath "NotesHelper.psd1" + $testedModule = Import-Module -Name $testedModulePath -Force -PassThru + + $input = "`"David (GitHub) Losert`" , `"Martin Fernandez, Borja`" " + + # Act + $result = & $testedModule { + param($input) + Convert-MeetingMembersToMarkdown -MeetingMembers $input + } -args $input + + # Assert + # Names with special characters (parentheses, commas) should be preserved + $expected = @" +- Github + - "David (GitHub) Losert" +- Mapfre + - "Martin Fernandez, Borja" +"@ + Assert-AreEqual -Expected $expected -Presented $result -Comment "Names with special characters should be preserved" +} + +function Test_ConvertMeetingMembersToMarkdown_EmptyInput { + + # Arrange + $testedModulePath = $TESTED_MODULE_PATH | Join-Path -ChildPath "NotesHelper.psd1" + $testedModule = Import-Module -Name $testedModulePath -Force -PassThru + + $input = "" + + # Act + $result = & $testedModule { + param($input) + Convert-MeetingMembersToMarkdown -MeetingMembers $input + } -args $input + + # Assert + Assert-AreEqual -Expected "" -Presented $result -Comment "Empty input should return empty string" +} + +function Test_ConvertMeetingMembersToMarkdown_WhitespaceOnlyInput { + + # Arrange + $testedModulePath = $TESTED_MODULE_PATH | Join-Path -ChildPath "NotesHelper.psd1" + $testedModule = Import-Module -Name $testedModulePath -Force -PassThru + + $input = " " + + # Act + $result = & $testedModule { + param($input) + Convert-MeetingMembersToMarkdown -MeetingMembers $input + } -args $input + + # Assert + Assert-AreEqual -Expected "" -Presented $result -Comment "Whitespace-only input should return empty string" +} + +function Test_ConvertMeetingMembersToMarkdown_SingleMember { + + # Arrange + $testedModulePath = $TESTED_MODULE_PATH | Join-Path -ChildPath "NotesHelper.psd1" + $testedModule = Import-Module -Name $testedModulePath -Force -PassThru + + $input = "John Doe " + + # Act + $result = & $testedModule { + param($input) + Convert-MeetingMembersToMarkdown -MeetingMembers $input + } -args $input + + # Assert + $expected = @" +- Example + - John Doe +"@ + Assert-AreEqual -Expected $expected -Presented $result -Comment "Single member should work correctly" +} + +Export-ModuleMember -Function Test_* diff --git a/private/parseMemberEmail.ps1 b/private/parseMemberEmail.ps1 new file mode 100644 index 0000000..41f4faf --- /dev/null +++ b/private/parseMemberEmail.ps1 @@ -0,0 +1,76 @@ + +function parseMemberEmail { + [CmdletBinding()] + param( + [Parameter(Mandatory, ValueFromPipeline)][string]$MemberString + ) + + process { + $memberString = $MemberString.Trim() + + if ([string]::IsNullOrWhiteSpace($memberString)) { + return $null + } + + # Pattern: "Name" or Name + # The display name may contain quotes, commas, parentheses + $pattern = '^(.+?)\s*<([^>]+)>$' + + if ($memberString -match $pattern) { + $displayName = $matches[1].Trim() + $email = $matches[2].Trim() + + # Extract domain from email + $domain = ($email -split '@')[1] + if ($domain) { + # Get company name from domain (first part before any dots) + $company = ($domain -split '\.')[0] + # Capitalize first letter + $company = $company.Substring(0, 1).ToUpper() + $company.Substring(1).ToLower() + } + else { + $company = "Unknown" + } + + return [PSCustomObject]@{ + DisplayName = $displayName + Email = $email + Company = $company + OriginalFormat = $memberString + } + } + + return $null + } +} + +function groupMembersByCompany { + [CmdletBinding()] + param( + [Parameter(Mandatory)][object[]]$Members + ) + + # Filter out null members + $validMembers = $Members | Where-Object { $null -ne $_ } + + if ($validMembers.Count -eq 0) { + return "" + } + + # Group by company and sort by company name + $grouped = $validMembers | Group-Object -Property Company | Sort-Object -Property Name + + $result = @() + + foreach ($group in $grouped) { + # Add company header + $result += "- $($group.Name)" + + # Add members with 4-space indentation + foreach ($member in $group.Group) { + $result += " - $($member.OriginalFormat)" + } + } + + return ($result -join "`n") +} diff --git a/public/convertMeetingMembersToMarkdown.ps1 b/public/convertMeetingMembersToMarkdown.ps1 new file mode 100644 index 0000000..836782f --- /dev/null +++ b/public/convertMeetingMembersToMarkdown.ps1 @@ -0,0 +1,59 @@ + +function Convert-MeetingMembersToMarkdown { + [CmdletBinding()] + param( + [Parameter(Position = 0, ValueFromPipeline)][string]$MeetingMembers, + [Parameter()][switch]$SortByCompany + ) + + process { + if ([string]::IsNullOrWhiteSpace($MeetingMembers)) { + return "" + } + + # Parse the comma-separated list, handling quoted names with commas + # Split on ', ' followed by a quote or a letter (not inside quotes) + $members = @() + $currentMember = "" + $inQuotes = $false + + for ($i = 0; $i -lt $MeetingMembers.Length; $i++) { + $char = $MeetingMembers[$i] + + if ($char -eq '"') { + $inQuotes = -not $inQuotes + $currentMember += $char + } + elseif ($char -eq ',' -and -not $inQuotes) { + # End of member + if (-not [string]::IsNullOrWhiteSpace($currentMember)) { + $members += $currentMember.Trim() + } + $currentMember = "" + } + else { + $currentMember += $char + } + } + + # Add the last member + if (-not [string]::IsNullOrWhiteSpace($currentMember)) { + $members += $currentMember.Trim() + } + + # Parse each member + $parsedMembers = $members | ForEach-Object { parseMemberEmail -MemberString $_ } + + # Filter out nulls + $parsedMembers = $parsedMembers | Where-Object { $null -ne $_ } + + if ($parsedMembers.Count -eq 0) { + return "" + } + + # Group and format as markdown + $result = groupMembersByCompany -Members $parsedMembers + + return $result + } +} Export-ModuleMember -Function 'Convert-MeetingMembersToMarkdown' From b56fc15e716816177b787a694db7bab18ce54e31 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 1 Dec 2025 15:09:51 +0000 Subject: [PATCH 07/11] Address code review feedback: fix empty domain edge case and remove unused parameter Co-authored-by: rulasg <6884408+rulasg@users.noreply.github.com> --- private/parseMemberEmail.ps1 | 9 +++++++-- public/convertMeetingMembersToMarkdown.ps1 | 3 +-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/private/parseMemberEmail.ps1 b/private/parseMemberEmail.ps1 index 41f4faf..c0a3509 100644 --- a/private/parseMemberEmail.ps1 +++ b/private/parseMemberEmail.ps1 @@ -25,8 +25,13 @@ function parseMemberEmail { if ($domain) { # Get company name from domain (first part before any dots) $company = ($domain -split '\.')[0] - # Capitalize first letter - $company = $company.Substring(0, 1).ToUpper() + $company.Substring(1).ToLower() + # Capitalize first letter if company has content + if ($company.Length -gt 0) { + $company = $company.Substring(0, 1).ToUpper() + $company.Substring(1).ToLower() + } + else { + $company = "Unknown" + } } else { $company = "Unknown" diff --git a/public/convertMeetingMembersToMarkdown.ps1 b/public/convertMeetingMembersToMarkdown.ps1 index 836782f..5a22777 100644 --- a/public/convertMeetingMembersToMarkdown.ps1 +++ b/public/convertMeetingMembersToMarkdown.ps1 @@ -2,8 +2,7 @@ function Convert-MeetingMembersToMarkdown { [CmdletBinding()] param( - [Parameter(Position = 0, ValueFromPipeline)][string]$MeetingMembers, - [Parameter()][switch]$SortByCompany + [Parameter(Position = 0, ValueFromPipeline)][string]$MeetingMembers ) process { From a5a621dbce90ab7ba50273a3685d1f537b9c6f92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20=28Dibildos=29=20Gonz=C3=A1lez?= Date: Mon, 1 Dec 2025 16:13:42 +0000 Subject: [PATCH 08/11] Add devcontainer configuration for PowerShell environment --- .devcontainer/devcontainer.json | 43 +++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..194474c --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,43 @@ + +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/powershell +{ + "name": "PowerShell", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/powershell:lts-ubuntu-22.04", + + "features": { + "ghcr.io/devcontainers/features/common-utils:2": {}, + "ghcr.io/devcontainers/features/sshd:1": {}, + "ghcr.io/devcontainers/features/dotnet:1": {}, + "ghcr.io/devcontainers/features/github-cli:1": {} + }, + + "postCreateCommand": "sudo chsh vscode -s \"$(which pwsh)\"", + + // Configure tool-specific properties. + "customizations": { + // Configure properties specific to VS Code. + "vscode": { + // Set *default* container specific settings.json values on container create. + "settings": { + "terminal.integrated.defaultProfile.linux": "pwsh" + }, + + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "ms-vscode.powershell", + "github.copilot", + "GitHub.copilot-chat", + "mhutchie.git-graph" + ] + } + } + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} + From ef7fced29a25aee9500388a053d5cf6db48f73f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20=28Dibildos=29=20Gonz=C3=A1lez?= Date: Mon, 1 Dec 2025 16:14:37 +0000 Subject: [PATCH 09/11] Refactor tests to directly call Convert-MeetingMembersToMarkdown, removing unnecessary module imports --- .../convertMeetingMembersToMarkdown.test.ps1 | 65 +++---------------- 1 file changed, 10 insertions(+), 55 deletions(-) diff --git a/Test/public/convertMeetingMembersToMarkdown.test.ps1 b/Test/public/convertMeetingMembersToMarkdown.test.ps1 index a98364a..5a9d435 100644 --- a/Test/public/convertMeetingMembersToMarkdown.test.ps1 +++ b/Test/public/convertMeetingMembersToMarkdown.test.ps1 @@ -1,18 +1,10 @@ -$TESTED_MODULE_PATH = $PSScriptRoot | split-path -Parent | split-path -Parent - function Test_ConvertMeetingMembersToMarkdown_SingleCompany { # Arrange - $testedModulePath = $TESTED_MODULE_PATH | Join-Path -ChildPath "NotesHelper.psd1" - $testedModule = Import-Module -Name $testedModulePath -Force -PassThru - $input = "Gisela Torres <0gis0@github.com>, `"David (GitHub) Losert`" " # Act - $result = & $testedModule { - param($input) - Convert-MeetingMembersToMarkdown -MeetingMembers $input - } -args $input + $result = Convert-MeetingMembersToMarkdown -MeetingMembers $input # Assert $expected = @" @@ -26,16 +18,10 @@ function Test_ConvertMeetingMembersToMarkdown_SingleCompany { function Test_ConvertMeetingMembersToMarkdown_MultipleCompanies { # Arrange - $testedModulePath = $TESTED_MODULE_PATH | Join-Path -ChildPath "NotesHelper.psd1" - $testedModule = Import-Module -Name $testedModulePath -Force -PassThru - $input = "Gisela Torres <0gis0@github.com>, `"David (GitHub) Losert`" , Gisela Torres , `"Martin Fernandez, Borja`" , `"Jovanovic Obradovic, Mat`" , `"Molina Merchan, Jesus`" " # Act - $result = & $testedModule { - param($input) - Convert-MeetingMembersToMarkdown -MeetingMembers $input - } -args $input + $result = Convert-MeetingMembersToMarkdown -MeetingMembers $input # Assert $expected = @" @@ -54,17 +40,12 @@ function Test_ConvertMeetingMembersToMarkdown_MultipleCompanies { function Test_ConvertMeetingMembersToMarkdown_DuplicateMemberDifferentCompanies { - # Arrange - $testedModulePath = $TESTED_MODULE_PATH | Join-Path -ChildPath "NotesHelper.psd1" - $testedModule = Import-Module -Name $testedModulePath -Force -PassThru $input = "Gisela Torres <0gis0@github.com>, Gisela Torres " - # Act - $result = & $testedModule { - param($input) - Convert-MeetingMembersToMarkdown -MeetingMembers $input - } -args $input + + $result = Convert-MeetingMembersToMarkdown -MeetingMembers $input + # Assert # Same person with different emails should appear in both company groups @@ -80,16 +61,10 @@ function Test_ConvertMeetingMembersToMarkdown_DuplicateMemberDifferentCompanies function Test_ConvertMeetingMembersToMarkdown_SpecialCharactersInName { # Arrange - $testedModulePath = $TESTED_MODULE_PATH | Join-Path -ChildPath "NotesHelper.psd1" - $testedModule = Import-Module -Name $testedModulePath -Force -PassThru - $input = "`"David (GitHub) Losert`" , `"Martin Fernandez, Borja`" " # Act - $result = & $testedModule { - param($input) - Convert-MeetingMembersToMarkdown -MeetingMembers $input - } -args $input + $result = Convert-MeetingMembersToMarkdown -MeetingMembers $input # Assert # Names with special characters (parentheses, commas) should be preserved @@ -105,16 +80,10 @@ function Test_ConvertMeetingMembersToMarkdown_SpecialCharactersInName { function Test_ConvertMeetingMembersToMarkdown_EmptyInput { # Arrange - $testedModulePath = $TESTED_MODULE_PATH | Join-Path -ChildPath "NotesHelper.psd1" - $testedModule = Import-Module -Name $testedModulePath -Force -PassThru - $input = "" # Act - $result = & $testedModule { - param($input) - Convert-MeetingMembersToMarkdown -MeetingMembers $input - } -args $input + $result = Convert-MeetingMembersToMarkdown -MeetingMembers $input # Assert Assert-AreEqual -Expected "" -Presented $result -Comment "Empty input should return empty string" @@ -123,16 +92,10 @@ function Test_ConvertMeetingMembersToMarkdown_EmptyInput { function Test_ConvertMeetingMembersToMarkdown_WhitespaceOnlyInput { # Arrange - $testedModulePath = $TESTED_MODULE_PATH | Join-Path -ChildPath "NotesHelper.psd1" - $testedModule = Import-Module -Name $testedModulePath -Force -PassThru - $input = " " # Act - $result = & $testedModule { - param($input) - Convert-MeetingMembersToMarkdown -MeetingMembers $input - } -args $input + $result = Convert-MeetingMembersToMarkdown -MeetingMembers $input # Assert Assert-AreEqual -Expected "" -Presented $result -Comment "Whitespace-only input should return empty string" @@ -141,16 +104,10 @@ function Test_ConvertMeetingMembersToMarkdown_WhitespaceOnlyInput { function Test_ConvertMeetingMembersToMarkdown_SingleMember { # Arrange - $testedModulePath = $TESTED_MODULE_PATH | Join-Path -ChildPath "NotesHelper.psd1" - $testedModule = Import-Module -Name $testedModulePath -Force -PassThru - $input = "John Doe " # Act - $result = & $testedModule { - param($input) - Convert-MeetingMembersToMarkdown -MeetingMembers $input - } -args $input + $result = Convert-MeetingMembersToMarkdown -MeetingMembers $input # Assert $expected = @" @@ -158,6 +115,4 @@ function Test_ConvertMeetingMembersToMarkdown_SingleMember { - John Doe "@ Assert-AreEqual -Expected $expected -Presented $result -Comment "Single member should work correctly" -} - -Export-ModuleMember -Function Test_* +} \ No newline at end of file From 417fb0897de3b4ddd56f924565d866dcfce1522e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20=28Dibildos=29=20Gonz=C3=A1lez?= Date: Mon, 1 Dec 2025 16:23:38 +0000 Subject: [PATCH 10/11] Add test for Convert-MeetingMembersToMarkdown with large sample input --- .../convertMeetingMembersToMarkdown.test.ps1 | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/Test/public/convertMeetingMembersToMarkdown.test.ps1 b/Test/public/convertMeetingMembersToMarkdown.test.ps1 index 5a9d435..5cfca6f 100644 --- a/Test/public/convertMeetingMembersToMarkdown.test.ps1 +++ b/Test/public/convertMeetingMembersToMarkdown.test.ps1 @@ -115,4 +115,36 @@ function Test_ConvertMeetingMembersToMarkdown_SingleMember { - John Doe "@ Assert-AreEqual -Expected $expected -Presented $result -Comment "Single member should work correctly" +} + +function Test_ConvertMeetingsMembersToMarkdown_Big_sample{ + + $imput = @" +"Angulo, Amparo" , "Ana González Talaván (She/Her)" , David Mangas Nuñez , Felipe Tomazini , janet.amezcua@microsoft.com, Jose Luis De la Cruz Moreno , "Mora Alonso, Juan Antonio" , juan.olivera@microsoft.com, "Vilanova Arnal, Juan" , miguelselman1@bookings.microsoft.com, miguelselman@microsoft.com, "Oana (GitHub) Dinca" , Oscar Muller , Pilar Blasco , Ramiro Gómez de la Cruz , Ricardo Sastre Martín , Roberto Arocha , Ryan Drewery , Sergio Gallego Martinez , silviahe@microsoft.com, Stéphane Biermann , Tim Guibert +"@ + + $result = Convert-MeetingMembersToMarkdown -MeetingMembers $imput + + Assert-AreEqual -Presented $result -Expected @" +- Accenture + - "Angulo, Amparo" + - "Mora Alonso, Juan Antonio" + - "Vilanova Arnal, Juan" +- Github + - "Oana (GitHub) Dinca" + - Oscar Muller + - Ryan Drewery + - Stéphane Biermann + - Tim Guibert +- Microsoft + - "Ana González Talaván (She/Her)" + - David Mangas Nuñez + - Felipe Tomazini + - Jose Luis De la Cruz Moreno + - Pilar Blasco + - Ramiro Gómez de la Cruz + - Ricardo Sastre Martín + - Roberto Arocha + - Sergio Gallego Martinez +"@ } \ No newline at end of file From 7cd2c4f862eaea7854737b86fe4fa74b00d9aaea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20=28Dibildos=29=20Gonz=C3=A1lez?= Date: Mon, 1 Dec 2025 16:25:58 +0000 Subject: [PATCH 11/11] Update tests for Convert-MeetingMembersToMarkdown to reflect new input format and expected output --- .../convertMeetingMembersToMarkdown.test.ps1 | 95 +++++++++---------- 1 file changed, 47 insertions(+), 48 deletions(-) diff --git a/Test/public/convertMeetingMembersToMarkdown.test.ps1 b/Test/public/convertMeetingMembersToMarkdown.test.ps1 index 5cfca6f..22bf1c8 100644 --- a/Test/public/convertMeetingMembersToMarkdown.test.ps1 +++ b/Test/public/convertMeetingMembersToMarkdown.test.ps1 @@ -1,16 +1,16 @@ function Test_ConvertMeetingMembersToMarkdown_SingleCompany { # Arrange - $input = "Gisela Torres <0gis0@github.com>, `"David (GitHub) Losert`" " + $input = "Alice Johnson , `"Bob Smith (AlphaTech)`" " # Act $result = Convert-MeetingMembersToMarkdown -MeetingMembers $input # Assert $expected = @" -- Github - - Gisela Torres <0gis0@github.com> - - "David (GitHub) Losert" +- Alphatech + - Alice Johnson + - "Bob Smith (AlphaTech)" "@ Assert-AreEqual -Expected $expected -Presented $result -Comment "Single company output should match expected format" } @@ -18,42 +18,41 @@ function Test_ConvertMeetingMembersToMarkdown_SingleCompany { function Test_ConvertMeetingMembersToMarkdown_MultipleCompanies { # Arrange - $input = "Gisela Torres <0gis0@github.com>, `"David (GitHub) Losert`" , Gisela Torres , `"Martin Fernandez, Borja`" , `"Jovanovic Obradovic, Mat`" , `"Molina Merchan, Jesus`" " + $input = "Alice Johnson , `"Bob Smith (AlphaTech)`" , Alice Johnson , `"Charlie Brown, David`" , `"Emma Wilson, Frank`" , `"Grace Lee, Henry`" " # Act $result = Convert-MeetingMembersToMarkdown -MeetingMembers $input # Assert $expected = @" -- Github - - Gisela Torres <0gis0@github.com> - - "David (GitHub) Losert" -- Mapfre - - "Martin Fernandez, Borja" - - "Jovanovic Obradovic, Mat" - - "Molina Merchan, Jesus" -- Microsoft - - Gisela Torres +- Alphatech + - Alice Johnson + - "Bob Smith (AlphaTech)" +- Betasoft + - Alice Johnson +- Gammatech + - "Charlie Brown, David" + - "Emma Wilson, Frank" + - "Grace Lee, Henry" "@ Assert-AreEqual -Expected $expected -Presented $result -Comment "Multiple companies should be sorted alphabetically" } function Test_ConvertMeetingMembersToMarkdown_DuplicateMemberDifferentCompanies { + # Arrange + $input = "Alice Johnson , Alice Johnson " - $input = "Gisela Torres <0gis0@github.com>, Gisela Torres " - - + # Act $result = Convert-MeetingMembersToMarkdown -MeetingMembers $input - # Assert # Same person with different emails should appear in both company groups $expected = @" -- Github - - Gisela Torres <0gis0@github.com> -- Microsoft - - Gisela Torres +- Alphatech + - Alice Johnson +- Betasoft + - Alice Johnson "@ Assert-AreEqual -Expected $expected -Presented $result -Comment "Same person with different emails should appear in both companies" } @@ -61,7 +60,7 @@ function Test_ConvertMeetingMembersToMarkdown_DuplicateMemberDifferentCompanies function Test_ConvertMeetingMembersToMarkdown_SpecialCharactersInName { # Arrange - $input = "`"David (GitHub) Losert`" , `"Martin Fernandez, Borja`" " + $input = "`"Bob Smith (AlphaTech)`" , `"Charlie Brown, David`" " # Act $result = Convert-MeetingMembersToMarkdown -MeetingMembers $input @@ -69,10 +68,10 @@ function Test_ConvertMeetingMembersToMarkdown_SpecialCharactersInName { # Assert # Names with special characters (parentheses, commas) should be preserved $expected = @" -- Github - - "David (GitHub) Losert" -- Mapfre - - "Martin Fernandez, Borja" +- Alphatech + - "Bob Smith (AlphaTech)" +- Gammatech + - "Charlie Brown, David" "@ Assert-AreEqual -Expected $expected -Presented $result -Comment "Names with special characters should be preserved" } @@ -120,31 +119,31 @@ function Test_ConvertMeetingMembersToMarkdown_SingleMember { function Test_ConvertMeetingsMembersToMarkdown_Big_sample{ $imput = @" -"Angulo, Amparo" , "Ana González Talaván (She/Her)" , David Mangas Nuñez , Felipe Tomazini , janet.amezcua@microsoft.com, Jose Luis De la Cruz Moreno , "Mora Alonso, Juan Antonio" , juan.olivera@microsoft.com, "Vilanova Arnal, Juan" , miguelselman1@bookings.microsoft.com, miguelselman@microsoft.com, "Oana (GitHub) Dinca" , Oscar Muller , Pilar Blasco , Ramiro Gómez de la Cruz , Ricardo Sastre Martín , Roberto Arocha , Ryan Drewery , Sergio Gallego Martinez , silviahe@microsoft.com, Stéphane Biermann , Tim Guibert +"Alice Anderson" , "Amy Adams (She/Her)" , "Bob Brown" , "Charlie Chen" , david.davis@betasoft.com, "David Dennis" , "Emma Evans, Eric" , emma.edwards@betasoft.com, "Frank Fields, Fiona" , george.garcia@bookings.betasoft.com, george.garcia@betasoft.com, "Grace (AlphaTech) Garcia" , "Henry Harris" , "Iris Ingram" , "Jack Johnson" , "James Jackson" , "Jennifer Jones" , "Kevin Kim" , "Kyle Knight" , lisa.lee@betasoft.com, "Laura Lewis" , "Mark Martinez" "@ $result = Convert-MeetingMembersToMarkdown -MeetingMembers $imput Assert-AreEqual -Presented $result -Expected @" -- Accenture - - "Angulo, Amparo" - - "Mora Alonso, Juan Antonio" - - "Vilanova Arnal, Juan" -- Github - - "Oana (GitHub) Dinca" - - Oscar Muller - - Ryan Drewery - - Stéphane Biermann - - Tim Guibert -- Microsoft - - "Ana González Talaván (She/Her)" - - David Mangas Nuñez - - Felipe Tomazini - - Jose Luis De la Cruz Moreno - - Pilar Blasco - - Ramiro Gómez de la Cruz - - Ricardo Sastre Martín - - Roberto Arocha - - Sergio Gallego Martinez +- Alphatech + - "Grace (AlphaTech) Garcia" + - "Henry Harris" + - "Kevin Kim" + - "Laura Lewis" + - "Mark Martinez" +- Betasoft + - "Amy Adams (She/Her)" + - "Bob Brown" + - "Charlie Chen" + - "David Dennis" + - "Iris Ingram" + - "Jack Johnson" + - "James Jackson" + - "Jennifer Jones" + - "Kyle Knight" +- Deltalab + - "Alice Anderson" + - "Emma Evans, Eric" + - "Frank Fields, Fiona" "@ } \ No newline at end of file