Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1690502 - hardcoded angular data file paths
Summary: hardcoded angular data file paths
Keywords:
Status: NEW
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-octavia-ui
Version: 14.0 (Rocky)
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: ---
Assignee: Assaf Muller
QA Contact: Alexander Stafeyev
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-03-19 15:17 UTC by Arie Bregman
Modified: 2019-04-11 04:39 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:


Attachments (Terms of Use)

Description Arie Bregman 2019-03-19 15:17:30 UTC
Description of problem:

Our Octavia UI unit tests are failing with:

PhantomJS 2.1.1 (Linux 0.0.0) ERROR
  ReferenceError: Can't find variable: angular

Looking at what files are packaged in 'python-XStatic-Angular' I can't find angular.js in the list:

/usr/lib/python2.7/site-packages/XStatic_Angular-1.5.8.0-py2.7-nspkg.pth
/usr/lib/python2.7/site-packages/XStatic_Angular-1.5.8.0-py2.7.egg-info
/usr/lib/python2.7/site-packages/XStatic_Angular-1.5.8.0-py2.7.egg-info/PKG-INFO
/usr/lib/python2.7/site-packages/XStatic_Angular-1.5.8.0-py2.7.egg-info/SOURCES.txt
/usr/lib/python2.7/site-packages/XStatic_Angular-1.5.8.0-py2.7.egg-info/dependency_links.txt
/usr/lib/python2.7/site-packages/XStatic_Angular-1.5.8.0-py2.7.egg-info/namespace_packages.txt
/usr/lib/python2.7/site-packages/XStatic_Angular-1.5.8.0-py2.7.egg-info/not-zip-safe
/usr/lib/python2.7/site-packages/XStatic_Angular-1.5.8.0-py2.7.egg-info/top_level.txt
/usr/lib/python2.7/site-packages/xstatic/pkg/angular
/usr/lib/python2.7/site-packages/xstatic/pkg/angular/__init__.py
/usr/lib/python2.7/site-packages/xstatic/pkg/angular/__init__.pyc
/usr/lib/python2.7/site-packages/xstatic/pkg/angular/__init__.pyo
/usr/lib/python2.7/site-packages/xstatic/pkg/angular/data
/usr/lib/python2.7/site-packages/xstatic/pkg/angular/data/errors.json
/usr/lib/python2.7/site-packages/xstatic/pkg/angular/data/version.json
/usr/lib/python2.7/site-packages/xstatic/pkg/angular/data/version.txt
/usr/share/doc/python-XStatic-Angular-1.5.8.0
/usr/share/doc/python-XStatic-Angular-1.5.8.0/README.txt

Is that a packaging issue?
What package should provide '/usr/lib/python2.7/site-packages/xstatic/pkg/angular/data/angular.js' ?

Comment 2 Radomir Dopieralski 2019-03-19 16:01:22 UTC
The JavaScript files are provided by XStatic-Angular-common, on which python-XStatic-Angular depends, because they are independent from the Python version and thus shared between Python 2 and 3.
Also, you should use XStatic's mechanism to get the path to those files, instead of hardcoding it.

Comment 3 Arie Bregman 2019-03-19 17:13:21 UTC
Thank you Radomir. I have changed the component to Octavia UI since these files are packaged and available to us.

Comment 4 Carlos Goncalves 2019-03-22 10:31:39 UTC
Beth, did you intend to assign this BZ to yourself? If not, let's revert status to NEW and remove Triaged keyword.

Comment 5 Carlos Goncalves 2019-03-22 10:35:51 UTC
Thanks for the input, Radomir. What is "XStatic's mechanism to get the path to those files"? We're not much familiar with web front-end development.

Comment 6 Radomir Dopieralski 2019-03-22 11:05:21 UTC
There is some documentation with examples here: https://xstatic.readthedocs.io/en/latest/using.html

Horizon has a little bit more involved code to do that: https://github.com/openstack/horizon/blob/master/openstack_dashboard/utils/settings.py#L242

I think that plugins can simply add to ADD_XSTATIC_MODULES setting to use that mechanism.

Comment 7 Radomir Dopieralski 2019-03-22 11:08:25 UTC
You want to just define ADD_XSTATIC_MODULES in https://github.com/openstack/octavia-dashboard/blob/master/octavia_dashboard/enabled/_1482_project_load_balancer_panel.py

Comment 8 Radomir Dopieralski 2019-03-22 11:16:47 UTC
But then again, I'm pretty certain Horizon already has the Angular module in its list, so you probably just need to inherit from the right template to have it included.


Note You need to log in before you can comment on or make changes to this bug.