31382 Commits

Author SHA1 Message Date
Jeff Bradberry
028f09002f Fix the cleanup_jobs management command
It previously depended on a private Django internal class that changed
with Django 3.1.

I've switched here instead to disabling the django-polymorphic
accessors to get the underlying UnifiedJob object for a Job, which due
to the way they implement those was resulting in N+1 behavior on
deletes.  This gets us back most of the way to the performance gains
we achieved with the custom collector class.  See
https://github.com/django-polymorphic/django-polymorphic/issues/198.
2022-03-07 18:11:36 -05:00
Jeff Bradberry
0500512c3c Fix up deprecation warning about get_response for middleware
It will no longer be allowed to be None by Django 4.0
2022-03-07 18:11:36 -05:00
Jeff Bradberry
1e625ed58b Fix up deprecation warning about re_path() replacing urls() 2022-03-07 18:11:36 -05:00
Jeff Bradberry
e620bef2a5 Fix Django 3.1 deprecation removal problems
- FieldDoesNotExist now has to be imported from django.core.exceptions
- Django docs specifically say not to import
  django.conf.global_settings, which now has the side-effect of
  triggering one of the check errors
2022-03-07 18:11:36 -05:00
Jeff Bradberry
05142a779d Replace all usage of customized json fields with the Django builtin
The event_data field on event models, however, is getting an
overridden version that retains the underlying text data type for the
column, to avoid a heavy data migration on those tables.

Also, certain of the larger tables are getting these fields with the
NOT NULL constraint turned off, to avoid a long migration.

Remove the django.utils.six monkey patch we did at the beginning of
the upgrade.
2022-03-07 18:11:36 -05:00
Jeff Bradberry
65d17fb316 Upgrade to Django 3.1
- upgrades
  - Django 3.1.14
  - djangorestframework 3.13.1 (from 3.12.1)
  - djangorestframework-yaml 2.0.0 (from 1.0.3)
  - django-polymorphic 3.1.0 (from 2.1.2)
  - social-auth-core 4.2.0 (from 3.3.1)
  - social-auth-app-django 5.0.0 (from 3.1.0)
  - django-auth-ldap 4.0.0 (from 2.1.0)
  - django-crum 0.7.9 (from 0.7.5)

- django-jsonfield is removed
2022-03-07 18:11:36 -05:00
Jeff Bradberry
faa12880a9 Squash a few deprecation warnings
- inspect.getargspec() -> inspect.getfullargspec()
- register pytest.mark.fixture_args
- replace use of DRF's deprecated NullBooleanField
- fix some usage of naive datetimes in the tests
- fix some strings with backslashes that ought to be raw strings
2022-03-07 18:11:36 -05:00
Jeff Bradberry
9b6fa55433 Deal with breaking tests for 3.1
- Django's PostgreSQL JSONField wraps values in a JsonAdapter, so deal
  with that when it happens.  This goes away in Django 3.1.
- Setting related *_id fields clears the actual relation field, so
  trying to fake objects for tests is a problem
- Instance.objects.me() was inappropriately creating stub objects
  every time while running tests, but some of our tests now create
  real db objects. Ditch that logic and use a proper fixture where needed.
- awxkit tox.ini was pinned at Python 3.8
2022-03-07 18:11:36 -05:00
Jeff Bradberry
b852baaa39 Fix up logger .warn() calls to use .warning() instead
This is a usage that was deprecated in Python 3.0.
2022-03-07 18:11:36 -05:00
Jeff Bradberry
a3a216f91f Fix up new Django 3.0 deprecations
Mostly text based: force/smart_text, ugettext_*
2022-03-07 18:11:36 -05:00
Bill Nottingham
efff85bc1f Fix wsbroadcast for django 3.0+ async
From https://docs.djangoproject.com/en/3.0/topics/async/#asgiref.sync.sync_to_async
2022-03-07 18:11:36 -05:00
Jeff Bradberry
df61d1a59c Upgrade to Django 3.0
- upgrades
  - Django 3.0.14
  - django-jsonfield 1.4.1 (from 1.2.0)
  - django-oauth-toolkit 1.4.1 (from 1.1.3)
    - Stopping here because later versions have changes to the
      underlying model to support OpenID Connect.  Presumably this can
      be dealt with via a migration in our project.
  - django-guid 2.2.1 (from 2.2.0)
  - django-debug-toolbar 3.2.4 (from 1.11.1)
  - python3-saml 1.13.0 (from 1.9.0)
  - xmlsec 1.3.12 (from 1.3.3)

- Remove our project's use of django.utils.six in favor of directly
  using six, in awx.sso.fields.

- Temporarily monkey patch six back in as django.utils.six, since
  django-jsonfield makes use of that import, and is no longer being
  updated.  Hopefully we can do away with this dependency with the new
  generalized JSONField brought in with Django 3.1.

- Force a json decoder to be used with all instances of JSONField
  brought in by django-jsonfield.  This deals with the 'cast to text'
  problem noted previously in our UPGRADE_BLOCKERS.

- Remove the validate_uris validator from the OAuth2Application in
  migration 0025, per the UPGRADE_BLOCKERS, and remove that note.

- Update the TEMPLATES setting to satisfy Django Debug Toolbar.  It
  requires at least one entry that has APP_DIRS=True, and as near as I
  can tell our custom OPTIONS.loaders setting was effectively doing
  the same thing as Django's own machinery if this setting is set.
2022-03-07 18:11:36 -05:00
Shane McDonald
4450b11e61
Merge pull request #11844 from AlanCoding/shane_forward
Adopt changes to AWX_ISOLATION_SHOW_PATHS for trust store
2022-03-07 16:28:42 -05:00
Shane McDonald
9f021b780c Move default show paths to production.py
This breaks the dev env
2022-03-07 16:08:58 -05:00
Shane McDonald
7df66eff5e
Merge pull request #11855 from Spredzy/addpackaging
requirements: Add packaging deps following runner upgrade
2022-03-07 15:23:19 -05:00
Yanis Guenane
6e5cde0b05 requirements: Add packaging deps following runner upgrade 2022-03-07 20:51:11 +01:00
Marliana Lara
0d0a8fdc9a
Merge pull request #11850 from marshmalien/11626-hide-user-only-access-roles
Remove user_only roles from User and Team permission modal
2022-03-07 12:12:31 -05:00
Shane McDonald
a5b888c193
Add default container mounts to AWX_ISOLATION_SHOW_PATHS 2022-03-07 11:45:23 -05:00
Jeff Bradberry
32cc8e1a63
Merge pull request #11845 from jbradberry/awxkit-import-role-precedence
Expand out the early membership role assignment
2022-03-07 11:21:48 -05:00
Jeff Bradberry
69ea456cf6 Expand out the early membership role assignment
The Member role can derive from e.g. the Org Admin role, so basically
all organization and team roles should be assigned first, so that RBAC
conditions are met when assigning later roles.
2022-03-07 09:30:10 -05:00
Alan Rominger
e02e91adaa
Merge pull request #11837 from AlanCoding/thread_key_error
Move model and settings operations out of threaded code
2022-03-05 14:55:13 -05:00
Alan Rominger
264c508c80
Move model and settings operations out of threaded code
This is to avoid references to settings in threads,
  this is known to create problems when caches expire
  this leads to KeyError in environments with heavy load
2022-03-04 15:31:12 -05:00
Kersom
c6209df1e0
Api issue float (#11757)
* Fix integer/float errors in survey

* Add SURVEY_TYPE_MAPPING to constants

Add SURVEY_TYPE_MAPPING to constants, and replace usage in a couple of
files.

Co-authored-by: Alexander Komarov <akomarov.me@gmail.com>
2022-03-04 14:03:17 -05:00
Marliana Lara
a155f5561f
Remove user_only roles from User and Team permission modal 2022-03-04 13:56:03 -05:00
Shane McDonald
0eac63b844
Merge pull request #11836 from nixocio/ui_ci_matrix
Split UI tests run
2022-03-04 11:50:28 -05:00
Sarah Akus
d07c2973e0
Merge pull request #11792 from marshmalien/8321-job-list-schedule-name
Add schedule detail to job list expanded view
2022-03-04 11:46:45 -05:00
nixocio
f1efc578cb Split UI test run
Split UI test run

See: https://github.com/ansible/awx/issues/10678
2022-03-03 16:22:32 -05:00
Seth Foster
0b486762fa
Merge pull request #11840 from fosterseth/meta_vars_priority
load job meta vars after JT extra vars
2022-03-03 13:13:34 -05:00
Alan Rominger
17756f0e72
Add job execution environment image to analytics data (#11835)
* Add job execution environment image to analytics data

* Add EE image to UJT analytics data

* Bump the unified job templates table
2022-03-03 11:13:11 -05:00
Alan Rominger
128400bfb5
Add resolved_action to analytics event data (#11816)
* Add resolved_action to analytics event data

* Bump collector version
2022-03-03 10:11:54 -05:00
Seth Foster
de1df8bf28
load job meta vars after JT extra vars 2022-03-02 14:42:47 -05:00
Alex Corey
fe01f13edb
Merge pull request #11790 from AlexSCorey/11712-SelectRelatedQuery
Use select_related on db queries to reduce db calls
2022-03-02 11:33:45 -05:00
Shane McDonald
3b6cd18283
Merge pull request #11834 from shanemcd/automate-galaxy-and-pypi
Automate publishing to galaxy and pypi
2022-03-01 16:22:39 -05:00
Keith Grant
4f505486e3
Add Toast messages when resources are copied (#11758)
* create useToast hook

* add copy success toast message to credentials/inventories

* add Toast tests

* add copy success toast to template/ee/project lists

* move Toast type to types.js
2022-03-01 15:59:24 -05:00
Shane McDonald
f6e18bbf06 Publish to galaxy and pypi in promote workflow 2022-03-01 15:42:13 -05:00
Marcelo Moreira de Mello
a988ad0c4e
Merge pull request #11659 from ansible/expose_isolate_path_k8s
Allow isolated paths as hostPath volume @ k8s/ocp/container groups
2022-03-01 10:52:36 -05:00
Shane McDonald
a815e94209
Merge pull request #11737 from ansible/update-minikube-docs
update minkube docs with steps for using custom operator
2022-03-01 07:49:21 -05:00
Shane McDonald
650bee1dea
Merge pull request #11749 from rh-dluong/fix-ocp-cred-desc
Fixed doc string for Container Groups credential type
2022-03-01 07:48:37 -05:00
Shane McDonald
80c188586c
Merge pull request #11798 from john-westcott-iv/saml_attr_lists
SAML superuse/auditor working with lists
2022-03-01 07:42:35 -05:00
Shane McDonald
b5cf8f9326
Merge pull request #11819 from shanemcd/transmitter-future
Reimplement transmitter thread as future
2022-03-01 07:33:26 -05:00
Marliana Lara
1aefd39782
Show deleted detail for deleted schedules 2022-02-28 15:51:36 -05:00
Marliana Lara
8c21a2aa9e
Add schedule detail to job list expanded view 2022-02-28 14:59:03 -05:00
Shane McDonald
2df3ca547b Reimplement transmitter thread as future
This avoids the need for an explicit `.join()`, and removes the need for the TransmitterThread wrapper class.
2022-02-28 11:21:53 -05:00
Marcelo Moreira de Mello
8645147292
Renamed scontext variable to mount_options 2022-02-28 10:22:24 -05:00
Marliana Lara
169da866f3
Add UI unit tests to job settings 2022-02-28 10:22:24 -05:00
Marcelo Moreira de Mello
5e8107621e
Allow isolated paths as hostPath volume @ k8s/ocp/container groups 2022-02-28 10:22:20 -05:00
Alan Rominger
eb52095670
Fix bug where translated strings will cause log error to error (#11813)
* Fix bug where translated strings will cause log error to error

* Use force_str for ensuring string
2022-02-28 08:38:01 -05:00
John Westcott IV
cb57752903
Changing session cookie name and added a way for clients to know what the name is #11413 (#11679)
* Changing session cookie name and added a way for clients to know what the key name is
* Adding session information to docs
* Fixing how awxkit gets the session id header
2022-02-27 07:27:25 -05:00
Shane McDonald
895c05a84a
Merge pull request #11808 from john-westcott-iv/fix_minicube
Chaning API version from v1beta1 to v1
2022-02-24 16:32:21 -05:00
John Westcott IV
4d47f24dd4 Chaning API version from v1beta1 to v1 2022-02-24 11:17:36 -05:00