Script to fetch corresponding branches of dependent projects#3945
Script to fetch corresponding branches of dependent projects#3945
Conversation
Fetch branches of js-sdk and react-sdk that match the current branch name, if they exist. This will mostly be used in the automated tests.
|
To make this work for org-member PRs you could leverage something like: if [[ "$TRAVIS" == true ]]; then
curbranch="${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}"
else
defbranch=`git rev-parse --abbrev-ref HEAD`
curbranch="${ghprbSourceBranch:-$defbranch}"
fito determine the current branch |
So we hopefully get the right branch for PRs from the same repo (but not forks). From @t3chguy's comment (tweaked a bit)
richvdh
left a comment
There was a problem hiding this comment.
some stupid questions, but more generally:
The problem with this is that we won't be following our own instructions, which means that we won't know if we've broken things for people following those instructions. I wonder if we should special-case develop, or alternatively, give up on the idea of trying to make package.json right on the develop branch, and tell anyone trying to build develop from source to do the git checkouts themselves.
| node_js: | ||
| - 6 # node v6, to match jenkins | ||
| install: | ||
| - scripts/fetch-develop.deps.sh |
There was a problem hiding this comment.
I'm pretty sure there was a reason we did npm install on riot-web before trying to symlink the dependencies both here and in jenkins.sh (like: npm shits all over the stuff you've just installed). The README also says you should do it the other way around.
Are you sure it works this way around?
There was a problem hiding this comment.
It empirically does, although only did it this way to avoid installing copies of thing we then blow away again.
| # Look in the many different CI env vars for which branch we're | ||
| # building | ||
| if [[ "$TRAVIS" == true ]]; then | ||
| curbranch="${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}" |
There was a problem hiding this comment.
this, I suspect, isn't going to work when the PR is from a remote repo. I guess that's ok though.
There was a problem hiding this comment.
Yeah, it won't sadly - there was some discussion on this on #riot-web - basically we'd need to do a lot more to guess that, so we're not going to do so now (nothing to stop us from doing it in the future though)
There was a problem hiding this comment.
#riot-dev * (incase @richvdh feels like looking at it)
Update README instructions and add checks to release script to prevent us forgetting to bump the versions of dependencies (because the check in the main release script will only catch references to #develop left in, which will no longer be the failure mode).
So we can run the automated tests against the correct branches