-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Script to update tester files during integration #15164
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
base: main
Are you sure you want to change the base?
Script to update tester files during integration #15164
Conversation
# List of directories that should be exact copies (from yarn validate-overrides) | ||
$OverrideDirectories = @( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to get the list of dirs yarn validate-overrides
processes instead of hardcoding these here and risking this list from becoming stale when the command gets updated with a different list? Perhaps look at react-native-platform-override/src/Manifest.ts
?
[string]$ReactNativeRepo = "https://github.com/facebook/react-native.git", | ||
[string]$WindowsRepoRoot = $null, # Auto-detect current repo root | ||
[string]$TesterPath = $null, # Auto-detect tester path | ||
[string]$IntegrationTestsPath = $null, # Auto-detect vnext\ReactCopies\IntegrationTests path | ||
[string]$CacheDir = $null, # Auto-detect cache location |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These don't seem to appear in help text as user overridable parameters. Is this expected? If yes, then aren't they better off as parameters?
$CurrentDir = Get-Location | ||
$SearchDir = $CurrentDir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$CurrentDir
is unused, please remove.
git fetch origin 2>&1 | Out-Host | ||
|
||
# Check if commit exists locally | ||
$CommitExists = git rev-parse --verify "$CommitHash^{commit}" 2>$null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drop unused $CommitExists
. In fact, couldn't we drop the whole rev-parse
para as it'd anyways be done below by git fetch --depth 2000 origin 2>&1 | Out-Host
at line 244.
|
||
# Fetch latest changes | ||
Write-Info "Fetching latest changes..." | ||
git fetch origin 2>&1 | Out-Host |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would fetch all branches in react-native
. Shouldn't we just fetch main
? git fetch origin main
would fetch only origin/main
from react-native
.
$CommitExists = git rev-parse --verify "$CommitHash^{commit}" 2>$null | ||
if ($LASTEXITCODE -ne 0) { | ||
Write-Warning "Commit $CommitHash not found locally, fetching more history..." | ||
git fetch --depth 1000 origin 2>&1 | Out-Host |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
git fech --depth 1000 origin main
, no?
git checkout $CommitHash --quiet 2>$null | ||
if ($LASTEXITCODE -ne 0) { | ||
Write-Warning "Failed to checkout $CommitHash, trying deeper fetch..." | ||
git fetch --depth 2000 origin 2>&1 | Out-Host |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
git fetch --depth 2000 origin main
here too if we're interested in only upstream's main
.
Description
Type of Change
Erase all that don't apply.
Why
What is the motivation for this change? Add a few sentences describing the context and overall goals of the pull request's commits.
Resolves [Add Relevant Issue Here]
What
What changes were made to the codebase to solve the bug, add the functionality, etc. that you specified above.
Screenshots
Add any relevant screen captures here from before or after your changes.
Testing
If you added tests that prove your changes are effective or that your feature works, add a few sentences here detailing the added test scenarios.
Optional: Describe the tests that you ran locally to verify your changes.
Changelog
Should this change be included in the release notes: indicate yes or no
Add a brief summary of the change to use in the release notes for the next release.
Microsoft Reviewers: Open in CodeFlow