Use Bower for managing static file dependencies

Registered by Radomir Dopieralski on 2015-01-08

Summary
=======
Get rid of the XStatic packages, and use Bower packages instead.

Motivation
========
The XStatic packages require too much overhead work for preparing the JavaScript libraries. That means that the AngularJS integration can't proceed swiftly. Bower is a de facto standard du jour for the AngularJS community for this purpose.

Description
=========
Instead of using XStatic and PIP for managing and installing all the static file packages, we will use Bower.

UX
===
Does not apply.

Testing
======
All the automated tests have to deploy Horizon first, so they will use the new system, so if anything doesn't work, all the tests will fail and we will notice.

Outside Dependencies
==================
This requires changes in the gate jobs that do testing and deployment of Horizon and Horizon-related projects.

Requirements Update Required
========================
Removal of all XStatic packages.

Doc Impact
=========
A new settings file , static_settings.py, will be crated, so that the packagers can easily swap it for their distributions.

The contributing guide will need an update, describing the new process for adding static file libraries.

Blueprint information

Status:
Complete
Approver:
David Lyle
Priority:
High
Drafter:
Radomir Dopieralski
Direction:
Needs approval
Assignee:
None
Definition:
Obsolete
Series goal:
None
Implementation:
Slow progress
Milestone target:
None
Started by
David Lyle on 2015-01-27
Completed by
David Lyle on 2016-06-15

Related branches

Sprints

Whiteboard

The changes we would need to make are as follows:

* get rid of XStatic entirely;
* add to the repository a configuration file for Bower, with all the
required bower packages listed and their versions specified;
* add to the repository a static_settings.py file, with a single
variable defined, STATICFILES_DIRS. That variable would be initialized
to a list of pairs mapping filesystem directories to URLs within the
/static tree. By default it would only have a single mapping, pointing
to where Bower installs all the stuff by default (bower_components);
* add a line "from static_settings import STATICFILES_DIRS" to the
settings.py file;
* add jobs both to run_tests.sh and any gate scripts, that would run Bower;
* add a check on the gate that makes sure that all direct and indirect
dependencies of all required Bower packages are listed in its
configuration files (pretty much what we have for requirements.txt now);
[rdopieralski - 2015-01-08]

Gerrit topic: https://review.openstack.org/#q,topic:bp/static-file-bower,n,z

Addressed by: https://review.openstack.org/146862
    Separate static_settings.py from settings.py

[david-lyle | 2016-06-15] This is no longer in plan. Marking obsolete.

(?)

Work Items

Work items:
separate STATICFILES_DIRS into static_settings.py: DONE
add configuration file for Bower, mirroring the current XStatic dependencies: TODO
run Bower in tox.ini: TODO
remove XStatic deps: TODO
add checks on the gate: TODO
update documentation: TODO

This blueprint contains Public information 
Everyone can see this information.