Skip to content

Commit 43b76c7

Browse files
committed
Merge main
2 parents 247c1dc + 8c08198 commit 43b76c7

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed

AgentMode/.github/copilot-instructions.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,15 @@ and
239239
- You **MUST** start all stored procedure names with the word `test`.
240240
- You **MUST NOT** put a CREATE SCHEMA statement in the test .sql files. (this is because tSQLt already created the [UserStoryTests] schema for you)
241241

242-
### Step 12: User to check .sql files in ./Tests folder have all been saved
242+
### Step 12: Ensure all User Stories are fully implemented as tSQLt tests.
243+
244+
**Thought:** The above step can create .sql files in the `./Tests` folder, that have NotYetImplemented in them.
245+
246+
**Action:**
247+
- Ensure each User Story is fully implemented as a tSQLt test in a .sql file.
248+
- Exhaustively check each line of each user story is full validated by a test.
249+
250+
### Step 13: Check .sql files in ./Tests folder have all been saved
243251

244252
**Thought:** The above step can take a long time to complete, and Agent-Mode runs
245253
in parallel and asynchronously, so user needs to check that all the .sql files
@@ -249,13 +257,13 @@ and
249257
- The user must check that all the test .sql files have been saved in the `./Tests` folder.
250258
- If not, user must wait to proceed until all .sql files in the ./Tests folder have been saved by the agent.
251259

252-
### Step 13: Build and Publish the tSQLt User Story tests to SQL Server
260+
### Step 14: Build and Publish the tSQLt User Story tests to SQL Server
253261

254262
**Action:**
255263
- Build by running `Build.ps1` (which takes `-ProjectName` as the single parameter) and ensure no errors.
256264
- Publish to the SQL Server using SqlPackage by running `Publish.ps1` (which takes `-ProjectName` as the single parameter) and ensure no errors.
257265

258-
### Step 14: Run user story tests until they all pass.
266+
### Step 15: Run user story tests until they all pass.
259267

260268
**Action:**
261269
- Run `Test.ps1` (which takes `-ProjectName` as the single parameter) to run all the tests in the [UserStoryTests] schema. `Test.ps1` is in the `./.github/tsql/inner-loop` folder.

AgentMode/.github/tsql/inner-loop/Publish.ps1

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,18 @@ if (!(Test-Path $sourceFile)) {
2121
# Print the source file path
2222
Write-Host "Source file: $sourceFile"
2323

24-
# Run SqlPackage.exe /Action:Publish /SourceFile:$SourceFile /TargetConnectionString:$targetConnectionString /p:IncludeCompositeObjects=true
25-
# Note $targetConnectionString can have $ in it
24+
# Mask password in connection string for display
25+
$maskedConnectionString = $targetConnectionString -replace '(?i)(Password|Pwd)=([^;]*)', '$1=*****'
26+
27+
# Print the publish command with masked password
28+
$maskedQuotedConnectionString = '"' + $maskedConnectionString + '"'
29+
$maskedPublishCommand = "$env:USERPROFILE\.dotnet\tools\SqlPackage.exe /Action:Publish /SourceFile:$sourceFile /TargetConnectionString:$maskedQuotedConnectionString /p:IncludeCompositeObjects=true"
30+
$maskedPublishCommand = $maskedPublishCommand -replace '\$', '`$' # Escape $ in the connection string
31+
Write-Host "Running command: $maskedPublishCommand"
32+
33+
# Run the actual publish command (with real password)
2634
$publishCommand = "$env:USERPROFILE\.dotnet\tools\SqlPackage.exe /Action:Publish /SourceFile:$sourceFile /TargetConnectionString:$quotedConnectionString /p:IncludeCompositeObjects=true"
2735
$publishCommand = $publishCommand -replace '\$', '`$' # Escape $ in the connection string
28-
Write-Host "Running command: $publishCommand"
2936
Invoke-Expression $publishCommand
3037
if ($LASTEXITCODE -ne 0) {
3138
Write-Host "Failed to publish the DACPAC. Please check the output for errors."

0 commit comments

Comments
 (0)