Victor Seva
9692d18b06
TT#188000 build: fix retrigger error
...
│[info ] request_started [django_structlog.middlewares.request] ip=10.10.26.23 request=POST /build/70c2ba0c-7459-4d54-a584-630b4f5269fb/ngcp-schema/?format=json request_id=dceefdd8-6dfc-49f8-a262-194bd0e30707 user_agent=Mozilla/5.0 (X11; Linux x86_64) AppleWebK│
│Traceback (most recent call last): │
│ File "/var/lib/repoapi/venv_prod/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response │
│ response = wrapped_callback(request, *callback_args, **callback_kwargs) │
│ File "/var/lib/repoapi/venv_prod/lib/python3.9/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view │
│ return view_func(*args, **kwargs) │
│ File "/var/lib/repoapi/venv_prod/lib/python3.9/site-packages/django/views/generic/base.py", line 70, in view │
│ return self.dispatch(request, *args, **kwargs) │
│ File "/var/lib/repoapi/venv_prod/lib/python3.9/site-packages/rest_framework/views.py", line 509, in dispatch │
│ response = self.handle_exception(exc) │
│ File "/var/lib/repoapi/venv_prod/lib/python3.9/site-packages/rest_framework/views.py", line 469, in handle_exception │
│ self.raise_uncaught_exception(exc) │
│ File "/var/lib/repoapi/venv_prod/lib/python3.9/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception │
│ raise exc │
│ File "/var/lib/repoapi/venv_prod/lib/python3.9/site-packages/rest_framework/views.py", line 497, in dispatch │
│ self.initial(request, *args, **kwargs) │
│ File "/var/lib/repoapi/venv_prod/lib/python3.9/site-packages/rest_framework/views.py", line 415, in initial │
│ self.check_permissions(request) │
│ File "/var/lib/repoapi/venv_prod/lib/python3.9/site-packages/rest_framework/views.py", line 332, in check_permissions │
│ if not permission.has_permission(request, self): │
│ File "/var/lib/repoapi/venv_prod/lib/python3.9/site-packages/rest_framework/permissions.py", line 76, in has_permission │
│ self.op2.has_permission(request, view) │
│ File "/var/lib/repoapi/venv_prod/lib/python3.9/site-packages/rest_framework/permissions.py", line 229, in has_permission │
│ queryset = self._queryset(view) │
│ File "/var/lib/repoapi/venv_prod/lib/python3.9/site-packages/rest_framework/permissions.py", line 205, in _queryset │
│ assert hasattr(view, 'get_queryset') \ │
│AssertionError: Cannot apply DjangoModelPermissions on a view that does not set `.queryset` or have a `.get_queryset()` method.
Change-Id: I31ea798c4b34a9f7c2ff15e4d4be52c9558fec0d
3 years ago
dependabot[bot]
f1d45b79de
TT#121955 Bump django from 3.2.14 to 3.2.15 in /requirements
...
Bumps [django](https://github.com/django/django ) from 3.2.14 to 3.2.15.
- [Release notes](https://github.com/django/django/releases )
- [Commits](https://github.com/django/django/compare/3.2.14...3.2.15 )
Change-Id: I26c74de3db608b5ad2a9a479efd90ada85689e37
3 years ago
Victor Seva
2863cb123a
TT#121955 update django to latest 3.2.X version
...
https: //docs.djangoproject.com/en/dev/releases/3.2.14/
Change-Id: I817ccfe73546944d179faa9866f3215602ad6ba5
3 years ago
Victor Seva
dc4d12a68f
TT#15305 build: don't trigger build_matrix if not done
...
Change-Id: I0832426b87d639ea85f2cd261d3313a8b6663ffc
3 years ago
Victor Seva
5bb552b4a0
TT#121955 celery: fix problems with serialization, take two
...
Change-Id: I3200774ce7909253feddb99e334ec301e29c07ec
3 years ago
Victor Seva
44cf97115c
TT#121955 extend coverage of templates
...
Change-Id: Ied706fb9696a5dd62087555dedf8fae13efcb304
3 years ago
Victor Seva
35e502d124
TT#121955 celery: fix problems with serialization
...
> amqp.exceptions.FrameSyntaxError: Table type <class 'pathlib.PosixPath'> for key b'base_path' not handled by amqp. [value: PosixPath('/var/lib/repoapi/jbi_files/rate-o-mat-repos/1148')]
Change-Id: I9c8a11a9b7a63b3b8af2631f15a24199389fabb0
3 years ago
Victor Seva
dbdd352626
TT#15305 release_dashboard: fix missing template for docker
...
Change-Id: I21b3235bcc06cd0e9fc38b8dbca6c43033fdc054
3 years ago
Victor Seva
1ad5cce788
TT#152750 enforce perms in views and templates
...
Change-Id: Ifbffb02c5bc833cc4295745c7729e34fa8e0486a
3 years ago
Victor Seva
10ce513d20
TT#152750 build: permissions
...
* We want to split build releases from hotfix perms
* create dev and devops groups and assign desired permissions.
These groups will match LDAP groups.
* create permissions using hack stolen from
https://stackoverflow.com/questions/29296757/django-data-migrate-permissions
Change-Id: I1b82ebf13aa3cba05e4733e4bef186fbbb52bb13
3 years ago
Victor Seva
dcc424c7af
TT#152750 LDAP posixGroups groups
...
new fields at server.ini file needed!!
* AUTH_LDAP_GROUP_BASE: LDAP base query for get posixGroups
* AUTH_LDAP_REQUIRE_GROUP_LIST: coma separated list of required groups
Change-Id: If82b983aabe8cebc0491c04d467e955b503956d3
3 years ago
Victor Seva
7bfdbb0900
TT#180600 repoapi: dumpdata_release
...
django-admin command to export all jbi objects related to a BuildRelease
This helps developers to import the file afterwards via admin site
Change-Id: Id10ef618f18df10d6fdf066a29de40271d685cb3
3 years ago
Victor Seva
653f0e629b
TT#180600 release_dashboard: introduce templatetags
...
* we can't use '.' at html if attribute
Change-Id: I15b94aeb8200ea24853ac9dfa92df8f179d0bd37
3 years ago
Victor Seva
dd26740524
TT#15305 relase_dashboard: build_releases, split master releases
...
* fix order with humansort
* add label mrX.X
Change-Id: Ibe26b0e77cf1b47691db4baa1045d9fffac83198
3 years ago
Victor Seva
24dd8bcfbd
TT#15305 release_dashboard: hotfix from release directly
...
* don't use any info from Projects, just from ReleaseConfig
Change-Id: I703f14d9ae0e3781adf1fb8f47147ee24c3c01a0
3 years ago
Victor Seva
b1d13db756
TT#15305 panel: fix navlist links at release_uuid
...
Change-Id: Id3a3837e5995f12f5d3ff4d64362e28661d401a6
3 years ago
Victor Seva
6d36b04d65
TT#15305 fix urls
...
* don't add '^' twice for api urls
* don't add format_suffix for gerrit/refresh
* add missing format parameter for API views
Change-Id: I2c8cef000c0aec3524302cc5c5a7a201f9cf90d1
3 years ago
Victor Seva
cbcf1f6227
TT#15305 release_dashboard: remove unused code
...
We did remove the old way to build releases
Change-Id: Ia8aa02c1fc9baec83315c567e189453e0b141d6b
3 years ago
Victor Seva
28d1be9a4c
TT#15305 release_dashboard: remove old build process
...
We no longer use the old way of build projects/releases, lets
remove no used code
Change-Id: Ia39eb72af87f72d0a785ac790f48003e6d9be821
3 years ago
Victor Seva
28a0d343ef
TT#15305 build: add missing readonly fields to admin panel
...
Change-Id: I1043d16660d3c9e8daab66082884da49ef4b87c3
3 years ago
Victor Seva
2a335babf1
TT#15305 build: improve refresh_projects
...
When refreshing list of projects, remove every info related to
any old project
We had this scenario when releasing mr10.5, ngcp-cve-scanner was
wrongly added as a project and we couldn't resume the build until
I removed the related info
Change-Id: I58ee97f3256bb63a0a07a6ed606ede0c233cfb84
3 years ago
Victor Seva
460f775436
TT#15305 build: don't trigger already triggered external job
...
* build_resume can be triggered several times due to pool size
* keep triggered_jobs info in db
Change-Id: Iedfca9d386af5cfd9f52b6fd8b513c181f2d4983
3 years ago
Sergii Kipot
41f538ff3d
TT#172051 Add ngcp-cve-scanner repo to repoapi dashboard
...
Change-Id: If33b3e80575ef48afd74033c611eed7a370c4bd7
3 years ago
Victor Seva
907f0cdb2e
TT#15305 build: add links to gitweb for projects at build_release.html
...
Change-Id: I8625495f36c46e8667ff744dd0716de8533100e3
3 years ago
Victor Seva
66d3cbb933
TT#15305 build: trigger weekly-build-matrix-trunk-weekly
...
when build release is done... lets trigger the job to build Vms
Change-Id: I5fdf80ae0c8fdd5de6e5e19cc85bbf9c98dc354c
3 years ago
Victor Seva
753e79f548
TT#15305 build: fix get_common_release for trunk-weekly
...
Change-Id: Id19002bf24a4416e835d4765e87f9d4b3637b746
3 years ago
Guillem Jover
37fef5f651
TT#124273 Use execute_after_ instead of override_ for dh command
...
This avoids duplicating the call we want to hook into.
Change-Id: I91837467466ed5cbbaad0d75b72604f220846730
3 years ago
Guillem Jover
2b85ace62d
TT#124273 Update packaging for bullseye
...
- Switch to debhelper compat level 13.
- Switch to Standards-Version 4.5.1.
- Update copyright years.
Change-Id: I3f3f6040df09dfd353d06a63143f3b98bac1e5df
3 years ago
Victor Seva
9159fbae1d
TT#15305 build: support trunk-weekly release
...
* trunk-weekly as a normal release, with its own
config file. The idea is to convert eventually
trunk-* too
* match for relase-trunk-* doesn't work anymore
Change-Id: I4967ccc3b5ac47dbebdf6da16d404710fc72da49
3 years ago
Victor Seva
da38972015
TT#15305 build: don't allow trigger builds that have unfinished previous builds
...
* don't allow to trigger more than one build for instance of
release-trunk-* or mrX.Y
* autoupdate pre-commit config
Change-Id: I7183b8645155ca017e9796664d2570e88a29c44e
3 years ago
Victor Seva
c488bc8591
TT#15305 build: fix detection of build permissions
...
* calling build from API was always unauthorized
* drfapikey only supports Django until 1.10 version
* https://florimondmanca.github.io/djangorestframework-api-key/
supports modern Python and Django versions
- remove useless BUILD_KEY_AUTH preference, it's True always
Change-Id: I5521b07532dba12abea52982d376eb83293f6a38
3 years ago
Victor Seva
5a193617ba
TT#121955 dev: pin working version of Werkzeug
...
See for details https://github.com/django-extensions/django-extensions/pull/1716
Change-Id: Ic253ba8ef845fce03723ff4ed76e827edc9709fa
3 years ago
Victor Seva
eb4f76f554
TT#121955 build: detect release_uuid empty value
...
> [info ] request_started [django_structlog.middlewares.request] ip=192.168.208.21 request=POST /jenkinsbuildinfo/ request_id=e435d38f-f690-4ba6-8b58-01ef76d0d988 user_agent=python-requests/2.21.0 user_id=None
> {'request_id': 'e435d38f-f690-4ba6-8b58-01ef76d0d988', 'user_id': None, 'ip': '192.168.208.21', 'release_uuid': '$release_uuid', 'release': 'release-mr7.5-update', 'event': 'BuildRelease not found', 'logger': 'build.signals', 'level': 'error'}
Change-Id: I0aa2eb7690d52becbe4ae556e561f87017b50d16
3 years ago
Victor Seva
29f7f9682f
TT#121955 update django to latest 3.2 release
...
Change-Id: I78e094ed7d88bf93772f34a6045c56e3839e79be
3 years ago
Michael Prokop
1e51a3ec78
TT#154401 New release v0.4.5
...
Change-Id: Iac013a82763b919fc830b8ca6e6e0550a0d3240f
3 years ago
Victor Seva
6f043a0b9f
TT#121955 migrate missing files to structlog
...
Just to keep consistency on project
Change-Id: I8e2cec10baa92d00915229bb118be585492ac598
3 years ago
Victor Seva
504110f9e5
TT#121955 test: override DEBUG value
...
Change-Id: Icfcbfc847feb1a694bb7c9537b628fe449cdb9c4
3 years ago
Victor Seva
987c13bbd3
TT#121955 decouple tasks and signals from models, take two
...
Change-Id: Iccad4885c3f9e510a9fd297606d83668e584999e
3 years ago
Victor Seva
e4aa31a7e3
TT#121955 repoapi: don't use send_task directly
...
Change-Id: Iffcd0c084281158106d8c582930331f841af9757
3 years ago
Victor Seva
d832e3233c
TT#121955 migrate to pathlib
...
Change-Id: Ie3dbd8503d6c61dda3d187de65a5694cbc4f957f
3 years ago
Victor Seva
df32d4377d
TT#121955 py-test: add coverage for django templates
...
https://github.com/nedbat/django_coverage_plugin
Change-Id: I74a5638fea8b2460fc7bd04abe47be210c3f46bb
3 years ago
Victor Seva
67f093202c
TT#121955 py-test: define cache_dir to avoid PytestCacheWarning
...
> /usr/lib/python3/dist-packages/_pytest/stepwise.py:122
> /usr/lib/python3/dist-packages/_pytest/stepwise.py:122: PytestCacheWarning: could not create cache path /code/.pytest_cache/v/cache/stepwise
> self.config.cache.set("cache/stepwise", [])
>
> /usr/lib/python3/dist-packages/_pytest/cacheprovider.py:396
> /usr/lib/python3/dist-packages/_pytest/cacheprovider.py:396: PytestCacheWarning: could not create cache path /code/.pytest_cache/v/cache/nodeids
> config.cache.set("cache/nodeids", sorted(self.cached_nodeids))
>
> /usr/lib/python3/dist-packages/pytest_pep8.py:44
> /usr/lib/python3/dist-packages/pytest_pep8.py:44: PytestCacheWarning: could not create cache path /code/.pytest_cache/v/pep8/mtimes
> config.cache.set(HISTKEY, config._pep8mtimes)
Change-Id: Ia5d6ebd823d1a51967a0b6d0a64f534a1fc1f577
3 years ago
Victor Seva
abff367347
TT#121955 repoapi: fix RuntimeWarning on tests
...
https://docs.djangoproject.com/en/3.2/ref/utils/#django.utils.timezone.make_aware
> repoapi/test/test_model_queries.py::JBIQueriesTestCase::test_purge_release
> /usr/local/lib/python3.9/dist-packages/django/db/models/fields/__init__.py:1416: RuntimeWarning: DateTimeField JenkinsBuildInfo.date received a naive datetime (2022-01-25 13:41:29.434857) while time zone support is active.
> warnings.warn("DateTimeField %s received a naive datetime (%s)"
> repoapi/test/test_tasks.py::TasksTestCase::test_purge
> /usr/local/lib/python3.9/dist-packages/django/db/models/fields/__init__.py:1416: RuntimeWarning: DateTimeField JenkinsBuildInfo.date received a naive datetime (2022-01-25 13:41:29.653135) while time zone support is active.
> warnings.warn("DateTimeField %s received a naive datetime (%s)"
Change-Id: Ieceea8127a2ec2ec14b41abef45baf526ae26776
3 years ago
Victor Seva
69c44c41c1
TT#121955 add validate_templates test
...
https://django-extensions.readthedocs.io/en/latest/validate_templates.html
* add missing optional requirement
> django_filters/templates/django_filters/rest_framework/crispy_form.html: TemplateSyntaxError 'crispy_forms_tags' is not a registered tag library. Must be one of:
> admin_list
> admin_modify
> admin_urls
> assets
> cache
> debugger_tags
> highlighting
> i18n
> import_export_tags
> indent_text
> jsonify
> l10n
> log
> rest_framework
> static
> syntax_color
> tz
> widont
> CommandError: 1 errors found
Change-Id: I6e425cd9dfde112c64143dae3350dce5839311b7
3 years ago
Victor Seva
a8a3bccf54
TT#121955 update debian changelog
...
Change-Id: I5bb5c6aff79ab9f4ba5ccd76f3b1af539a471bff
3 years ago
Victor Seva
a245cc8a8c
TT#121955 decouple tasks and signals from models
...
* migrate to structlog on all of them
Change-Id: I6f89a5880c5d517b2c5525503d88b5b6d815797a
3 years ago
Victor Seva
c8abcd38e6
TT#121955 update Django to 3.2
...
* set DEFAULT_AUTO_FIELD
https://docs.djangoproject.com/en/3.2/releases/3.2/#customizing-type-of-auto-created-primary-keys
* use app_name on INSTALLED_APPS
https://docs.djangoproject.com/en/3.2/releases/3.2/#automatic-appconfig-discovery
Change-Id: If43954d54e4094feab88370f375b46d5905a0be3
3 years ago
Victor Seva
ec5c90554c
TT#121955 force explicit relative import everywhere
...
Change-Id: Ie47dda3c812ccb99d164a67cbfbf9fed321f3c71
3 years ago
Victor Seva
b4a4e72cc6
TT#121955 build: remove module models
...
Change-Id: I4bc608f5c84359c155895935a3b77c24ba0f44c0
3 years ago
Victor Seva
8da6c9cb48
TT#121955 define resources for django-import-export
...
https://django-import-export.readthedocs.io/en/latest/getting_started.html#creating-import-export-resource
* admin integration
https://django-import-export.readthedocs.io/en/latest/getting_started.html#admin-integration
Change-Id: I67da67943eea7b39fe63d7d8a910e2b889f92f6e
3 years ago