- minimize the number of custom branch names and purposes, to 3 branches for all non-hotfix commits (2 in SDK, 1 in Unity)
- remove unnecessary overhead caused by matching AltspaceVR branch changes and releases
- create a consistent hotfix strategy
- There are 3 interconnected github repos (in this document named unity, sdk and samples). They all have matching branch names (except there is no unity/green – non-breaking features go into the red branch)
- */red and */green = active development. Green=safe to go out with little-to-no warning. Red=complex/has dependencies/tied to a major release.
- */r0.[minor].n = release branches – new branches are created when a new release is initiated (not just when we are ready to publish the DLLs+NPM packages)
- */master = branch pointers to minimum supported DLL (typically AltspaceVR's shipped version) and recommended SDK. This is not used for MRE development, and nothing is ever committed to the master branches directly.
- use unity/master+sdk/master (or sdk/green) for quick tests/debugging released MREs.
- use unity/master(or altspacevr retail build)+sdk/green for minor node fixes/hotfixes
- use unity/red+sdk/red for general development.
(Once we guarantee back compatibility, Unity/master should point to the newest releases sdk, and sdk/master should point to minimum supported version - we want implementers to use the freshest dll, but MRE creators to make MREs that run on every host app). But due to back compat, for now unity/master will point to a version compatible with sdk/master
Minimum supported version=the major.minor version that all host apps support, and have force updated their users to.
Minor version number doesn't have to increment in lockstep with altspace's release cycle. We may do more than 1 sdk release between altspace releases.
With this structure, I'd expect there to mostly be 1 or 2 active release versions, but occasionally there would be 3 (or in theory more). The diagram cover 3 active versions for comprehension
- Develop feature targeting unity/red
- Develop feature targeting sdk/green, samples/green
- Develop feature targeting unity/red, sdk/red, samples/red
[Blue] When we decide to prepare a new MRE minor version release (criteria: usually ~1 day before Altspace code lock, or sooner if there are major changes)
- Merge sdk/green into sdk/red
- Merge samples/green into samples/red
- Create new unity+sdk branches named v0.[new_minor].n, matching the red (NOTE: if there was already a new SDK release created, but it wasn't "shipped", we can stomp that - i.e. if v0.[new_minor-1].n was never used in any host app, we can just reset hard, instead of creating v0.[new_minor].n)
- Update CurrentClientVersion to match major.minor in MREUnityRuntime\MREUnityRuntimeLib\Constants.cs and
- If new features were added to SDK, increase MinimumSupportedClientVersion packages\sdk\src\internal\util\verifyClient.ts
- If communication was changed in a non-backwards-compatible way, which is a HUGE DEAL, should never happen after exiting beta stage, and requires full team sign-off, increase the MinimumSupportedSDKVersion in MREUnityRuntimeLib\Constants.cs.
- Commit and push supported version changes to the new branches.
- Merge sdk/v0.[new_minor].n into sdk/red
- Build Unity DLLs from unity/v0.[new_minor].n
- Publish NPM packages from sdk/v0.[new_minor].n
- Create new samples branch named v0.[new_minor].n, matching red. Same rules as step 3.
- Update samples to new version
- Test pass for v0.[new_minor].n
- Merge samples/v0.[new_minor].n into samples/red
[Cyan] When we decide to integrate sdk/green, to patch/hotfix a minor version (The targeted minor version is usually whatever master points to. Criteria: whenever we think it's worth the effort)
- Merge sdk/green into v0.[target].n
- Merge samples/green into v0.[target].n
- Publish NPM packages from v0.[target].n
- Test pass for v0.[target].n branches
- If target is current master version
- Update Master branches for sdk+samples
- If branches for (target+1) exists
- Merge sdk/v0.[target].n into v0.[target+1].n
- Merge samples/v0.[target].n into v0.[target+1].n
- Repeat steps 3-6 with target = target+1
- Merge sdk/green into red
- Merge samples/green into red
- Test pass for red branches
- Develop feature targeting the unity/red branch.
- Cherry-pick feature into unity/v0.[target].n
- Build Unity DLLs from unity/v0.[target].n
- If target is current master version
- Update Master branches for Unity
- If branches for (targetversion+1) exists
- Cherry pick hotfix from unity/v0.[target].n to v0.[targetversion+1].n,
- Repeat steps 2-3 with target=target+1
- Test pass for red branches
- Update Master branches for all repositories
- Merge sdk/v0.[new_minor].n to green
- Merge samples/v0.[new_minor].n to green
- Test pass for green branches
- Do nothing – MRE release cycle is decoupled from Altspace RC cycle.
- Create Branch [username]/[featurename] (or feature/[featurename], bug/[bugname] or hotfix/[hotfixname] from a target branch, for all relevant repos (sdk+unity+samples)
- go to the MRE Github Roadmap page and add any issues to the board, and mark as In Progress
- Write code, commit to branch, push to orign
- Ensure your feature has test coverage in the functional-test app, and add if necessary
- Test pass for the branch
- Do PR towards target branch, with nice description.
- If failure or revisions, go to step 2
- When PR is approved for all relevant repos (sdk+unity+samples), do the PR squash merge for all repos simultaneously.
- go to the MRE Github Roadmap page and move related issues to Fixed
Main purpose of test pass is to look for regressions – not if new features work properly. TODO: Add more tests as needed
- Run all functional tests.
- Test localhost deploy functional tests
- Run functional test scene in unity test bed
- using the functional test menu in synchronization scene in testbed. Go in and out of each test twice. Keep an eye on the synchronized instance and make sure both work
- Test localhost deploy functional tests
- Deploy functional test temporarily to openode/Heroku/azure/ngrok and test
- Verify functional tests runs on Android.
- Run all samples
- See instructions for how to build sample MREs against local NPM package instead of published
- If problems are found, fix and restart test pass
Note that we always publish all packages with each release, with version numbers in sync. Step 1-10 automated by MREBuildAndDeployNPM script.
- Check out sdk\v0.[minor].n
- Git reset –hard
- git clean -fdx
- npm install
- npm run build
- lerna publish --npm-tag next --force-publish *
- when it asks for version number, use 0.[minor].[patch], where minor comes from branch, and patch version is 1+the last published NPM package for that minor version (to find last published version see MRE version page on NPMJS
- For each updated package.json version number, notepad-update the version number in every corresponding package-lock.json in the sdk repo. Lerna doesn’t do this (but should) - however, if you do git clean -fdx, git reset --hard, and npm install then this package-lock.json will be updated.
- Git commit all package-lock.json files to sdk\v0.[minor].n
- npm run build-docs (to regenerate documentation)
- commit documentation changes to sdk\v0.[minor].n
- Deploy functional tests to Azure (ask Steven how)
- Gather the differences from SDK repo (useful for announcmenets): git log --no-merges --pretty=format:"%s" origin/master..origin/v0.[minor].n
- In the github releases page, click the new tag, edit tag, add patch notes. Follow the format from previous releases.
- Announce new features on MRE Discord, #news channel.
This is automated by MREBuildSamplesWithNewNPM script, except for step 3. If there are necessary API changes, the automation will fail.
In samples\v0.[minor].n, for each of the samples update the patch version:
- npm update @microsoft/mixed-reality-extension-sdk@0.[minor].[patch]
- npm install
- If this version has API changes, update the sample source code.
- npm run build
- npm run lint
- verify it works
- git commit package.json and package-lock.json changes to samples\v0.[minor].n
Step 1-4 automated by MREUpdateMasterBranches script
- Re-tag the latest NPM package from sdk/v0.[new_minor].n with @latest instead of @next
- npm dist-tag add @latest
- npm dist-tag rm @next
- git reset hard sdk/master to v0.[minor].n
- git reset hard samples/master to v0.[minor].n
- git reset hard unity/master to v0.[minor].n
- go to the MRE Github Roadmap page and move released issues from Fixed to Released
Step 2 is automated by MRETagUnityVersion script. Step 3 is partially automated by MRECreateMREDevPRBranchForAltspaceVR script.
- Go to the build server and find build matching the commit ID for the v0.[minor].n branch, and
- click ...->retain build
- click the build's commit name->artifacts->drop->drop->...->download as zip, and save locally
- Run
git tag release-v0.[minor].[patch version matching NPM version, or next]
and push that tag withgit push --tags
- If minor version matches altspaceVR dev or RC branch’s current minor version, or if update is desired then updating AltspaceVR DLLs:
- From the downloaded zip, copy all XML/DLL files from MRE build server’s artifacts to Altspace’s Assets\Plugins folder - it should include these files:
- Newtonsoft.Json.xml
- Newtonsoft.Json.dll
- GLTFSerialization.dll
- UnityGLTF.dll
- MREUnityRuntimeLib.dll
- MREUnityRuntimeLib.xml
- Update Altspace’s Assets\Plugins\AAA-References.md (info about newtonsoft and unitygltf can be found in the MRE build server’s artifacts’ libraries.md
- Run through all functional tests in 2 user mode TODO: set up an SDK test space
- Verify on android as one of the two users.
- From the downloaded zip, copy all XML/DLL files from MRE build server’s artifacts to Altspace’s Assets\Plugins folder - it should include these files:
- This change should be treated like all other unity-repo changes, just make sure to
- Sync UnityGLTF repository and TODO build it by doing ???
- Copy all the following files to \MREUnityRuntime\Libraries
- UnityGLTF.dll
- UnityGLTF.pdb
- GLTFSerialization.dll
- GLTFSerialization.pdb
- Update \MREUnityRuntime\Libraries\libraries.md
- This change should be treated like all other unity-repo changes, just make sure to
- Sync AltspaceVR Newtonsoft Repository (note there is a commit added to disable dynamic code generation –
- Rebase this repo’s master branch on top of the base newtonsoft repo’s master branch (there are 1-2 commits there – they could be squashed)
- Follow build instructions in that repo’s ALTSPACE.md file (Ignore the part where ALTSPACE.md the instructions that say to copy dll+xml into altspace repository – that’s outdated and should be changed. By putting the dll+xml in MRE, it will automatically flow into Altspace with the next MRE DLL update)
- Copy these “portable+net40+win8+wpa81+wp8+sl5” files to \MREUnityRuntime\Libraries
- NewtonSoft.Json.dll
- NewtonSoft.Json.pdb
- NewtonSoft.Json.xml
- Update \MREUnityRuntime\Libraries\libraries.md
- Be super careful to test Android after this, as that is pretty fragile.