Giter VIP home page Giter VIP logo

bumblebee's Introduction

ADSAbs 2.0

This is the Flask application for the new ADS website.

After making sure that you have python development files (package python-dev on debian-based systems) installed, the simple installation is:

$ virtualenv some-python
$ source some-python/bin/activate
$ pip install -U pip
$ pip install -U distribute
$ CFLAGS= pip install -r requirements.txt

You will need a running mongodb instance. Assuming, you are just testing things, you can do:

$ cat <<EOF> ./mongo_auth.js
use admin
db.addUser('foo','bar')
db.auth('foo','bar')
use adsabs
db.addUser('adsabs','adsabs')
use adsdata
db.addUser('adsdata','adsdata')
use adsgut
db.addUser('adsgut','adsgut')
EOF

$ mongo < ./mongo_auth.js

Then, edit config/local_config.py and add:

class LocalConfig(object):
    MONGOALCHEMY_USER = 'adsabs'
    MONGOALCHEMY_PASSWORD = 'adsabs'
    ADSDATA_MONGO_USER = 'adsdata'
    ADSDATA_MONGO_PASSWORD = 'adsdata'
    MONGODB_SETTINGS= {'HOST': 'mongodb://adsgut:adsgut@localhost/adsgut', 'DB': 'adsgut'}
    THUMBNAIL_MONGO_PASSWORD = None

For more details, see http://labs.adsabs.harvard.edu/trac/ads-invenio/wiki/BeerInstallation or look into the Jenkins task, where we test the setup: http://adswhy:9090/view/BEER/job/BEER-05-live-service/configure

Jenkins

You can have Jenkins automatically test your repository/branch:

  1. got to adswhy:9090 (login)
  2. click on 'create a new job'
  3. select 'copy from' = BEER-02-adsabs
  4. change some values:
    • the git url (and optionally the name of the branch you want to test)
    • port of a mongo db (MongoDB is created for each test, so you just want to avoid using a port that some other tests use)
    • email (to notify you of build problems)

bumblebee's People

Contributors

aaccomazzi avatar aholachek avatar anon1efergwerfwer avatar ehenneken avatar hellxcz avatar jonnybazookatone avatar kelockhart avatar lbjay avatar marblestation avatar mobratil avatar nemanjamart avatar rahuldave avatar romanchyla avatar seasidesparrow avatar shinyichen avatar spacemansteve avatar thejoycekung avatar thostetler avatar vsudilov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bumblebee's Issues

Javascript error reloading page

The following query generated an error loading the results (due to issue #129):
http://adslabs.org/bumblebee/ux-class/search/q=bibcode%3A1998A%26AS..133..403M&sort=pubdate+desc

A hard reload caused the following error in the javascript console:

Uncaught TypeError: Cannot read property 'split' of undefined multi_params.js:210Backbone.Model.extend._parse multi_params.js:210Backbone.Model.extend.parse multi_params.js:184Backbone.Model.extend.load multi_params.js:241bound lodash.compat.js:1005_.extend.load api_query.js:68Backbone.Router.extend.search router.js:60(anonymous function) backbone.js:1247(anonymous function) backbone.js:1452some lodash.compat.js:4303_.extend.loadUrl backbone.js:1450_.extend.start backbone.js:1416Mixin.start discovery_bootstrap.js:477(anonymous function) main.js:53fire jquery.js:2913self.fireWith jquery.js:3025deferred.(anonymous function) jquery.js:3114opts.done discovery_bootstrap.js:72fire jquery.js:2913self.fireWith jquery.js:3025done jquery.js:7400(anonymous function) jquery.js:7822

grunt test is not a valid task

Travis build fails because 'grunt test' is not a valid task (defined in package.json).

Also, I think it will fail further down the road as the discovery.vars.js.default issue is still open (see #43).

$ npm test

> [email protected] test /home/travis/build/adsabs/bumblebee

> grunt test coveralls

Warning: Task "test" not found.๏ฟฝ Use --force to continue.

Aborted due to warnings.

npm ERR! Test failed. See above for more details.

npm ERR! not ok code 0

bootstrap oauth token & requests

if access_token is not available, because bootstrap didn't finish yet, any api request will fail

also: I should check for errors in the bootstrap phase

query builder: fix the issues

the latest deployemnt broke query builder - the buttons inside the form are not working; and there were other issues (empty form - validation; stops propagation)

pagination mixin: test edge cases

the pagination mixin is adding 'resultsIndex' attribute, which affects how bbackbone treats models in the collection

these edge cases should be tested:

start > 10 && collection is empty
start > 10 && collections contains 5 docs
start == 0 && collection contains 10 docs (0..9)

and probably few others

weird CSS rule breaks the query builder

I had to remove the following rule, to make the query builder display properly (but it lost the 'cool' look)

search-gui {

select, input {
  .form-control;
  height: 28px;
}

}

Regression in `grunt setup` due to force clean of bower_components

In commit c9ab6ac you force removal of bower_components. This forces grunt-setup to run bower:install, which uses a broken version of bower. It fails with:

Running "bower:install" (bower) task
>> Cleaned target dir /bumblebee/src/libs
Fatal error: Arguments to path.join must be strings

Does this workflow actually work for you? I have to install+invoke bower manually to avoid this problem.

Bumblebee errors on loading page resuts

I'm still seeing CORS errors when running queries on /bumblebee/ux-class/ for brand new queries. Here is what I was able to dig up for an unfielded query of "accomazzi":

  1. displayed in the browser's console (in this case firefox):
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://api.adslabs.org/v1/search?fl=id&q=accomazzi&_=1412553356753. This can be fixed by moving the resource to the same domain or enabling CORS. search
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://api.adslabs.org/v1/search?fl=title%2Cabstract%2Cbibcode%2Cauthor%2Ckeyword%2Cid%2Ccitation_count%2Cpub%2Caff%2Cemail%2Cvolume%2Cyear%2Clinks_data%2Cids_data%2C%5Bcitations%5D%2Cproperty&hl=true&hl.fl=title%2Cabstract%2Cbody&q=accomazzi&rows=25&_=1412553356754. This can be fixed by moving the resource to the same domain or enabling CORS. search
  1. found in the logs of the front-end server:
96.230.84.139 - - [05/Oct/2014:19:56:05 -0400] "GET /v1/search?fl=id&q=accomazzi&_=1412553356753 HTTP/1.1" 500 291 "http://adslabs.org/bumblebee/ux-class/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:32.0) Gecko/20100101 Firefox/32.0" "-" "-"
96.230.84.139 - - [05/Oct/2014:19:56:05 -0400] "GET /v1/search?fl=title%2Cabstract%2Cbibcode%2Cauthor%2Ckeyword%2Cid%2Ccitation_count%2Cpub%2Caff%2Cemail%2Cvolume%2Cyear%2Clinks_data%2Cids_data%2C%5Bcitations%5D%2Cproperty&hl=true&hl.fl=title%2Cabstract%2Cbody&q=accomazzi&rows=25&_=1412553356754 HTTP/1.1" 500 291 "http://adslabs.org/bumblebee/ux-class/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:32.0) Gecko/20100101 Firefox/32.0" "-" "-"
  1. this is the trace of the requests from modsecurity_log:
--969f0178-A--
[05/Oct/2014:19:56:05 --0400] tZmRjYOOuSYAAGakO@QAAAAr 96.230.84.139 56152 131.142.185.10 80
--969f0178-B--
GET /v1/search?fl=id&q=accomazzi&_=1412553356753 HTTP/1.1
Host: api.adslabs.org
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:32.0) Gecko/20100101 Firefox/32.0
Accept: application/json, text/javascript, */*; q=0.01
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Content-Type: application/x-www-form-urlencoded
X-BB-Api-Client-Version: 20140329
Authorization: Bearer:LBLMhQx2XGbikXGLDFbrDEcInpTKPfeEvP2RiYlkzFogU69X1hu9vO1fGw17
Referer: http://adslabs.org/bumblebee/ux-class/
Origin: http://adslabs.org
X-Forwarded-For: 131.142.185.25
Connection: keep-alive

--969f0178-F--
HTTP/1.1 500 INTERNAL SERVER ERROR
Content-Type: text/html; charset=UTF-8
Content-Length: 291
Connection: close

--969f0178-E--
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>500 Internal Server Error</title>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error and was unable to complete your request.  Either the server is overloaded or there is an error in the application.</p>

--969f0178-H--
Apache-Handler: proxy-server
Stopwatch: 1412553365885325 17787 (- - -)
Stopwatch2: 1412553365885325 17787; combined=308, p1=297, p2=8, p3=0, p4=0, p5=3, sr=33, sw=0, l=0, gc=0
Response-Body-Transformed: Dechunked
Producer: ModSecurity for Apache/2.7.1 (http://www.modsecurity.org/); OWASP_CRS/2.2.9.
Server: Apache/2.2.3 (CentOS)
Engine-Mode: "ENABLED"

--969f0178-Z--

--969f0178-A--
[05/Oct/2014:19:56:05 --0400] tZmUuYOOuSYAAGpgWTsAAAA3 96.230.84.139 56151 131.142.185.10 80
--969f0178-B--
GET /v1/search?fl=title%2Cabstract%2Cbibcode%2Cauthor%2Ckeyword%2Cid%2Ccitation_count%2Cpub%2Caff%2Cemail%2Cvolume%2Cyear%2Clinks_data%2Cids_data%2C%5Bcitations%5D%2Cproperty&hl=true&hl.fl=title%2Cabstract%2Cbody&q=accomazzi&rows=25&_=1412553356754 HTTP/1.1
Host: api.adslabs.org
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:32.0) Gecko/20100101 Firefox/32.0
Accept: application/json, text/javascript, */*; q=0.01
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Content-Type: application/x-www-form-urlencoded
X-BB-Api-Client-Version: 20140329
Authorization: Bearer:LBLMhQx2XGbikXGLDFbrDEcInpTKPfeEvP2RiYlkzFogU69X1hu9vO1fGw17
Referer: http://adslabs.org/bumblebee/ux-class/
Origin: http://adslabs.org
X-Forwarded-For: 131.142.185.25
Connection: keep-alive

--969f0178-F--
HTTP/1.1 500 INTERNAL SERVER ERROR
Content-Type: text/html; charset=UTF-8
Content-Length: 291
Connection: close

--969f0178-E--
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>500 Internal Server Error</title>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error and was unable to complete your request.  Either the server is overloaded or there is an error in the application.</p>

--969f0178-H--
Apache-Handler: proxy-server
Stopwatch: 1412553365886137 17803 (- - -)
Stopwatch2: 1412553365886137 17803; combined=311, p1=299, p2=8, p3=1, p4=0, p5=3, sr=33, sw=0, l=0, gc=0
Response-Body-Transformed: Dechunked
Producer: ModSecurity for Apache/2.7.1 (http://www.modsecurity.org/); OWASP_CRS/2.2.9.
Server: Apache/2.2.3 (CentOS)
Engine-Mode: "ENABLED"

--969f0178-Z--

So it looks to me like the culprit is not CORS but rather internal server errors on the application side. I don't know enough about the docker setup to investigate what goes on there, but maybe @vsudilov can check the nginx logs and see what happened to those two requests?

Sort order for ux-class

The sort order needs to be set to pubdate (desc) in all cases except when a second-order operator is present, per BEER compatibility

facets don't work

Clicking 'include' or 'exclude' has no effect whatsoever (Firefox 32.0.3 Ubuntu)

[Show Affiliations] sometimes shows "-"

Empty affiliations are represented by "-" in the solr document, but I don't think it's clear to just show that to a user. I suggest not having a [Show Affiliations] button (or "gray out" the button) if the authors don't have them, and presenting something like "(none)" in the case that some have them and some don't.

Remove expectation that fields exist (Views/Widgets)

My understanding is that there are assumptions about the existence of some fields within a document when rendering views. All of these assumptions should be removed, as there are plenty of cases of extremely sparsely populated documents.

Marking as bug.

Introduce timeout in javascript requests

When the server is not available to provide a response to the client, subsequent bumblebee requests generate a long queue of connections which block and do not timeout. This ties up resources both on the client and server end. Suggestions:

  • Introduce a timeout on each request
  • look into canceling a previous query request when a new one is issued

Application does not recieve proper token from the API on bootstrap

shim.html is redirecting correctly (with pushState), but any API requests made result in 401 responses from the API. I suspect you're already aware of it, but the problem is that the application does not get the correct token when it bootstraps itself to a certain state.

Abstract display issue

Abstract for 2014MNRAS.443.1973V does not display properly. The entire abstract is in Solr, but the display seems to have some problems with e.g.

<MPlanck/MWtG>

scrolling broken

deployed the last branch, one can scroll using pgdown/up, and middle button, but when trying to grab the slider (on the right of window) it immediately jumps back

facet fix

fix the graph facet functionality, improve presentation + css

oauth: use refresh token

bbb is now using oauth access tokens - if a session was open for a long time, they may expire and need to be refreshed

i also need to handle change of access token due to user login

urlencoding and oauth

Ok, so after debating this with Vlad we went ahead and hacked the urldecoding function in the oauth library to accept the characters which were tripping up the API. The file in question is $PYTHONLIB/site-packages/oauthlib/common.py, and the change is this:

#urlencoded = set(always_safe) | set('=&;%+~,*')
# XXX 
urlencoded = set(always_safe) | set('=&;%+~,*!()')

It seems like this is failing because of a strict interpretation by the OAuth library of the urlencoding spec. Roman when you're back we should fix this so that the request is fully encoded when created by the javascript application. But at least this adds back the author faceting functionality.

list of things widget

sometimes the children that inherit from this widget, after publishing a single this.pubsub.DELIVERING_REQUEST, receive two DELIVERING_RESPONSES. However this doesn't happen consistently.

Devel setup under vagrant fails with grunt setup, bower, and discovery.vars.js.default

grunt setup fails under bower:install with Fatal error: Arguments to path.join must be strings. Seemingly this is due to a broken bower packaged with grunt.

A workaround is to install bower and invoke manually a la:

npm install bower
bower install
grunt setup

Secondly, the application will fail since it can't find discovery.vars.js. I guess you intended for people to edit/rename discovery.vars.js.default, but it would be nice if this were documented.

I'll change the manifest to reflect the bower issue, @romanchyla could you document discovery.vars.js, at least from the standpoint of deployment?

Implement a global loading indicator

I think the UX would be significantly improved by having a global loading indicator on bootstrap, such as the "initializing the awesome" indicator on jsfiddle.net. Currently, the user sees only a blank page during the entire initialization.

sort order for references and citations

In the abstract page view, when one calls up the list of references they should be sorted by first author name. Citations should be sorted by pubdate (descending).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.