Skip to content

Automatic PR builds

Andreas Plesch edited this page Feb 17, 2023 · 6 revisions

This is obsolete and not available anymore but left on the wiki for historical reasons.

Introduction

Using github it is convenient to fork x3dom and then use the online editor to work on the code. To test and use the new code, it is preferable to build the x3dom.js distribution with the manage.py build script. This step is sometimes a hurdle because it requires cloning to a local computer, setting up Python, invoking the script and uploading the results. Before submitting a pull request to the main master branch, it is also necessary to test the new code, preferably by building a new x3dom.js .

The BuildPR branch

To help with the building step, there is a special BuildPR branch on the andreasplesch/github X3DOM fork (https://github.com/andreasplesch/x3dom/tree/BuildPR). The BuildPR branch is synced with the main master branch and triggers automatic building of x3dom whenever a PR is received against it. This is all done on the travis ci service. The build is then deployed to http://x3dom-builds.surge.sh/latest and http://x3dom-builds.surge.sh/build_x . The 10 most recent builds are kept under build_0 to build_9. http://x3dom-builds.surge.sh provides a listing of all builds. The commit_xxx and PR_NUMBER_** files link directly back to Github.

(I may separate out the latest, most recently requested build to its own domain: x3dom-testing.surge.sh . This would be easy to do.)

It will be useful to try this build service by just retargeting existing PRs from the main master branch to the andreasplesch/BuildPR branch. travis and/or github may behave differently when dealing with PRs from forks other than the owner's. Any feedback and ideas for improvement are welcome and may be submitted as issues to the andreasplesch fork.

Workflow

  1. fork x3dom/x3dom if not already
  2. sync my/x3dom/master with x3dom/x3dom/master by (reversed) PR if necessary
  3. create new feature branch ("fixSomething") from master
  4. work in new branch
  5. submit PR against andreasplesch/x3dom/BuildPR
  6. checks and building are automatically started as indicated by message on PR page
  7. wait 5 minutes or so until checks have passed an building is finished.
  8. use build from x3dom-builds.surge.sh in test scene. bl.ocks.org via gist, glitch.com, or fsfiddle are convenient.
  9. iterate if necessary
  10. Submit PR to x3dom/x3dom/master along with test scene

PS: it is possible to submit a PR which modifies the build script and thereby allows uploading of arbitrary content. So you can only really trust the build results of your own PRs. Using other builds or other files served from this domain requires the level of trust you would have when using information from an unknown web site.

also see: https://github.com/x3dom/x3dom/wiki/Contributing-your-changes