-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat(sync): enhance file synchronization and terminal configuration #52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
516c774
feat(syncIncludeWithModule): allow to sync by file type
rulasg 05a3704
fix(settings): add PowerShell terminal profile configuration
rulasg 7cab1e1
feat(Invoke-PrivateContext): add support for passing arguments to scr…
rulasg 52ae1c7
fix(openFilesUrls): allow url with special characters
rulasg 825bfb7
style(run_BeforeAfter): comment out test run functions for clarity
rulasg feeb43c
feat(prompts): add workflow for saving branch to PR
rulasg e71518b
feat(mock): implement functions for tracing and managing mock command…
rulasg 4213dd4
fix(dependencies): $($MODULE_NAME)RootPath
rulasg ef1d9d1
feat(getLongText): implement Get-LongText function for temporary text…
rulasg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,110 @@ | ||
| --- | ||
| agent: agent | ||
| --- | ||
|
|
||
| # Save Branch to PR Workflow | ||
|
|
||
| This prompt guides through the complete workflow of saving a feature branch by creating a PR, waiting for checks, merging, and cleaning up. | ||
|
|
||
| ## Prerequisites | ||
| - Git repository with GitHub remote | ||
| - GitHub CLI (`gh`) installed and authenticated | ||
| - Current branch should be a feature branch (not `main`) | ||
|
|
||
| ## Workflow Steps | ||
|
|
||
| ### Step 1: Verify Current Branch | ||
| Check that we are NOT on the `main` branch. If on `main`, stop and inform the user. | ||
|
|
||
| ```powershell | ||
| $currentBranch = git branch --show-current | ||
| if ($currentBranch -eq "main") { | ||
| Write-Error "Cannot run this workflow from the main branch. Please checkout a feature branch first." | ||
| return | ||
| } | ||
| Write-Host "Current branch: $currentBranch" | ||
| ``` | ||
|
|
||
| ### Step 2: Push Branch and Create PR | ||
| Push the current branch to remote and create a Pull Request. | ||
|
|
||
| ```powershell | ||
| # Push branch to remote | ||
| git push -u origin $currentBranch | ||
|
|
||
| # Create PR with auto-fill from commit messages | ||
| gh pr create --fill | ||
| ``` | ||
|
|
||
| If a PR already exists for this branch, continue with the existing PR. | ||
|
|
||
| ### Step 3: Wait for Workflow Checks | ||
| Wait for all GitHub Actions workflow checks to complete and verify they pass. | ||
|
|
||
| ```powershell | ||
| # Wait for checks to complete (will block until done) | ||
| gh pr checks --watch --required --interval 1 --fail-fast | ||
|
|
||
| # Verify all checks passed | ||
| $checksResult = gh pr checks | ||
| if ($LASTEXITCODE -ne 0) { | ||
| Write-Error "Some checks failed. Please review and fix before merging." | ||
| return | ||
| } | ||
| Write-Host "All checks passed!" | ||
| ``` | ||
|
|
||
| ### Step 4: Merge the PR | ||
| Merge the PR using a regular merge to preserve the branch history, and delete the remote branch. | ||
|
|
||
| ```powershell | ||
| # Merge PR and delete remote branch (regular merge to keep history) | ||
| gh pr merge --merge --delete-branch | ||
| ``` | ||
|
|
||
| ### Step 5: Clean Up Local Branch | ||
| Switch to main and delete the local feature branch. | ||
|
|
||
| ```powershell | ||
| # Switch to main branch | ||
| git checkout main | ||
|
|
||
| # Pull latest changes | ||
| git pull | ||
|
|
||
| # Delete local feature branch | ||
| git branch -d $currentBranch | ||
| ``` | ||
|
|
||
| ### Step 6: Check and Remove Codespaces | ||
| Check if there are any codespaces associated with this branch and remove them. | ||
|
|
||
| ```powershell | ||
| # List codespaces for this repository | ||
| $codespaces = gh codespace list --json name,gitStatus,repository --jq ".[] | select(.gitStatus.ref == `"$currentBranch`")" | ||
|
|
||
| if ($codespaces) { | ||
| Write-Host "Found codespaces on branch $currentBranch. Removing..." | ||
| # Delete codespaces on this branch | ||
| gh codespace list --json name,gitStatus --jq ".[] | select(.gitStatus.ref == `"$currentBranch`") | .name" | ForEach-Object { | ||
| gh codespace delete --codespace $_ --force | ||
| Write-Host "Deleted codespace: $_" | ||
| } | ||
| } else { | ||
| Write-Host "No codespaces found on branch $currentBranch" | ||
| } | ||
| ``` | ||
|
|
||
| ## Success Criteria | ||
| - [ ] Verified not on main branch | ||
| - [ ] PR created and pushed to remote | ||
| - [ ] All workflow checks passed | ||
| - [ ] PR merged successfully | ||
| - [ ] Local and remote feature branches deleted | ||
| - [ ] Any codespaces on the branch removed | ||
|
|
||
| ## Error Handling | ||
| - If on `main` branch: Stop immediately with clear message | ||
| - If checks fail: Stop and inform user to fix issues | ||
| - If merge conflicts: Stop and inform user to resolve conflicts | ||
| - If codespace deletion fails: Log warning but continue |
This file contains hidden or 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 |
|---|---|---|
| @@ -1,2 +1,9 @@ | ||
| { | ||
| "terminal.integrated.profiles.osx": { | ||
| "pwsh": { | ||
| "path": "pwsh", | ||
| "icon": "terminal-powershell", | ||
| "args": ["-NoExit", "-Command", "if (Test-Path './tools/Test_Helper') { Import-Module './tools/Test_Helper' -Force }"] | ||
| } | ||
| } | ||
| } |
This file contains hidden or 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 |
|---|---|---|
| @@ -1,54 +1,54 @@ | ||
|
|
||
| $MockCommandFile = $testRootPath | Join-Path -ChildPath "mockfiles.log" | ||
| # $MockCommandFile = $testRootPath | Join-Path -ChildPath "mockfiles.log" | ||
|
|
||
| function Trace-MockCommandFile{ | ||
| [CmdletBinding()] | ||
| param( | ||
| [string] $Command, | ||
| [string] $FileName | ||
| ) | ||
| # function Trace-MockCommandFile{ | ||
| # [CmdletBinding()] | ||
| # param( | ||
| # [string] $Command, | ||
| # [string] $FileName | ||
| # ) | ||
|
|
||
| # read content | ||
| $content = readMockCommandFile | ||
| # # read content | ||
| # $content = readMockCommandFile | ||
|
|
||
| # Check that the entry is already there | ||
| $result = $content | Where-Object{$_.command -eq $command} | ||
| if($null -ne $result) {return} | ||
| # # Check that the entry is already there | ||
| # $result = $content | Where-Object{$_.command -eq $command} | ||
| # if($null -ne $result) {return} | ||
|
|
||
| # add entry | ||
| $new = @{ | ||
| Command = $command | ||
| FileName = $fileName | ||
| } | ||
| # # add entry | ||
| # $new = @{ | ||
| # Command = $command | ||
| # FileName = $fileName | ||
| # } | ||
|
|
||
| $ret = @() | ||
| $ret += $content | ||
| $ret += $new | ||
| # $ret = @() | ||
| # $ret += $content | ||
| # $ret += $new | ||
|
|
||
| # Save list | ||
| writeMockCommandFile -Content $ret | ||
| } | ||
| # # Save list | ||
| # writeMockCommandFile -Content $ret | ||
| # } | ||
|
|
||
| function readMockCommandFile{ | ||
| # function readMockCommandFile{ | ||
|
|
||
| # Return empty list if the file does not exist | ||
| if(-not (Test-Path -Path $MockCommandFile)){ | ||
| return @() | ||
| } | ||
| # # Return empty list if the file does not exist | ||
| # if(-not (Test-Path -Path $MockCommandFile)){ | ||
| # return @() | ||
| # } | ||
|
|
||
| $ret = Get-Content -Path $MockCommandFile | ConvertFrom-Json | ||
| # $ret = Get-Content -Path $MockCommandFile | ConvertFrom-Json | ||
|
|
||
| # return an empty aray if content does not exists | ||
| $ret = $ret ?? @() | ||
| # # return an empty aray if content does not exists | ||
| # $ret = $ret ?? @() | ||
|
|
||
| return $ret | ||
| } | ||
| # return $ret | ||
| # } | ||
|
|
||
| function writeMockCommandFile($Content){ | ||
| # function writeMockCommandFile($Content){ | ||
|
|
||
| $list = $Content | ConvertTo-Json | ||
| # $list = $Content | ConvertTo-Json | ||
|
|
||
| $sorted = $list | Sort-Object fileName | ||
| # $sorted = $list | Sort-Object fileName | ||
|
|
||
| $sorted | Out-File -FilePath $MockCommandFile | ||
| } | ||
| # $sorted | Out-File -FilePath $MockCommandFile | ||
| # } |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check notice
Code scanning / PSScriptAnalyzer
Line has trailing whitespace Note