Commit Graph

54 Commits

Author SHA1 Message Date
manchandavishal 68e12b8100 Drop lower-constraints.txt and its testing
As discussed in TC PTG[1] and TC resolution[2], we are
dropping the lower-constraints.txt file and its testing.
We will keep lower bounds in the requirements.txt file but
with a note that these are not tested lower bounds and we
try our best to keep them updated.

[1] https://etherpad.opendev.org/p/tc-zed-ptg#L326
[2] https://governance.openstack.org/tc/resolutions/20220414-drop-lower-constraints.html#proposal

Change-Id: Ia315117f43a299fc68f3a15db59ddae37f8d30cf
2022-06-08 12:38:07 +00:00
Zuul 8d45a9f941 Merge "Update pyScss to 1.4.0" 2022-06-04 09:21:08 +00:00
manchandavishal 05473b765e Sync default policy rules
This patch updates default policy-in-code rules in horizon based on
nova/neutron/keystone/glance/cinder RC deliverables.

It also bumps a few packages versions in lower-constraints.txt and
requirements.txt to fix the failed lower-constraints job after
updating policy rules.

Change-Id: I168bb171076e3442b29670461a29d12c9988df52
2022-03-21 21:08:21 +05:30
manchandavishal e6d46b218c Update pyScss to 1.4.0
pyscss v1.3.7 doesn't work with python 3.10. So this patch bump
pyscss version to latest i.e. v1.4.0 so it can support python 3.10
and consume other fixes included in pyscss v1.4.0.

Closes-Bug: #1960204
Depends-On: https://review.opendev.org/c/openstack/requirements/+/830615
Change-Id: I764aa5491df8c8d39f4f168241f91d19ce7fed26
2022-02-23 19:33:25 +05:30
manchandavishal 8918bf751d Drop Django 2.2 support
Django 2.2 support was dropped. Django 2.2 ends its extended support
in April 2022[1]. Considering this, horizon dropped Django 2.2 support
and use Django 3.2 as default version of Django.

It also updates the python version from py38 to py39 for
"horizon-non-primary-django-jobs" and
"horizon-tox-python3-django" project template because py36
and py39 are now runtime for the Yoga cycle[2]. So I have updated it to
py39.

[1] https://www.djangoproject.com/download/
[2] https://review.opendev.org/c/openstack/governance/+/820195

Change-Id: I8886f12f7e51b721ac5123070086d5dcfefe4e72
2022-01-05 19:26:56 +00:00
Akihiro Motoki 9d1bb3626b Allow both Django 2.2 and 3.2 for smooth transition
I believe we need the following steps and it is what I did in past
when we bump the Django minimum version.

1. (already done) update global-requirements.txt to allow horizon to
   update requirements.txt to include Django 3.2.
2. specify the required Django version which includes both 2.2 and 3.2
   (at this point upper-constraints uses 2.2)
3. update upper-constraints.txt in the requirements repo to use Django 3.2
4. bump the min version of Django in horizon

(optionally) update non-primary-django tests to include non-primary versions of
Django. It seems you drops 2.2 support together when we support 3.2, so perhaps
this step is not the case though.

https://review.opendev.org/c/openstack/horizon/+/811412 directly updated
the min version to Django 3.2 which is incompatible with the global
upper-constraints.txt.
To avoid this, https://review.opendev.org/c/openstack/horizon/+/815206 made
almost all tests non-voting. I am not a fan of such approach and believe
there is a way to make the transition of Django version more smoothly.

---

This commit reverts the zuul configuration changes in
https://review.opendev.org/c/openstack/horizon/+/815206 and
https://review.opendev.org/c/openstack/horizon/+/811412.

horizon-tox-python3-django32 is voting now as we are making it
the default version.

Change-Id: I60bb672ef1b197e657a8b3bd86d07464bcb1759f
2021-10-26 09:57:06 +09:00
manchandavishal 7bfb56010d Bump Django version to Current LTS Version
This patch update Django version to the current LTS version i.e. 3.2.
Django 2.2 is going to end its extended support by April 2022[1].
horizon and all its plugins already support Django3.2 version, So
let's make this the default version. It also bump few other packages
version in lower-constraints.txt to make it work with Django 3.2.

Note: It also change 'openstack-tox-py38' job to non-voting
which I will revert in follow-up patch once this patch is merged.

[1] https://www.djangoproject.com/download/

Change-Id: I49e323b76ad2c2e680c3f133d0f219d850f7908c
2021-10-25 17:39:21 +05:30
Zuul f3ce777ed5 Merge "Preparation for Django 3.0 and 3.1 support (2)" 2021-09-17 19:39:36 +00:00
manchandavishal 6c76b3a448 Bump decorator version in lower-constraints.txt
This patch update decorator version to 4.4.2 in
lower-constraints.txt to fix the lower-constraints job.

Change-Id: Ie1fa066a5b3615b88e808a99228ed7efd0c98678
2021-09-17 09:54:56 +05:30
Akihiro Motoki 39f28ad5ed Preparation for Django 3.0 and 3.1 support (2)
django-pyscss is not compatible with Django 3.0.
django_pyscss_fix is a temporary workaround for django.utils.six
used in django-pyscss. It also add six in requirements.txt
as we use six module for this workaround.
This is just to run horizon for testing with Django 3.0+.

six is re-added to requirements.txt as it is used in the workaround.
Note that other codes in the horizon repo should not depend on six.

Change-Id: If79289b7518dd8eaf292a90d6fb790beb154cb7c
2021-09-16 16:16:12 +09:00
Takashi Kajinami 788988f24f Clean up the workaround of cinderclient v2->v3 transition
cinderclient 8.0.0 has been released. The workaround in horizon UT
can be dropped now with cinderclient>=8.0.0.

requirements.txt and lower-constrints.txt are updated
according to python-cinderclient 8.0.0 dependencies.

Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Change-Id: Ia59b266516584be71ddec935feb671399e0fd7ec
2021-07-27 16:09:16 +09:00
Akihiro Motoki ffe84dbf9d Move linters dependencies to tox.ini
One of suggestions discussed in the mailling thread [1] is to decouple
linters from test-requirements.txt. We uses specific versions of linters
(hacking, flake8, pylint and bandit) and they are potentially incompatbile
with other libraries in test-requirements.txt.
One example is bandit incompatibility detected by the new pip resolver.
This commit moves linters to tox.ini and introduces a new tox envdir
shared by linter related tox envs.

Note that we have a unit test for a local hacking rule so hacking needs
to be installed as part of the default dependencies. We can have it in
test-requirements.txt but I think it is better to have it in tox.ini
as hacking is a part of linters and other linter dependencies are
declared in tox.ini now.

[1] http://lists.openstack.org/pipermail/openstack-discuss/2020-December/thread.html#19362

Change-Id: Ia41c5f665f01bdab187c9256b2319885998d12c3
2021-03-19 11:25:28 +09:00
David Hill f60220329a Get the timezone offset for the current day instead of January 1st.
This bug only appears to be a cosmetic one where the TZ offset
would be calculated on current_year/01/01 so would remain in
daylight saving offset when displaying the timezones list.

(Note by amotoki)
The minimum version of Babel is bumped to 2.6.0
as Babel 2.3.4 returns "New Zealand Time" instead of "New Zealand
(Auckland) Time" returned from the latest Babel (2.9.0).
It is not a good idea to handle such difference in Babel in our UT
and there is no reason to stick to Bump 2.3.4.
2.6.0 was chosen as it is available in Ubuntu Focal and there is
no more reason than this.

Change-Id: I0600086cc51cf5abcf1631565e75146114189667
Closes-bug: #1822849
2021-03-18 08:29:07 +09:00
Akihiro Motoki b7bb76eb20 Support policy-in-code and deprecated policy
This commit allows horizon to handle deprecated policy rules.
The approach is explained in the document updated by this change.

oslo.policy requirement is updated. oslo.policy 3.2.0 is chosen
just because it is the first release in Victoria cycle.
requirements.txt and lower-constraints.txt are updated accordingly
including oslo.policy dependencies.

Change-Id: If5059d03f6bd7e94796065aa1b51c0c23ac85f5e
2021-01-27 14:02:27 +00:00
Akihiro Motoki 4b48b5816c Bump min requirement of xstatic-jquery to 1.12.x
As discussed in the last horizon team meeting, we plan to upgrade
jquery to jquery 3 series. Jquery 3 upgrade assumes we already use
jquery 1.12.x ro 2.2.x. We already use jquery 1.12.4.1 in the master
for long but our requirements file says >=1.8.2. This commit bumps
the xstatic-jquery minimum requirement to 1.12.4.1 to ensure
we use 1.12.x before upgrading jQuery to 3.

xstatic-jquery-ui min version is also bumped to 1.12.0.1.
The current requirement is >=1.10.4 but we use 1.12.x series for long
and use 1.12.1.1 since 2018, so I believe it is safe to bump it.

Change-Id: I2a1ff5a4df5e278f89fcd73c26f1d8527b9c4d7f
2021-01-20 18:06:15 +09:00
Ivan Kolodyazhny 6f0200032d Update lower constraints and change browser to Firefox to unblock gate
Pip 20.x requires ensure_str method from six which was introduced
in v.1.12.0 and wrapt v.1.11 is required by astroid v.2.4.0 with
the pylint dependency. So this patch update six and wrapt version
in lower-constraints.txt to fix the gate.

It also updates the browser to Firefox in karma.conf.js and adds
'karma-firefox-launchers' in package.json because nodejs-job
fail with chromium-browser due to not able to access some URL.
It also removes 'karma-chrome-launcher' enteries from all files
as it is no longer used.  So let's switch to Firefox browser to
unblock the gate then we can investigate later how to fix it with
chromium-browser.

Depends-On: https://review.opendev.org/c/zuul/zuul-jobs/+/766744

Co-Authored-By: Vishal Manchanda <manchandavishal143@gmail.com>
Change-Id: I13e68d89f55407b1b3c64219969912700feef500
2020-12-14 13:31:45 +00:00
manchandavishal c28b9b9bc3 [goal] Migrate testing to ubuntu focal
As per victoria cycle testing runtime and community goal[1]
we need to migrate upstream CI/CD to Ubuntu Focal(20.04).

Fixing:
Closes-Bug: #1886298
Bump the lower constraints for required deps which added python3.8
support in their later version.
Story: #2007865
Task: #40187

[1] https://governance.openstack.org/tc/goals/selected/victoria/migrate-ci-cd-jobs-to-ubuntu-focal

Change-Id: I81c150a9abc53242dfefd18c6c0ebc20c0484073
2020-09-01 15:37:23 +00:00
manchandavishal f8658d9880 Switch to newer openstackdocstheme and reno versions
Switch to openstackdocstheme 2.2.0 and reno 3.1.0 versions. Using
these versions will allow especially:
* Linking from HTML to PDF document
* parallelizing building of documents

Update Sphinx version as well.

openstackdocstheme renames some variables, so follow the renames. A
couple of variables are also not needed anymore, remove them.

Set openstackdocs_pdf_link to link to PDF file.

Remove docs requirements from lower-constraints, they are not installed.

For more info. please refer [1].
[1] https://review.opendev.org/728938

Change-Id: I90d064e63baa5f067f38a881eb9a556dfb435e97
2020-05-19 15:26:39 +00:00
Zuul cbe1033502 Merge "Change horizon test runner to pytest" 2020-04-14 05:45:38 +00:00
Zuul 754804667a Merge "Bump hacking to 3.0.0" 2020-04-09 14:30:01 +00:00
Zuul 18aada92b2 Merge "Bump xstatic-mdi lower-bound" 2020-04-09 07:23:48 +00:00
Oleksii Petrenko d6fe0170ee Change horizon test runner to pytest
Changes test invocation from `manage.py test` to `pytest`. Adds addtitional
test requirements like pytest, pytest-django, pytest-html. Adds
`pytest.mark` alongside django's test `tag`. Adds posibility to export test
results into xml and html formats.

Depends-On: https://review.opendev.org/#/c/712315/
Related-Bug: #1866666
Co-Authored-By: Ivan Kolodyazhny <e0ne@e0ne.info>
Change-Id: Idb6e63cd23ca2ba8ca56f36eb8b63069bd211944
2020-04-03 13:47:18 +03:00
manchandavishal 393f2b6d61 Bump hacking to 3.0.0
This patch update hacking version to 3.0.0. It also drop flake8 and
hacking from lower-constraints.txt and update mccabe, pycodestyle,
pyflakes package version to fix error in lower-constraints job [1].

[1] https://zuul.opendev.org/t/openstack/build/b11dcae1771d4d9ab7d30c40848bd2ff/log/tox/lower-constraints-1.log#354-356

Change-Id: Idd32fc49cb7c8d9823385eee7b42e8e6e769c108
2020-04-03 09:21:05 +00:00
Akihiro Motoki 65e3917105 Bump xstatic-mdi lower-bound
xstatic-mdi 1.4.57.0 and 1.6.50.2 have different ways (variables)
to define classes for material design icons.
As a result we need different ways for a workaround like
commit ddc52a7405.
It looks good to support 1.6.50.2 only to simplify the maintenance.
1.6.50.2 was released Feb 2019 and is used in horizon since Stein
release (in upper-constraints), so this change would be not risky.

Change-Id: Idd2e035fa85dfe8c20397d63ed8ae4bd09c84078
2020-04-01 16:01:48 +09:00
Zuul 7eeb9e14f9 Merge "Use unittest.mock instead of third party mock" 2020-03-31 14:17:35 +00:00
Ivan Kolodyazhny 14e779bbac Use unittest.mock instead of third party mock
Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.

Change-Id: I2de669d8e89b8daeb7ee5405ffab35af6307c40b
2020-03-26 19:45:37 +02:00
Ivan Kolodyazhny 2c44702724 Update pyScss to 1.3.7
pyScss v1.3.7 doesn't require any bindep to be installed so it's prefer
to use it instead of adding bindep to all projects manually.

Depends-On: https://review.opendev.org/715240

Change-Id: I336a3449c1ed8be3984da6366e9b45f8e4d3f5c0
2020-03-26 17:15:13 +02:00
Ivan Kolodyazhny ddc52a7405 Fix Horizon to work with the latest pyScss
pyScss v1.3.5 implements 'function-exists' function now. It breaks
MaterialDesign-Webfont [1] which is provided by xstatic-mdi package.

This patch re-implements FontAwesome-based styles for Material theme to
not use MaterialDesign-Webfont classes.

Another advantage of this improvement is we can use the latest pyScss
(once it'll be released) and update xstatic-mdi too.

[1] https://github.com/Templarian/MaterialDesign-Webfont/issues/19

Closes-Bug: #1771559
Depends-On: https://review.opendev.org/714450
Change-Id: Ia9e1e807591d4428f585177f521d4cb9d463b917
2020-03-24 10:39:05 +00:00
Ivan Kolodyazhny 11d4954cc3 Use pyScss2 and django-pyscss2
pyScss and django-pyscss packages are not maintained for a long time. We
can't use the pyScss with teh setuptools>=46.0.0, so I forked these
project and switch horizon to use them.

Change-Id: I38a1c2c3455a10b4852d25f6c39b3c21f5c450fc
Depends-On: https://review.opendev.org/712976
2020-03-17 15:10:59 +02:00
Stephen Finucane f66ef7b5ae tests: Convert 'OpenStackAuthTestsV3Base' to mock (pt. 4)
This completes Mox removal from Horizon.

Change-Id: I73f7a01b7f655f7c1d0ba704f4417d6fe798a7eb
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
2020-03-09 13:07:30 +00:00
Akihiro Motoki 1570e5c3ed Remove Pint from requirements.txt
Pint is no longer used after horizon/utils/units.py was cleanup
by commit 26eebd4abb.

Change-Id: I17add5dc20846be052577db1ed8ca8bf98819846
2020-01-15 13:12:50 +09:00
Akihiro Motoki 5a1ab92d0a Use enmerkar instead of django-babel
Depends-On: https://review.opendev.org/#/c/700727/
Change-Id: If8af96389a2a8481b80b3297e4c231dd290eafbe
2019-12-29 08:45:50 +09:00
Akihiro Motoki a2a3e8b6c3 Drop Django 1.11 support
Django 1.11 support was dropped. Django 1.11 ends its extended support
in April 2020 which is before Ussuri release. Considering this,
horizon dropped Django 1.11 support.

Unnecessary Django version checks in the code are also dropped.

Change-Id: I2c58934f2b026745fbc97a58212b91d149db3657
2019-12-29 06:20:37 +09:00
Zuul f592481cc0 Merge "Add support for keystone access rules" 2019-11-25 09:25:56 +00:00
Zuul 21306e7cb3 Merge "Add custom SSL CA Cert support for api.cinder.get_microversion" 2019-11-19 19:25:01 +00:00
Colleen Murphy 4d1786c687 Add support for keystone access rules
Keystone implemented the ability to apply fine-grained access control
restrictions to application credentials[1]. This patch adds new fields
to the application credential creation form and detail view so that
horizon users can use this feature.

[1] http://specs.openstack.org/openstack/keystone-specs/specs/keystone/train/capabilities-app-creds.html

Depends-on: https://review.opendev.org/677585

Change-Id: I2d71392eb8569ffb8cb15af29eea76e120a158cc
2019-10-30 14:47:05 +09:00
Ivan Kolodyazhny 285c51f7e1 Add custom SSL CA Cert support for api.cinder.get_microversion
api.cinder.get_microversion function now supports OPENSTACK_SSL_NO_VERIFY
and OPENSTACK_SSL_CACERT config options.

This depends on commit 4a3a2c3c9a89ccff4e64d3da96de5b0af4303840 in
python-cinderclient, so the minimum version of python-cinderclient
is bumped to 5.0.0.

NOTE(amotoki): The stretegy of backporting to stable branches needs
a discussion with the requirements team as we cannot bump the
minimum version (at least the major version bump is surprising).

Change-Id: I22c6c60e10d8e9328f7f1e0c24d6c74496ec1a71
Closes-Bug: 1744670
2019-10-25 16:12:02 +09:00
Akihiro Motoki 205ebe0f47 tox: Move doc8 to docs related envs
Previously doc8 is run as part of pep8 tox env. This leads to some tricky
'deps' in pep8 which installs the docs dependencies. This can be fixed by
moving doc8 to the docs related tox envs (docs and releasenotes).

This also helps developers using devstack avoid hitting an error in
"manage.py compilemessages" in stack.sh. The error is caused by sphinx
installed under .tox directory (as compilemessages tries to compile all
message catalogs even under dot directories like .tox).
Developers sometimes change the horizon code under /opt/stack/horizon
and it is not surprising to run "tox -e pep8".
(I think it is more common compared to a chance to run "tox -e docs".)
Thus I believe it is reasonable to move doc8 to the docs env.

Change-Id: I6345ebbcd24afc358555e9be4b2ca700c4b33861
2019-10-02 09:28:11 +09:00
pengyuesheng b529f00937 Bump the openstackdocstheme extension to 1.20
Some options are now automatically configured by the version 1.20:
- project
- html_last_updated_fmt
- latex_engine
- latex_elements
- version
- release.

This will shows the version selector of the doc, too.

Change-Id: I38f0385a1fd676a4ba18259af7ad384af31ebe5a
2019-07-02 14:07:14 +08:00
Zuul e52d24b39b Merge "Add relnote on cinderclient minver bump to 4.0.1" 2019-05-16 09:57:34 +00:00
manchandavishal 91a57e56e0 Blacklist bandit 1.6.0
There's a regression[0] in bandit 1.6.0 which causes bandit to stop
respecting excluded directories, and our tests throw a bunch of
violations. Blacklist this version, but allow newer versions as there is
already a pull request[1] to fix it, and I expect it will be included in
the next release.

[0] https://github.com/PyCQA/bandit/issues/488
[1] https://github.com/PyCQA/bandit/pull/489
For additional details, refer to ML Thread[1]

[1] http://lists.openstack.org/pipermail/openstack-discuss/2019-May/006116.html

Change-Id: I01b3ee75aa52b2711bacbf26690ce55a4c3f336e
2019-05-15 15:56:25 +05:30
Akihiro Motoki e3c600cbbf Add relnote on cinderclient minver bump to 4.0.1
A fix for bug 1824017 bumped the minimum version requirement of
python-cinderclient to 4.0.0. The fix was backported to stable/stein,
so the minimum version bump should be covered by a release note.

python-cinderclient requirement is bumped to >=4.0.1
as 4.0.0 is blocked by global-requirements.txt [1].

It was suggested by the release team in the review of
horizon stein update release [2].

[1] 1baf07a773/global-requirements.txt (L256)
[2] https://review.opendev.org/#/c/655447/

Change-Id: I2b43e159da7e58980b2810a104ae2418f237d1c7
Related-Bug: #1824017
2019-05-11 10:46:50 +09:00
Corey Bryant f9b520f377 Set min version of python-cinderclient to 4.0.0
As of Stein, a minimum of python-cinderclient 4.0.0 is required to
create a volume. Cinder schema no longer accepts additional
properties on volume create that are not part of the API spec [1].

[1] https://review.openstack.org/#/c/573093/

Change-Id: I0fc4d5db39080985b471fe2465b7078e37417e4d
Closes-Bug: #1824017
2019-04-09 17:09:48 -04:00
Zuul 287323db45 Merge "Add a upgrade_check management command" 2019-03-06 22:28:31 +00:00
manchandavishal 4e8e907986 Add python-memcached library to test-requirements.txt
Horizon uses python-memcached while running "tox -e runserver"
so we need to add it to test-requirement.txt as well as
lower-constraints.txt.

Change-Id: I4319cf1a54310171baf1dbaf2e10acae8123dac6
2019-03-06 06:02:55 +00:00
Radomir Dopieralski d7d6c0577c Add a upgrade_check management command
This command checks the configuration for invalid and deprecated
settings, as described in
https://governance.openstack.org/tc/goals/stein/upgrade-checkers.html

There is also a script in tools/find_settings.py that scans all python
files for the potential new settings, which is supposed to make it
easier to update the lists that the checks use.

Change-Id: Ie85cf4be3da1ab446c10883a4580e20ea154b67c
Story: 2003657
Task: 26132
2019-03-01 15:43:13 +01:00
Ivan Kolodyazhny bdf7e69222 Update appdirs lower constraint to 1.4.0
appdirs v1.3.0 breaks gates because it's not compatible with isort
v4.3.9.

Change-Id: I54d0d840b4a34137283074dbf022b3467774d73c
2019-02-27 13:36:04 +02:00
Ivan Kolodyazhny 770afab1bf Remove nose references from Horizon
Commit I7fb2fd7dd40f301ea822154b9809a9a07610c507 changed test runner to
not use nose. So it's safe to remove all references now.

Change-Id: I8856e4e91b25f059645eb5e0356d207f6fc119f2
2018-09-22 20:11:30 +03:00
Nishant Kumar ccdf8c55e6 Add django-debreach to horizon
BREACH is a category of vulnerabilities and not a specific
instance affecting a specific piece of software. To be vulnerable,
a web application must:

  * Be served from a server that uses HTTP-level compression
  * Reflect user-input in HTTP response bodies
  * Reflect a secret (such as a CSRF token) in HTTP response bodies

More details on breach attack - http://breachattack.com/

Since horizon falls under this category, we can include django-debreach
module within horizon as a requirement which provides mitigation against the breach attacks.

https://github.com/lpomfrey/django-debreach

CSRF token masking is a built-in feature within Django 1.10+,
therefore only content-length modification feature provided by django-debreach
can be enabled.

Depends-On: I32f11e089fc794444ef267b463c7fb2ad8cfa96a

Change-Id: I2b4999ca7b0e1762c5273c4fe96f5ee768f44339
Blueprint: mitigate-breach-attacks
2018-08-25 07:49:32 +05:30
Stuart Grace 2e2ef6a8d0 Delete profiler object when request completes
When a request that is being profiled completes and the response is
received, the middleware expires the profiling cookie. It also needs
to delete the profiling object that holds the base_id UUID so a new
base_id will be created for the next profile. Otherwise the same
base_id is used for subsequent queries and they become merged togther
in the database.

Change-Id: I379cebfa2ed5282c96df0e255a8ba04c65a8523c
Closes-Bug: #1777486
Depends-On: https://review.openstack.org/578362
2018-07-24 12:33:31 +01:00