Skip to content
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

Fix problem with dataRoot in config #1144

Merged
merged 4 commits into from Jul 30, 2018

Conversation

Projects
None yet
2 participants
@cmdcolin
Copy link
Contributor

cmdcolin commented Jul 26, 2018

This PR fixes #627 a bug that is basically that if dataRoot is configured in the config file it is ignored

It solves this in a couple ways

  1. It does not fill templates in the initial config. the initial config templates basically only includes the "refSeqs" attribute that references {dataRoot} and the names which also references {dataRoot}. By deferring this, the dataRoot still gets resolved but to the right place after the config is parsed
  2. It also avoids the issue of if dataRoot is in config, and &data= is supplied via url (which gets mapped to dataRoot) then it prioritizes the &data= URL

@wafflebot wafflebot bot added the in progress label Jul 26, 2018

@cmdcolin cmdcolin force-pushed the fix_dataroot_config branch 2 times, most recently from 9e38c8a to 66f736b Jul 26, 2018

@cmdcolin cmdcolin force-pushed the fix_dataroot_config branch from 66f736b to 0cc1fea Jul 26, 2018

@rbuels rbuels added this to the 1.15.1 milestone Jul 28, 2018

@@ -280,6 +281,10 @@ _mergeConfigs: function( a, b ) {
&& ("object" == typeof b[prop])
&& ("object" == typeof a[prop]) ) {
a[prop] = Util.deepUpdate( a[prop], b[prop] );
} else if(prop == 'dataRoot') {
if(typeof a[prop] == 'undefined' || a[prop] == 'data' && typeof b[prop] != 'undefined' ){
a[prop] = b[prop];

This comment has been minimized.

@rbuels

rbuels Jul 28, 2018

Collaborator

just use === undefined instead

This comment has been minimized.

@rbuels

rbuels Jul 28, 2018

Collaborator

and use === for everything always

This comment has been minimized.

@cmdcolin

cmdcolin Jul 30, 2018

Author Contributor

Ideally this would be eslint validated :) I guess there is too much in place to do so practically though

This comment has been minimized.

@cmdcolin

cmdcolin Jul 30, 2018

Author Contributor

Anyways fixed now

This comment has been minimized.

@rbuels

rbuels Jul 30, 2018

Collaborator

I've been using eslint+prettier in all of my new repositories, which is the ultimate code fascism. But it pretty much removes any decisions you need to make about formatting your code, so as long as your editor can just apply what prettier wants automatically, it actually makes writing pretty-nice-looking code way faster.

What do you think about using prettier for JBrowse2? It mostly throws out the window the whole question of how code should be formatted, which I think is actually a good thing, on balance.

This comment has been minimized.

@cmdcolin

cmdcolin Jul 30, 2018

Author Contributor

I am quite happy with code autoformatters. I have used eslint --fix for example on JBrowse 1 plugins which has some formatting settings but I imagine prettier does even more stuff

@cmdcolin cmdcolin force-pushed the fix_dataroot_config branch from 7c94d3e to ba4be31 Jul 30, 2018

@rbuels rbuels merged commit d72f5af into dev Jul 30, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@wafflebot wafflebot bot removed the in progress label Jul 30, 2018

@cmdcolin cmdcolin deleted the fix_dataroot_config branch Aug 6, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.