refactor: use python instead of javascript
This commit is contained in:
@@ -80,71 +80,71 @@ if ($mergeCommits) {
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Check that security.js exists (from the security fix commit)
|
||||
if (-not (Test-Path "security.js")) {
|
||||
Write-Host "[FAIL] security.js not found on main branch." -ForegroundColor Red
|
||||
# Check that security.py exists (from the security fix commit)
|
||||
if (-not (Test-Path "security.py")) {
|
||||
Write-Host "[FAIL] security.py not found on main branch." -ForegroundColor Red
|
||||
Write-Host "Hint: You need to cherry-pick the 'Fix security vulnerability' commit" -ForegroundColor Yellow
|
||||
Set-Location ..
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Check that security.js has the security fix
|
||||
$securityContent = Get-Content "security.js" -Raw
|
||||
# Check that security.py has the security fix
|
||||
$securityContent = Get-Content "security.py" -Raw
|
||||
|
||||
if ($securityContent -notmatch "sanitizeInput") {
|
||||
Write-Host "[FAIL] security.js is missing the sanitizeInput function." -ForegroundColor Red
|
||||
if ($securityContent -notmatch "sanitize_input") {
|
||||
Write-Host "[FAIL] security.py is missing the sanitize_input function." -ForegroundColor Red
|
||||
Set-Location ..
|
||||
exit 1
|
||||
}
|
||||
|
||||
if ($securityContent -notmatch "validateToken") {
|
||||
Write-Host "[FAIL] security.js is missing the validateToken function." -ForegroundColor Red
|
||||
if ($securityContent -notmatch "validate_token") {
|
||||
Write-Host "[FAIL] security.py is missing the validate_token function." -ForegroundColor Red
|
||||
Set-Location ..
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Check that app.js exists
|
||||
if (-not (Test-Path "app.js")) {
|
||||
Write-Host "[FAIL] app.js not found." -ForegroundColor Red
|
||||
# Check that app.py exists
|
||||
if (-not (Test-Path "app.py")) {
|
||||
Write-Host "[FAIL] app.py not found." -ForegroundColor Red
|
||||
Set-Location ..
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Check that app.js has the performance fix (cache) but NOT experimental features
|
||||
$appContent = Get-Content "app.js" -Raw
|
||||
# Check that app.py has the performance fix (cache) but NOT experimental features
|
||||
$appContent = Get-Content "app.py" -Raw
|
||||
|
||||
# Should have cache (from performance fix)
|
||||
if ($appContent -notmatch "cache") {
|
||||
Write-Host "[FAIL] app.js is missing the performance fix (cache)." -ForegroundColor Red
|
||||
Write-Host "[FAIL] app.py is missing the performance fix (cache)." -ForegroundColor Red
|
||||
Write-Host "Hint: You need to cherry-pick the 'Fix performance issue' commit" -ForegroundColor Yellow
|
||||
Set-Location ..
|
||||
exit 1
|
||||
}
|
||||
|
||||
if ($appContent -notmatch "getData") {
|
||||
Write-Host "[FAIL] app.js is missing the getData method from performance fix." -ForegroundColor Red
|
||||
if ($appContent -notmatch "get_data") {
|
||||
Write-Host "[FAIL] app.py is missing the get_data method from performance fix." -ForegroundColor Red
|
||||
Set-Location ..
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Should NOT have experimental features
|
||||
if ($appContent -match "experimentalMode") {
|
||||
Write-Host "[FAIL] app.js contains experimental features (experimentalMode)." -ForegroundColor Red
|
||||
if ($appContent -match "experimental_mode") {
|
||||
Write-Host "[FAIL] app.py contains experimental features (experimental_mode)." -ForegroundColor Red
|
||||
Write-Host "Hint: You should cherry-pick ONLY the bug fixes, not experimental features" -ForegroundColor Yellow
|
||||
Write-Host " The experimental feature commits should stay on development branch only" -ForegroundColor Yellow
|
||||
Set-Location ..
|
||||
exit 1
|
||||
}
|
||||
|
||||
if ($appContent -match "betaFeatures") {
|
||||
Write-Host "[FAIL] app.js contains experimental features (betaFeatures)." -ForegroundColor Red
|
||||
if ($appContent -match "beta_features") {
|
||||
Write-Host "[FAIL] app.py contains experimental features (beta_features)." -ForegroundColor Red
|
||||
Write-Host "Hint: You should cherry-pick ONLY the bug fixes, not experimental features" -ForegroundColor Yellow
|
||||
Set-Location ..
|
||||
exit 1
|
||||
}
|
||||
|
||||
if ($appContent -match "enableExperimentalFeatures") {
|
||||
Write-Host "[FAIL] app.js contains experimental features (enableExperimentalFeatures)." -ForegroundColor Red
|
||||
if ($appContent -match "enable_experimental_features") {
|
||||
Write-Host "[FAIL] app.py contains experimental features (enable_experimental_features)." -ForegroundColor Red
|
||||
Write-Host "Hint: You should cherry-pick ONLY the bug fixes, not experimental features" -ForegroundColor Yellow
|
||||
Set-Location ..
|
||||
exit 1
|
||||
|
||||
Reference in New Issue
Block a user