Treasury & Bank Transfer Management System — سامانه مدیریت خزانه‌داری و حواله‌های بانکی

Remove temporary public Windows runner after protected V6 diagnostic attempts

davoodmehraban89 committed Oct 19, 2026 at 01:42 UTC b95633da4f9fd84ff22bd3113b7628c84bfd39f6
1 file changed -158
.github/workflows/private-v6-builder-ephemeral-20261018.yml deleted
-158
@@ -1,158 +0,0 @@
1 -name: Ephemeral private V6 builder verification (no uploads)
2 -on:
3 - push:
4 - paths:
5 - - .github/workflows/private-v6-builder-ephemeral-20261018.yml
6 - workflow_dispatch:
7 -permissions:
8 - contents: read
9 -jobs:
10 - private-builder:
11 - runs-on: windows-2022
12 - timeout-minutes: 70
13 - steps:
14 - - name: Install Node 22
15 - uses: actions/setup-node@v4
16 - with:
17 - node-version: '22'
18 - - name: Verify private builder v3 with pinned staging, without publishing files
19 - shell: pwsh
20 - env:
21 - TF_VALIDATION_READ_TOKEN: ${{ secrets.TF_VALIDATION_READ_TOKEN }}
22 - run: |
23 - $ErrorActionPreference='Stop'
24 - if([string]::IsNullOrWhiteSpace($env:TF_VALIDATION_READ_TOKEN)){throw 'PRIVATE_READ_TOKEN_NOT_AVAILABLE'}
25 - $env:GH_TOKEN=$env:TF_VALIDATION_READ_TOKEN
26 - $private='davoodmehraban89/TreasuryFlow-Validation-Private'
27 - $branch='dev/v6-sql-editor-assertion-repair-20261017'
28 - $work=Join-Path $env:RUNNER_TEMP 'v6-protected-builder'
29 - New-Item -ItemType Directory -Path $work -Force | Out-Null
30 - $paths=@('qa/scripts/rebuild-v6-private-nonfinal-qa.ps1',
31 - 'qa/patches/v6-sql-assertion-fix.mjs',
32 - 'qa/patches/v6-add-readonly-sqlserver-adapter.mjs',
33 - 'qa/windows/v6-installed-native-gui-os-clipboard.mjs')
34 - foreach($path in $paths){
35 - $url="https://api.github.com/repos/$private/contents/${path}?ref=$branch"
36 - $api=Invoke-RestMethod -Uri $url -Headers @{ Authorization="Bearer $env:TF_VALIDATION_READ_TOKEN"; Accept='application/vnd.github+json'; 'User-Agent'='TreasuryFlow-private-qa' }
37 - if(!$api.content -or $api.encoding -ne 'base64'){throw 'PRIVATE_TEXT_FETCH_FAILED'}
38 - $dest=Join-Path $work $path
39 - New-Item -ItemType Directory -Path (Split-Path $dest -Parent) -Force | Out-Null
40 - [IO.File]::WriteAllBytes($dest,[Convert]::FromBase64String(($api.content -replace '\s','')))
41 - }
42 - $archive=Join-Path $work 'TreasuryFlow_Validation_Staging_20261017.zip'
43 - & gh release download validation-inputs-20261017 --repo $private --pattern TreasuryFlow_Validation_Staging_20261017.zip --dir $work *> (Join-Path $work 'release-fetch.log')
44 - if($LASTEXITCODE -ne 0){throw 'PRIVATE_RELEASE_DOWNLOAD_FAILED'}
45 - $destination=Join-Path $work 'run-once-candidate'
46 - $privateLog=Join-Path $work 'full-builder-log-private.txt'
47 - $errors=$null
48 - $tokens=$null
49 - [void][Management.Automation.Language.Parser]::ParseFile((Join-Path $work $paths[0]),[ref]$tokens,[ref]$errors)
50 - if($errors.Count -gt 0){throw 'PRIVATE_BUILDER_POWERSHELL_PARSE_FAILED'}
51 - & pwsh -NoProfile -File (Join-Path $work $paths[0]) -SourceArchive $archive -OutputRoot $destination *> $privateLog
52 - if($LASTEXITCODE -ne 0) {
53 - $known='ORIGINAL_PRIVATE_SOURCE_HASH_MISMATCH|UNSAFE_ZIP_ENTRY_PATH|ARCHIVE_ENTRY_COUNT_LIMIT|ZIP_UNCOMPRESSED_SIZE_LIMIT|ZIP_SYMLINK_DISALLOWED|DUPLICATE_ZIP_ENTRY|EXTRACTED_REPARSE_POINT_DISALLOWED|OFFICIAL_XLSX_PACKAGE_LOCK_INTEGRITY_NOT_PINNED_TO_VERIFIED_ARCHIVE|SHEETJS_OFFICIAL_VENDOR_SHA256_MISMATCH|INITIAL_NPM_CI_FAILED|REMOVE_VULNERABLE_XLSX_FAILED|INSTALL_PINNED_OFFICIAL_XLSX_FAILED|PATCHED_LOCK_NPM_CI_FAILED|KNOWN_PRODUCTION_DEPENDENCY_ADVISORIES_REMAIN|V6_UNIT_REGRESSION_FAILED|V6_GATE_FAILED_[A-Z]+|V6_NSIS_BUILDER_FAILED|READ_ONLY_SQL_ADAPTER_PATCH_FAILED|SQL_EDITOR_TEST_PATCH_FAILED'
54 - $nsisLog=Join-Path $destination 'private-local-logs/private-nsis.log'
55 - if(Test-Path -LiteralPath $nsisLog){
56 - $nsisText=Get-Content -LiteralPath $nsisLog -Raw
57 - $knownClasses=[ordered]@{
58 - NSIS_PROCESS='(?i)makensis|nsis'
59 - NETWORK='(?i)ETIMEDOUT|ECONNRESET|socket hang up|download failed'
60 - FILE_PATH='(?i)ENOENT|not found|cannot find module'
61 - SIGNING='(?i)signing|certificate|winCodeSign'
62 - ACCESS='(?i)EPERM|EACCES|access denied'
63 - NATIVE_DEPENDENCY='(?i)node-gyp|npmRebuild|native dependency'
64 - CONFIGURATION='(?i)configuration|invalid config|schema'
65 - ASAR='(?i)asar|cannot pack'
66 - WINDOWS_PATH_LENGTH='(?i)path too long|filename too long'
67 - UNKNOWN_BUILDER_ERROR='(?i)error|failed|⨯'
68 - }
69 - $specificClasses=[ordered]@{
70 - ASAR_ENTRY_MISSING='(?i)(?:Application entry file|main entry file|entry file.*does not exist)'
71 - ELECTRON_MAIN_MISSING='(?i)(?:main\.cjs.*not found|main\.js.*not found|entrypoint.*missing)'
72 - ELECTRON_APP_PACKAGE='(?i)(?:app\.asar.*does not exist|no app\.asar|invalid app package)'
73 - FILE_ALREADY_EXISTS='(?i)(?:file already exists|EEXIST)'
74 - PATH_IS_TOO_LONG='(?i)(?:ENAMETOOLONG|path too long|filename or extension is too long)'
75 - UNRESOLVED_DEPENDENCY='(?i)(?:unresolved dependenc|missing dependenc|cannot resolve)'
76 - APP_BUILDER_EXIT='(?i)(?:exit status [0-9]+|exit code [0-9]+|errorOut=)'
77 - CODE_SIGN_FAILURE='(?i)(?:failed to sign|signing failed|signtool.*error)'
78 - NSIS_MAKENSIS_FAILURE='(?i)(?:makensis.*failed|NSIS Error|failed to compile script)'
79 - INTEGRITY_FAILURE='(?i)(?:integrity checksum failed|incorrect integrity|checksum mismatch)'
80 - ZIP_FAILURE='(?i)(?:7zip.*error|failed to extract|archive corrupted)'
81 - RUNNER_RESOURCE_FAILURE='(?i)(?:out of memory|ENOMEM|disk full|ENOSPC)'
82 - WINDOWS_PROCESS_FAILURE='(?i)(?:spawn.*fail|The system cannot find|CreateProcess)'
83 - PACKAGING_REBUILD_FAILURE='(?i)(?:failed to rebuild|rebuilding native|node-gyp failed)'
84 - AFTER_PACK_HOOK_FAILURE='(?i)(?:afterPack.*fail|afterSign.*fail)'
85 - PUBLISH_FAILURE='(?i)(?:publish.*fail|upload.*fail)'
86 - }
87 - foreach($name in $specificClasses.Keys){
88 - Write-Host ('PRIVATE_QA_NSIS_SPECIFIC_'+$name+'='+[bool]($nsisText -match $specificClasses[$name]))
89 - }
90 - $shortCodes=[regex]::Matches($nsisText,'\\b(?:ERR_[A-Z0-9_]{4,64}|E(?:ACCES|PERM|NOENT|EXIST|CONNRESET|TIMEDOUT|NOTFOUND|NOSPC|NAMETOOLONG|PROTO|AI_AGAIN))\\b')
91 - $codes=@($shortCodes | ForEach-Object {$_.Value} | Select-Object -Unique | Select-Object -First 8)
92 - if($codes.Count -gt 0){Write-Host ('PRIVATE_QA_NSIS_SAFE_ERROR_CODES='+($codes -join ','))}
93 - foreach($name in $knownClasses.Keys){
94 - Write-Host ('PRIVATE_QA_NSIS_DIAGNOSTIC_'+$name+'='+[bool]($nsisText -match $knownClasses[$name]))
95 - }
96 - }
97 - $record=Get-Content $privateLog -Raw
98 - $phases=[regex]::Matches($record,'PRIVATE_QA_PHASE=[A-Z_]+')
99 - $lastPhase=if($phases.Count -gt 0){$phases[$phases.Count-1].Value}else{'PRIVATE_QA_PHASE=BEFORE_ARCHIVE_PREFLIGHT'}
100 - Write-Host ('DIAGNOSTIC_LAST_VERIFIED_PHASE='+$lastPhase)
101 - $match=[regex]::Match($record,$known)
102 - $code=if($match.Success){$match.Value}else{'PRIVATE_BUILD_FAILED_DETAILS_RETAINED_ONLY_ON_EPHEMERAL_WINDOWS_RUNNER'}
103 - throw $code
104 - }
105 - $deliverables=Join-Path $destination 'PRIVATE_QA_DELIVERABLES'
106 - $proof=Get-Content (Join-Path $deliverables 'NONFINAL_QA_SHA256_MANIFEST.json') -Raw | ConvertFrom-Json
107 - $source=Join-Path $deliverables 'TreasuryFlow_V6_1.0.1_Patched_NONFINAL_QA_Source.zip'
108 - $exe=Join-Path $deliverables 'TreasuryFlow_V6_1.0.1_Patched_NONFINAL_QA_Setup.exe'
109 - if(!(Test-Path $source) -or !(Test-Path $exe) -or $proof.finalRelease -ne $false -or $proof.v7FinalAccepted -ne $false -or $proof.productionNpmVulnerabilities -ne 0){throw 'NONFINAL_MANIFEST_POLICY_FAILED'}
110 - if((Get-FileHash $source -Algorithm SHA256).Hash -ne $proof.patchedSourceSha256 -or
111 - (Get-FileHash $exe -Algorithm SHA256).Hash -ne $proof.patchedInstallerSha256){throw 'NONFINAL_MANIFEST_DIGEST_MISMATCH'}
112 - Write-Host 'PRIVATE_V6_PATCHED_SOURCE_AND_WINDOWS_SETUP_BUILD_PASS'
113 - Write-Host 'PRIVATE_V6_NPM_SECURITY_TEST_TYPECHECK_LINT_BUILD_SMOKE_PASS'
114 - Write-Host 'NO_SOURCE_OR_BINARY_UPLOADED_TO_PUBLIC_ARTIFACTS'
115 - # Replay installed native GUI/clipboard acceptance on this exact built EXE.
116 - & node --check (Join-Path $work $paths[3])
117 - if($LASTEXITCODE -ne 0){throw 'INSTALLED_GUI_HARNESS_SYNTAX_FAILED'}
118 - $env:BANK_ADAPTER_MODE='disabled'
119 - $env:TREASURYFLOW_DESKTOP_LOCAL='1'
120 - $env:TREASURYFLOW_ENABLE_MAYAN_EXTERNAL_READ='0'
121 - $env:TREASURYFLOW_MAYAN_ENABLE_EXTERNAL_READ='0'
122 - $env:TREASURYFLOW_ENABLE_SQL_LAB='0'
123 - $isolation=Join-Path $env:RUNNER_TEMP 'v6-gui-test-data'
124 - $installDir=Join-Path $env:RUNNER_TEMP 'TreasuryFlow-V6-Isolated-Installed'
125 - New-Item -ItemType Directory -Path $isolation -Force | Out-Null
126 - $install=Start-Process -FilePath $exe -ArgumentList @('/S',('/D='+$installDir)) -PassThru
127 - if(!$install.WaitForExit(240000)){try{$install.Kill()}catch{};throw 'V6_NSIS_INSTALL_TIMEOUT'}
128 - if($install.ExitCode -ne 0){throw 'V6_NSIS_NONZERO_EXIT'}
129 - $installed=@(Get-ChildItem -LiteralPath $installDir -Recurse -Filter 'TreasuryFlow.exe' -File -ErrorAction SilentlyContinue)
130 - if($installed.Count -ne 1){throw 'INSTALLED_V6_EXE_NOT_UNIQUE'}
131 - Write-Host 'GATE_PASS_SAME_ARTIFACT_NSIS_INSTALL'
132 - $guiLog=Join-Path $work 'private-installed-gui-log.txt'
133 - & node (Join-Path $work $paths[3]) $installed[0].FullName $isolation *> $guiLog
134 - if($LASTEXITCODE -ne 0){
135 - $guiRecord=Get-Content (Join-Path $isolation 'private-gui-report.json') -Raw | ConvertFrom-Json
136 - $safe=$guiRecord.failure -replace '[^A-Z0-9_ ]',''
137 - if(!$safe){$safe='UNKNOWN'}
138 - throw ('V6_SAME_ARTIFACT_INSTALLED_GUI_FAILED_'+$safe)
139 - }
140 - $guiRecord=Get-Content (Join-Path $isolation 'private-gui-report.json') -Raw | ConvertFrom-Json
141 - if($guiRecord.status -ne 'PASS' -or !$guiRecord.osClipboard -or !$guiRecord.bankDisabled -or
142 - !$guiRecord.copyButton -or !$guiRecord.writable -or !$guiRecord.select){throw 'V6_SAME_ARTIFACT_GUI_REPORT_FAIL'}
143 - Write-Host 'GATE_PASS_SAME_ARTIFACT_INSTALLED_WINDOWS_OS_CLIPBOARD'
144 - $uninstall=@(Get-ChildItem -LiteralPath $installDir -Recurse -File -ErrorAction SilentlyContinue |
145 - Where-Object {$_.Name -match '^uninstall.*[.]exe$'})
146 - if($uninstall.Count -ne 1){throw 'V6_NSIS_UNINSTALLER_NOT_FOUND'}
147 - $uninstallProcess=Start-Process -FilePath $uninstall[0].FullName -ArgumentList '/S' -PassThru
148 - if(!$uninstallProcess.WaitForExit(90000)){try{$uninstallProcess.Kill()}catch{};throw 'V6_UNINSTALL_TIMEOUT'}
149 - if($uninstallProcess.ExitCode -ne 0){throw 'V6_UNINSTALL_NONZERO'}
150 - for($i=0;$i -lt 90;$i++){
151 - $remaining=@(Get-ChildItem -LiteralPath $installDir -Recurse -File -Filter 'TreasuryFlow.exe' -ErrorAction SilentlyContinue)
152 - if($remaining.Count -eq 0){break}
153 - Start-Sleep -Seconds 1
154 - }
155 - if($remaining.Count -gt 0){throw 'V6_UNINSTALL_LEFT_BINARY'}
156 - Write-Host 'GATE_PASS_SAME_ARTIFACT_NSIS_UNINSTALL'
157 - Write-Host 'V6_NONFINAL_PRIVATE_QA_10_PLUS_GATES_FULL_PASS'
158 -