Akita Noek
44a8da83c2
Removed all encompassing .distinct() call for all views
...
This .distinct() call applied .distinct() to all list query sets. Most
query sets are already unique, and adding .distinct causes the database
to do a lot of extra work. Views that rely on this behavior will be
rooted out during the hardening sprint and .distinct() will be added to
the individual querysets as needed instead of applying this everywhere.
2016-04-22 12:30:03 -04:00
Akita Noek
f57b6da6a5
.gitignore updates
2016-04-20 14:57:35 -04:00
Akita Noek
659d43136f
Added missing import
2016-04-20 11:50:20 -04:00
Akita Noek
31920c6700
Removed awx/api/tests dir from Makefile since it no longer exists
2016-04-20 11:48:09 -04:00
Akita Noek
22f18715f7
Removed dup tests, moved old api tests into main/tests/old/api
2016-04-20 11:29:01 -04:00
Akita Noek
568f0e43a5
Skip old slow tests for normal unit test runs, pick them up in nightly runs
2016-04-20 11:27:17 -04:00
Akita Noek
a0d25434df
Skip old splunk test
...
This should be removed by #1613
2016-04-20 10:50:54 -04:00
Akita Noek
0434712dc9
Complete the removal of cycle support in RBAC
...
We removed the actual need for this when we broke the org<->team cycle.
This patch removes the code we had to support that, but since it's
costly and unused, it's now nixxed.
2016-04-19 22:14:38 -04:00
Akita Noek
70148dc2f3
Restored old large inventory test timings
...
Fixes #1584
2016-04-19 22:14:38 -04:00
Akita Noek
f85090110f
Fixed up fact tests to work with both sqlite and postgres
...
Ugly hack for now.. should be cleaned up when we get everything moved
over to postgres
2016-04-19 22:14:38 -04:00
Akita Noek
6864701d8b
Revert "Fixed fact cache test difference between sqlite3 and postgres"
...
This reverts commit 631084b10f4435efe56d3a4fc774dd250f74e2ee.
2016-04-19 22:14:38 -04:00
Akita Noek
127bff5134
Moved role rebuild batching down into sim rebuild code so we can call it directly
2016-04-19 22:14:38 -04:00
Akita Noek
5197c1b65a
Optimized implicit role creation for new instances of resources
2016-04-19 22:14:38 -04:00
Akita Noek
233ed894d6
Optimized ImplicitRoleField post_delete action
2016-04-19 22:14:38 -04:00
Akita Noek
c0e056d6d0
Fixed fact cache test difference between sqlite3 and postgres
...
I guess the sqlite adaptation of the JSONField was resulting in a json
encoded blob, where as the postgres version returned something that got
parsed out normally with the rest of the query result?
2016-04-19 22:14:38 -04:00
Akita Noek
6349cc0f85
Skip test_fact.py migrations if MONGO_DB is not confingured
2016-04-19 22:14:38 -04:00
Akita Noek
7ee2c89ab5
test_notifications.py id fix
...
Ass-ummed an id of 1
2016-04-19 22:14:38 -04:00
Akita Noek
85a1b30af5
Skip activity stream tests if activity stream is disabled
2016-04-19 22:14:38 -04:00
Akita Noek
450e6f2885
Removed git configuration from org count projects
...
Avoids unnecessary cloning of said git repo, runs in 4 seconds now
instead of 50 seconds
2016-04-19 22:14:38 -04:00
Akita Noek
2a0b445488
Remove git project configuration from project test fixtures
...
Having this in here causes us to go out and pull down the repo whenever
we run a test, adds around 9 seconds per test on a good connection.. if
we need real data in here, we should figure out how to get it locally
2016-04-19 22:14:38 -04:00
Akita Noek
f0aebd00eb
Removed transaction=True from pytests
...
This was overkill and cost 3s per instance, all we needed to do is wrap
things that expectedly fail transactions with transaction.atomic()
2016-04-19 22:14:38 -04:00
Akita Noek
ad423e976b
Bump splunk time limit up to pass tests, will fix in #1584
2016-04-18 17:58:18 -04:00
Akita Noek
043c71728c
Bump our monolithic test time back up.. will try and reduce it post-merge
2016-04-18 17:06:47 -04:00
Akita Noek
41553c39bf
Moved dummy data generator out to tools directory
2016-04-18 16:56:29 -04:00
Akita Noek
97f70cdbbc
Merge branch 'devel' of github.com:ansible/ansible-tower into 11th-hour
2016-04-18 16:30:55 -04:00
Akita Noek
c3144dc4d3
benign 0008 migration change to make makemigrations happy
2016-04-18 16:26:11 -04:00
Akita Noek
07eccbe3e4
Migration for dropping implicit host inventory,name ordering
2016-04-18 16:22:14 -04:00
Akita Noek
96aa3e2555
Attempt 2 at making jenkins' sqlite happy
2016-04-18 15:26:09 -04:00
Akita Noek
0349737538
Attempt at a workaround for our larger sqlite tests
...
These tests are only failing on jenkins, not on our local dev
environments.
2016-04-18 14:32:21 -04:00
Akita Noek
0cf096e5b0
Updated users.py test expectations to match our current behavior
2016-04-18 14:31:42 -04:00
Akita Noek
ceff538969
Merge branch '11th-hour' of github.com:anoek/ansible-tower into 11th-hour
2016-04-18 14:12:44 -04:00
Akita Noek
f71c54f882
Merge branch 'devel' of github.com:ansible/ansible-tower into 11th-hour
2016-04-18 11:47:00 -04:00
Akita Noek
878455187f
Optimized viewable user list, fixed up some project readability bugs
2016-04-18 11:28:46 -04:00
Akita Noek
8b67f1d1c6
Removed team<->org role cycle
2016-04-18 11:27:22 -04:00
Akita Noek
6d8bab97df
Only rebuild ancestor list on post_* events
2016-04-18 08:53:40 -04:00
Akita Noek
2a676d80ce
Handle vacuous role rebuilding condition instead of exploding
2016-04-18 08:45:44 -04:00
Akita Noek
85843cc6ad
Fixed up some RBAC indexing
2016-04-17 10:20:38 -04:00
Akita Noek
a9f2507e91
flake8
2016-04-16 18:54:45 -04:00
Akita Noek
7637b51992
Merge branch 'devel' of github.com:ansible/ansible-tower into 11th-hour
2016-04-16 18:35:25 -04:00
Akita Noek
74caa18cb5
Ditch some expensive prefetching for Hosts
...
This prefetching gets really expensive when we have a large number of
hosts, it's far less expensive to just go out and do subsequent queries
to pull this data in. (dropped aggregate query time down from ~2400ms to
~180ms)
2016-04-16 18:32:54 -04:00
Akita Noek
a7f9eedb21
Be more explicit with our user_admin_role selection to avoid potential future bugs
2016-04-16 18:32:34 -04:00
Akita Noek
849a9c08b0
Drop our implicit order by inventory for Host models
...
Sorting by inventory (which is really by inventory.name) which is
untenable for a large number of hosts
2016-04-16 18:30:30 -04:00
Akita Noek
850e4c3ace
Test fixes and a couple of view optimizations
2016-04-16 18:30:06 -04:00
Akita Noek
5d0c6cc044
Switch to custom ancestry table for some optimized queries
...
Now we can stuff some more data in this table so we can take advantage
of some multi-column indexing and avoid another to join for our
accessible objects and permissions queries.
2016-04-16 18:27:57 -04:00
Akita Noek
25303cf4ec
Reverted user owner_role back to admin_role
2016-04-16 18:24:26 -04:00
Akita Noek
6c50d0793d
More test fixes
2016-04-16 10:22:03 -04:00
Akita Noek
2c45f79298
Migration updates for RolePermission removal
2016-04-16 08:47:51 -04:00
Akita Noek
7659da6162
Fixes for old/ad_hoc.py tests
2016-04-16 08:36:36 -04:00
Akita Noek
7bfc8cd43b
flake8
2016-04-15 17:22:48 -04:00
Akita Noek
302774e85d
Fixed up access_list functionality
2016-04-15 16:47:12 -04:00
Akita Noek
5e7b6ed084
fixes for api/test_credential.py
2016-04-15 16:29:22 -04:00
Akita Noek
d5bc455677
admins can use credentials too
2016-04-15 16:27:24 -04:00
Akita Noek
1fa70106d8
Added read_role to credential
2016-04-15 16:26:59 -04:00
Akita Noek
8c8c8a624f
Updates to views.py for RolePermission removal
2016-04-15 16:18:17 -04:00
Akita Noek
527be453a4
fix last cred test
2016-04-15 16:11:44 -04:00
Akita Noek
c440aefd85
fix jt tests
2016-04-15 16:08:14 -04:00
Akita Noek
926d58b8b7
Merge branch '11th-hour' of github.com:anoek/ansible-tower into 11th-hour
2016-04-15 15:56:10 -04:00
Akita Noek
2979f6e6d3
jobtemplate execute_role is now child of admin_role
2016-04-15 15:55:59 -04:00
Akita Noek
d2a81f46e3
Fixed up last test case for host access
2016-04-15 15:16:47 -04:00
Akita Noek
8653b61cc0
accessible_by -> in changes in test_rbac_inventory.py
2016-04-15 15:08:40 -04:00
Akita Noek
8f70884c2a
role check fix
2016-04-15 15:08:12 -04:00
Akita Noek
2ddac6cb64
Fixed up some role parenting
2016-04-15 15:07:50 -04:00
Akita Noek
a361f14266
Added adhoc_role to inventory and group, read_role to CustomInventorySource
2016-04-15 14:57:08 -04:00
Akita Noek
fa10d562c1
Replaced get user permissions with get_roles_on_resource
2016-04-15 14:36:52 -04:00
Akita Noek
128a4f1823
Added read_role to inventory, group, and job templates
2016-04-15 14:33:09 -04:00
Akita Noek
b25894aae8
New field name fixes
2016-04-15 12:19:06 -04:00
Akita Noek
9f5caa111d
Merge branch '11th-hour' of github.com:anoek/ansible-tower into 11th-hour
2016-04-15 12:17:23 -04:00
Akita Noek
859d670fc8
Removed RolePermission stuff for Hosts
2016-04-15 10:59:15 -04:00
Akita Noek
3b2c6747d3
Updated test_rbac_core.py test for RolePermission removal
2016-04-15 10:39:51 -04:00
Akita Noek
6d34ca9d22
Proof of concept hacks for RolePermission elimination
2016-04-15 10:03:50 -04:00
Akita Noek
872ce2f9e8
Merge branch 'ancestor-rebuild-optimization' into 11th-hour
2016-04-14 21:56:43 -04:00
Akita Noek
25f0d65c5f
Ancestor rebuild optimization progress
2016-04-14 21:56:10 -04:00
Akita Noek
8887db231b
Progress on ripping out RolePermissions
2016-04-14 09:44:20 -04:00
Akita Noek
1d27ddc7d2
Fix bad migration from #1496
2016-04-12 16:50:54 -04:00
Akita Noek
caab5b7e20
Merge branch 'migration' into explicit-implicit-parents
2016-04-12 16:31:51 -04:00
Akita Noek
ad89491a07
Fixed bad merge
2016-04-12 16:31:11 -04:00
Akita Noek
ea3a7ef227
Merge branch 'devel' of github.com:ansible/ansible-tower into migration
2016-04-12 16:30:09 -04:00
Akita Noek
a0356afbac
Improved code clarity and UI naming for user owner role creation
...
#1499
2016-04-12 16:11:45 -04:00
Akita Noek
c984b33f1e
Fix erronous singleton role created for users
...
Needed to be just a normal role, ie with `name` assigned instead of
`singleton_name`
Addresses #1499
2016-04-12 15:43:27 -04:00
Akita Noek
1369be8f17
Merge branch 'devel' into explicit-implicit-parents
2016-04-12 15:13:37 -04:00
Akita Noek
29c7ecf6a8
Merge branch 'devel' into migration
2016-04-12 15:12:43 -04:00
Akita Noek
8c917de24d
Fix faulty activitystream test
...
Test assumed that the only entry in activitystream would be related to
the creation of the organization, which in this case was not true, the
most recent being something related to the user object being created or
modified.
2016-04-12 15:03:24 -04:00
Akita Noek
6039ad92e9
Merge branch 'devel' of github.com:ansible/ansible-tower into explicit-implicit-parents
2016-04-12 14:51:30 -04:00
Akita Noek
7b4e7ec5b3
Switch to explicitly stored implicit role parents
...
Completes #1496
2016-04-12 14:50:52 -04:00
Akita Noek
7e0bfc9831
Use --nomigrations for py.test
...
This is for two reasons, 1) it's a lot faster when starting from a new
database, and 2) since we do database work within our migrations, it
doesn't actually work within py.test, which is either a bug in
pytest-djano, or a horrible behavior of pytest-django.
2016-04-12 14:32:10 -04:00
Akita Noek
b77d8dab47
flake8 fixes
...
Signed-off-by: Akita Noek <anoek@ansible.com >
2016-04-12 12:04:39 -04:00
Akita Noek
e9aff8d67d
Moved necessary add field migration to exist prior to dependent implicit role field which references the field
2016-04-12 11:40:17 -04:00
Akita Noek
74d86859f1
Fix project migration when project has exactly one org
2016-04-12 11:40:17 -04:00
Akita Noek
5f8e7bbf55
Replace user.admin_role usage with manual version that works in migrations
2016-04-12 11:40:17 -04:00
Akita Noek
86e29221d5
Fixed missing orgfunc usage to resolve organization during credential migration
2016-04-12 11:40:17 -04:00
Akita Noek
59b6ed3b9c
Update rbac schema migrations so we have all parameters we need to operate during a migration
...
We need all those rbac fields definied in the migration in order for the
current apps to have access to them during a migration.
2016-04-12 11:40:17 -04:00
Akita Noek
e3a45235a6
Do an initial save on all resources during amigration to force the creation of RBAC role objects.
2016-04-12 11:40:17 -04:00
Akita Noek
7d2e660749
Make use of 'current' apps so RBAC ImplicitRoleField can work during migrations
...
While a migration is taking place, we can't juse use normal model
references like Role and RolePermission, nor can we use generic foreign
keys without manually referring to the content type and object id
fields.
2016-04-12 11:40:17 -04:00
Akita Noek
682552d9b0
Added field deconstruct method so ImplicitRoleField works in migrations
...
Apparently we need this, who'da known.
https://docs.djangoproject.com/en/1.9/howto/custom-model-fields/
2016-04-12 11:40:17 -04:00
Akita Noek
274744b4c1
Replaced Role.singleton usage in migrations as it doesn't exist here apparently
2016-04-12 11:40:17 -04:00
Akita Noek
ec439126e0
Added created/modified and another content_object fix in our migrations
...
#1380 #1425
2016-04-12 11:40:17 -04:00
Akita Noek
b1c568e4d9
Fix invalid usage of content_object during migrations
...
#1380
#1425
2016-04-12 11:40:17 -04:00
Akita Noek
18dea2203f
Removed unnecessary rebuild_role_ancestor_list call in a test
2016-04-12 09:55:20 -04:00
Akita Noek
ecedf491a4
Removed erroneous sso login error log
...
The log message here does not indicate a login failure at all, in fact
it doesn't appear like we get a login failed message, they just don't
get authed.
2016-04-11 23:17:10 -04:00
Akita Noek
24a841a0bf
Added sso login logging
...
Part of #1087
This is untested as we need to have a public facing machine to do SSO
stuff against.
2016-04-11 17:03:04 -04:00