Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 8
Document and automate the process to fetch from upstream#8
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| #!/bin/sh | ||
| # Prequisites: | ||
| # This script assumes git and github CLR (gh) are installed. | ||
| # Cause the script to fail if any individual command fails | ||
| set -e | ||
| # Fetch from upstream | ||
| git remote add upstream https://github.com/dotnet/runtime | ||
| git fetch upstream | ||
joshpeterson marked this conversation as resolved.
Outdated
Uh oh!There was an error while loading. Please reload this page. | ||
| # Create a new branch for a pull request to merge in upstream/main | ||
| # using the current date in the branch name. | ||
| git checkout unity-main | ||
| branch_name=bot-upstream-main-merge-$(date '+%Y-%m-%d') | ||
joncham marked this conversation as resolved.
Outdated
Uh oh!There was an error while loading. Please reload this page. | ||
| git checkout -b $branch_name | ||
| git merge upstream/main -m "Merge with main from upstream" | ||
| git push --set-upstream origin $branch_name | ||
| # Login to Github | ||
| set -u | ||
joshpeterson marked this conversation as resolved.
Outdated
Uh oh!There was an error while loading. Please reload this page. | ||
| echo "$GITHUB_TOKEN" > .githubtoken | ||
| unset GITHUB_TOKEN | ||
| gh auth login --hostname github.com --with-token < .githubtoken | ||
| rm .githubtoken | ||
| # Yamato has a local mirror of github.com for cloning. This configuration | ||
| # causes problems for Github CLI, so set the remote manually here. | ||
| git remote set-url origin $GIT_REPOSITORY_URL | ||
| # Create a pull request back to unity-main | ||
| gh pr create --fill | ||
| # For some unknown reason we often see this error from Github CLI: | ||
| # | ||
| # pull request create failed: HTTP 502: Something went wrong while executing your query. | ||
| # This may be the result of a timeout, or it could be a GitHub bug. | ||
| # Please include `B96C:2166:B667D:BCDCF:61A53AF5` when reporting this issue. (https://api.github.com/graphql) | ||
| # | ||
| # Often the pull request was actually created though, so manually check for it if this happens. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| name: Update from upstream | ||
| agent: | ||
| type: Unity::VM | ||
| image: platform-foundation/linux-ubuntu18.04-il2cpp-bokken:latest | ||
| flavor: b1.xlarge | ||
joshpeterson marked this conversation as resolved.
Outdated
Uh oh!There was an error while loading. Please reload this page. | ||
| commands: | ||
| - curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg | ||
| - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null | ||
| - sudo apt update | ||
| - sudo apt install gh | ||
| - git config --global user.email "joshuap@unity3d.com" | ||
joncham marked this conversation as resolved.
Outdated
Uh oh!There was an error while loading. Please reload this page. | ||
| - git config --global user.name "Josh Peterson" | ||
| - .yamato/scripts/update_from_upstream.sh | ||
| triggers: | ||
| recurring: | ||
| - branch: unity-main | ||
| frequency: weekly | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # .NET Runtime - Unity Details | ||
| This is Unity's fork of the .NET Runtime repository. | ||
| The difference between this fork and the upstream repository should be as small as possible, with all of the differences specific to Unity. Our goal is to upstream as many changes made here as possible. | ||
| ## Pulling changes from upstream | ||
| There is a job in Unity's internal CI which runs weekly to pull the latest code from the upstream [dotnet/runtime](https://github.com/dotnet/runtime) repository `main` branch and create a pull request to merge these changes to the [`unity-main`](https://github.com/Unity-Technologies/runtime/tree/unity-main) branch. | ||
joshpeterson marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| ## Pushing changes to upstream | ||
| When a pull request is open against this fork, we should determine if the changes in that pull request should be pushed upstream (most should). Ideally, pull request should be organized so that all changes in a given pull request can be directly applied upstream. Any changes specific to the Unity fork should be done in a separate pull request. | ||
| Assuming the branch with changes to upstream is named `great-new-feature` then a new branch of upstream [`main`](https://github.com/dotnet/runtime/tree/main) named `upstream-great-new-feature` should be created. Each commit from `great-new-feature` should be cherry-picked `upstream-great-new-feature`, and then a pull request should be opened from `upstream-great-new-feature` to [`main`](https://github.com/dotnet/runtime/tree/main) in the upstream repository. | ||
| It is acceptable to _merge_ changes to this fork from `great-new-feature` before `upstream-great-new-feature` is merged, but we should at least _open_ an upstream pull request first. | ||
Uh oh!
There was an error while loading. Please reload this page.