29638 Commits

Author SHA1 Message Date
softwarefactory-project-zuul[bot]
7eaf1db3e0
Merge pull request #10206 from tchellomello/update_ee_via_operator
Commits settings.DEFAULT_EXECUTION_ENVIRONMENTS updates into the database

SUMMARY
Fixes: ansible/awx-operator#256
cc: @shanemcd
Cannot update execution environment version in place by updating the AWX spec via awx-operator.  For example, consider the scenario below:
spec:
  tower_ee_images:
    - image: registry.tatu.home/ansible/awx-ee:0.1.0
      name: My Custom Execution Environment

The expectation would be once you modify the AWX spec to the version below, the EE should reflect this change once the awx-operator finishes its reconciliation.
After:
spec:
  tower_ee_images:
    - image: registry.tatu.home/ansible/awx-ee:0.2.0
      name: My Custom Execution Environment

-- deployment got updated
- args:
        - receptor
        - --config
        - /etc/receptor.conf
        image: registry.tatu.home/ansible/awx-ee:0.2.0
        imagePullPolicy: IfNotPresent
        name: awx-devel-ee-ee
Besides the awx-operator updated the YAML deployment as expected, the change did not hit the database.
awx=# select * from main_executionenvironment;
 id |    created    |   modified    | description |     image      | managed_by_tower | created_by_id | credential_id | modified_by_id | organization_id |      name      | pull 
----+---------------+---------------+-------------+----------------+------------------+---------------+---------------+----------------+-----------------+----------------+------
  1 | 2021-05-11 15.| 2021-05-11 15.|             | registry.tatu..| t                |             1 |               |              1 |                 | My Custom Exec.| 
    |.:24:02.674302.|.:24:02.674327.|             |.home/ansible/a.|                  |               |               |                |                 |.ution Environm.| 
    |.+00           |.+00           |             |.wx-ee:0.1.0    |                  |               |               |                |                 |.ent            | 
(1 row)
ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME


API

AWX VERSION

devel

ADDITIONAL INFORMATION


Quick proof of concept
>>> settings.DEFAULT_EXECUTION_ENVIRONMENTS
[{'name': 'My Custom Execution Environment', 'image': 'registry.tatu.home/ansible/awx-ee:0.2.0'}]
>>> [a.name for a in  ExecutionEnvironment.objects.all()]
['My Custom Execution Environment']
>>> [a.image for a in  ExecutionEnvironment.objects.all()]
['registry.tatu.home/ansible/awx-ee:0.2.0']

*** updating to new but keeping name 
>>> _, created = ExecutionEnvironment.objects.update_or_create(name='My Custom Execution Environment', defaults={'image': 'registry.tatu.home/ansible/awx-ee:0.3.0', 'managed_by_tower': True})
>>> [a.name for a in  ExecutionEnvironment.objects.all()]
['My Custom Execution Environment']
>>> [a.image for a in  ExecutionEnvironment.objects.all()]
['registry.tatu.home/ansible/awx-ee:0.3.0']

*** adding a new name
>>> _, created = ExecutionEnvironment.objects.update_or_create(name='My Custom Execution Environment2', defaults={'image': 'registry.tatu.home/ansible/awx-ee:0.3.0', 'managed_by_tower': True})
>>> [a.name for a in  ExecutionEnvironment.objects.all()]
['My Custom Execution Environment2', 'My Custom Execution Environment']
>>> [a.image for a in  ExecutionEnvironment.objects.all()]
['registry.tatu.home/ansible/awx-ee:0.3.0', 'registry.tatu.home/ansible/awx-ee:0.3.0']

Reviewed-by: Christian Adams <rooftopcellist@gmail.com>
Reviewed-by: Shane McDonald <me@shanemcd.com>
2021-05-18 18:36:07 +00:00
softwarefactory-project-zuul[bot]
1b1608cff9
Merge pull request #10221 from jbradberry/check-for-pre-commit-script
Add a check for the existence of pre-commit.sh

SUMMARY
so that you don't get stuck when working on branches that don't have this yet.
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

API

AWX VERSION

Reviewed-by: Christian Adams <rooftopcellist@gmail.com>
2021-05-18 18:33:54 +00:00
Jeff Bradberry
c887f84a05 Add a check for the existence of pre-commit.sh
so that you don't get stuck when working on branches that don't have this yet.
2021-05-18 13:20:55 -04:00
softwarefactory-project-zuul[bot]
fb7c827bff
Merge pull request #10068 from wenottingham/fail-early-fail-often
Have the project update playbook warn if role/collection syncing is disabled

In recent AWX, a galaxy credential (even a blank one for galaxy.ansible.com) is required to sync role/collection content. This is done so that server precedence can be properly set, and so that it can be configured to pull only from a private content host.
This does lead to bug reports where the credentials are not set, and users don't understand why their content is not syncing. This makes that more clear.

Reviewed-by: Alan Rominger <arominge@redhat.com>
2021-05-18 15:29:21 +00:00
softwarefactory-project-zuul[bot]
df3bd2e082
Merge pull request #10133 from mabashian/ui-next-pendo
Adds support for pendo initialization across the app

SUMMARY
We were already bootstrapping pendo as part of the subscription code I just moved that code to a more general place.  When the app container mounts (after login or on refresh) we check to see if the pendo flag is turned on.  If it is, we initialize pendo.  If it's not then we do nothing.  If a user goes into settings and manually changes the pendo tracking setting then we trigger a hard reload of the browser tab (to take the new setting into account and either initialize or not).  This functionality existed in the old UI as well.
ISSUE TYPE

Feature Pull Request

COMPONENT NAME

UI

Reviewed-by: Michael Abashian <None>
Reviewed-by: Kersom <None>
Reviewed-by: Tiago Góes <tiago.goes2009@gmail.com>
2021-05-18 14:51:07 +00:00
softwarefactory-project-zuul[bot]
3d80eb30b3
Merge pull request #10209 from beeankha/fix_integration_tests
Fix failing integration test playbooks

SUMMARY

Addressing issue #10104

ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME


Collections

Reviewed-by: Seth Foster <None>
Reviewed-by: Alan Rominger <arominge@redhat.com>
2021-05-18 14:13:25 +00:00
softwarefactory-project-zuul[bot]
5ad48bda6c
Merge pull request #10203 from jakemcdermott/add-default-error-boundary
Add default error boundary around screens

SUMMARY
Catch any unhandled non-async errors with an error boundary around screens. This will show a generic error message instead
of crashing the page.
The react docs decently summarize the general concept of error boundaries. The example code is informative, but there appears to be a few more edge cases that need to be dealt with. Rather than re-implement solutions for those, I decided to pull in a simple and well-tested library.
ADDITIONAL INFORMATION
before

after

Reviewed-by: Keith Grant <keithjgrant@gmail.com>
Reviewed-by: Kersom <None>
Reviewed-by: Tiago Góes <tiago.goes2009@gmail.com>
2021-05-18 00:30:29 +00:00
softwarefactory-project-zuul[bot]
fd60105db3
Merge pull request #10005 from AlanCoding/force_on_override
Update with force option if branch_override

Addresses a reported issue where force-pushing to feature branches did not work.
Connect #9371 (comment)

Reviewed-by: Bill Nottingham <None>
2021-05-17 23:58:31 +00:00
beeankha
82807a1b20 Update ad hoc command cancel test 2021-05-17 16:46:01 -04:00
softwarefactory-project-zuul[bot]
61ae80819f
Merge pull request #10212 from sarabrajsingh/bugfix/create-seperator-worker-thread-for-transmit-jobs-9952
created a TransmitterThread class to start transmit jobs within. Surr…

SUMMARY

Surfaced this bug while fixing issue #9952.
Receptor-ctl would hang trying to read from a socket pair that is never closed, when the transmit job was executed yet threw an exception. This anomaly occurred when using a k8s cluster (Openshift in our case) as the execution environment.
FYI - for now, this only applies to container groups.
We moved the transmit function to execute in its own thread, and rejoin the calling function (_run_internal) when it finishes transmitting, and bubbling up exceptions if any occurred in the thread.

ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME


API

AWX VERSION

awx: 19.1.0

ADDITIONAL INFORMATION

Steps to reproduce bug:

Create an ansible project with some files (or roles) and commit to a git repository
Purposely commit a broken symlink on any file in the project files to git
Create a credential set that authenticates to your k8s cluster in AWX
Create a container instance group that leverages the credentials from Step 3 in AWX
Create a project in AWX that leverages the ansible project/git repo from Step 1
Create a job template that leverages the AWX project from Step 4 and set your EE to the container instance group from Step 3
Execute the job from Step 5

Reviewed-by: Shane McDonald <me@shanemcd.com>
2021-05-17 20:16:12 +00:00
beeankha
62a9c74040 Fix failing integration test playbooks 2021-05-17 15:56:39 -04:00
softwarefactory-project-zuul[bot]
0e74f51aa3
Merge pull request #10134 from AlexSCorey/10132-RelatedGroupsCnverttoTables
converts inventory groups related groups and related hosts to tables

SUMMARY
This addresses #10132
ISSUE TYPE

Feature Pull Request

COMPONENT NAME

UI

ADDITIONAL INFORMATION

Reviewed-by: Jake McDermott <yo@jakemcdermott.me>
2021-05-17 19:07:57 +00:00
softwarefactory-project-zuul[bot]
966eead93f
Merge pull request #10121 from saito-hideki/issue/10104
Remove source_script from tower_inventory_source integration test

SUMMARY
source_script parameter is on longer available in the current version AWX API(#9822), so we need to remove it from the integration test of tower_inventory_source module

Fixes #10104

ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

awx_collections

AWX VERSION
devel

  
    
    

    
    

  


ADDITIONAL INFORMATION
None

Reviewed-by: Alan Rominger <arominge@redhat.com>
Reviewed-by: Hideki Saito <saito@fgrep.org>
Reviewed-by: Bianca Henderson <beeankha@gmail.com>
2021-05-17 18:46:24 +00:00
Sarabraj Singh
12cea1191e created a TransmitterThread class to start transmit jobs within. Surrounded ansible_runner.interface.run() in a try/except block to prevent the call from hanging on a socket pair that doesn't close 2021-05-17 14:35:13 -04:00
Alan Rominger
5dac46cd7d
Update with force option if branch_override 2021-05-17 11:57:46 -04:00
softwarefactory-project-zuul[bot]
2c2aaa7fea
Merge pull request #10182 from jakemcdermott/standardize-dependency-updates
Use development container when updating dependencies

GOAL
When adding, updating, or removing a package, the resultant changeset to the package.json and package-lock.json files that we check into devel should be consistent and reproducible, regardless of who is doing the update or what machine they're doing the update on.
SUMMARY OF CHANGES

Even though we usually run the ui development tooling outside of the awx development container, we should standardize on using this environment to update packages to ensure some consistency.
Use npm ci instead of npm install as the default package installation command, since we generally want to modify package files only when updating deps
You can run into memory limits from docker or node when building in the container, so increase the node memory limit and add a note to the docs that you may need to increase the container memory limit in your docker-for-mac settings (or similar tool, if you use it)

Reviewed-by: Kersom <None>
Reviewed-by: Keith Grant <keithjgrant@gmail.com>
Reviewed-by: Tiago Góes <tiago.goes2009@gmail.com>
2021-05-17 15:22:16 +00:00
Marcelo Moreira de Mello
997525076d update_or_create EE via settings.DEFAULT_EXECUTION_ENVIRONMENTS 2021-05-17 00:41:06 -04:00
softwarefactory-project-zuul[bot]
3b280e1b32
Merge pull request #10205 from jbradberry/favicon-fix
Add an nginx location directive for the favicon

SUMMARY
Add an nginx location directive for the favicon so that the rewrite rule that adds slashes to the ends of requested
urls doesn't get to it.
related #8618
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

API
UI

AWX VERSION

Reviewed-by: Rebeccah Hunter <rhunter@redhat.com>
Reviewed-by: Christian Adams <rooftopcellist@gmail.com>
2021-05-14 19:25:35 +00:00
softwarefactory-project-zuul[bot]
a8b6db3967
Merge pull request #10179 from nixocio/ui_issue_9126_2
Update login message to avoid duplicate brand name

Returned brandName already contain the name brand Ansible. Update to
avoid name brand repetition.
Also update brandName on document title.
See: #9126

Reviewed-by: Kersom <None>
Reviewed-by: Alex Corey <Alex.swansboro@gmail.com>
Reviewed-by: Jake McDermott <yo@jakemcdermott.me>
Reviewed-by: Keith Grant <keithjgrant@gmail.com>
Reviewed-by: Tiago Góes <tiago.goes2009@gmail.com>
2021-05-14 19:04:36 +00:00
Jeff Bradberry
bcf93810ad Add an nginx location directive for the favicon
so that the rewrite rule that adds slashes to the ends of requested
urls doesn't get to it.
2021-05-14 14:00:57 -04:00
Hideki Saito
0cb33bd278 Remove source_script from tower_inventory_source integration test
* Fixes #10104

Signed-off-by: Hideki Saito <saito@fgrep.org>
2021-05-15 00:18:37 +09:00
Jake McDermott
8c2ca29f4e
Add default error boundary around screens
Catch any unhandled non-async errors with an error boundary
around screens. This will show a generic error message instead
of crashing the page.
2021-05-14 10:40:48 -04:00
softwarefactory-project-zuul[bot]
f1767d05b0
Merge pull request #10202 from tiagodread/3420-fix
Use non-root path links

Resolves ansible/tower#3420
Use non-root path for links

Reviewed-by: Jake McDermott <yo@jakemcdermott.me>
2021-05-14 13:44:45 +00:00
softwarefactory-project-zuul[bot]
b1cd7eb997
Merge pull request #9988 from mabashian/9163-admin-approvals-page
Fixes bug where workflow approvals page would crash if deleted username was referenced

SUMMARY
link #9163
The tooltip on the status labels for completed workflow approvals attempts to show the username of the user that acted on it.  If that user has been deleted then the key is not present in the object.  This would cause the page to crash.
To fix this, I conditionally show a different string when the username is not available.  If a user wants to see which deleted user acted on the approval they'll have to go to the activity stream.

ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

UI

Reviewed-by: Alex Corey <Alex.swansboro@gmail.com>
Reviewed-by: Mat Wilson <mawilson@redhat.com>
2021-05-14 13:17:37 +00:00
Tiago
0f8533f123 use non-root path 2021-05-14 10:00:18 -03:00
softwarefactory-project-zuul[bot]
2191ab1c6c
Merge pull request #10148 from keithjgrant/8907-launch-prompt-vars-validation
Add Variables field validation in launch prompt

SUMMARY

Adds validation for the Variables field during launch prompts.
Prevents unexpected expanding of YAML expressions in the default value (similar to #7506) — this was caused by the default value being parsed into a JavaScript object and then re-translated back to YAML when mounting the "Other Prompts" step

addresses #8907
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

UI

Reviewed-by: Jake McDermott <yo@jakemcdermott.me>
Reviewed-by: Tiago Góes <tiago.goes2009@gmail.com>
2021-05-13 21:01:09 +00:00
mabashian
9975d4764d Extract strings 2021-05-13 16:38:41 -04:00
mabashian
31907423ce Fixes bug where workflow approvals page would crash if deleted username was referenced 2021-05-13 16:37:04 -04:00
softwarefactory-project-zuul[bot]
09801d0a9a
Merge pull request #10159 from AlanCoding/inventory_ig
Add instance_group to inventory update serializer

SUMMARY
Inventory updates run remotely, in the execution plane. This adds the instance_group field to the inventory update serializer to help clarify this reality.
ISSUE TYPE

Feature Pull Request

COMPONENT NAME

API

Reviewed-by: Rebeccah Hunter <rhunter@redhat.com>
Reviewed-by: Shane McDonald <me@shanemcd.com>
2021-05-13 17:50:45 +00:00
softwarefactory-project-zuul[bot]
a332f46f31
Merge pull request #10171 from jakemcdermott/remove-job-isolated-settings
Remove all AWX_ISOLATED* fields

I believe this should address #10123. The issue mentions a worker-json.js 404 and, while we should fix that at some point, I don't think it's actually related to the save not working.
SUMMARY
I noticed the job settings form wasn't saving on devel.
After some debugging, I found that removing the AWX_ISOLATED_CHECK_INTERVAL and AWX_ISOLATED_LAUNCH_TIMEOUT made the form saveable again.
It doesn't seem like we use any of the AWX_ISOLATED* fields anymore (not to be confused with AWX_ISOLATION* fields, which we do use) so this PR removes them all.
cc @wenottingham @shanemcd @marshmalien  @gamuniz @tiagodread @jbradberry

Reviewed-by: Jeff Bradberry <None>
Reviewed-by: Bill Nottingham <None>
Reviewed-by: Tiago Góes <tiago.goes2009@gmail.com>
2021-05-13 17:32:15 +00:00
Jake McDermott
6f6d9e2f15
Update dependency update examples
There's no need to make a production build when updating dependencies,
just reiinstall
2021-05-13 13:09:30 -04:00
Jake McDermott
cd7c85490b
Handle and document potential memory limit issues
* Increase node memory limit
* Add note to docs that you may need to increase container memory thresholds
imposed by docker-for-mac and similar tools if you're using them
2021-05-13 12:55:37 -04:00
Jake McDermott
a9ec7038de
Use npm ci as default package installation command
We don't want to generate new package.json and package-lock.json
files unless we're explicitly updating new dependencies.
2021-05-13 12:55:28 -04:00
Jake McDermott
795e3c84fc
Use development container when updating dependencies 2021-05-13 12:55:22 -04:00
softwarefactory-project-zuul[bot]
f2b2e64426
Merge pull request #10190 from jbradberry/fix-precommit-for-macs
Remove the shebang line from pre-commit.sh

SUMMARY

since bash isn't available by default on OS X.

ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME


API

AWX VERSION



  
    
    

    
    

  


ADDITIONAL INFORMATION

Reviewed-by: Kersom <None>
Reviewed-by: Rebeccah Hunter <rhunter@redhat.com>
2021-05-13 15:24:24 +00:00
Jeff Bradberry
d07887bd91 Remove the shebang line from pre-commit.sh
since bash isn't available by default on OS X.
2021-05-13 10:49:24 -04:00
softwarefactory-project-zuul[bot]
bb47bdbc43
Merge pull request #10185 from jakemcdermott/fix-10170
Drop the word 'name' from image field, add examples

for #10170
We call this field "Image" in other places, so we want it to match. Also, "Image name" can be confusing because people may think they just need to provide the image name instead of the full image location, which includes registry and tag version.
cc @gamuniz @nixocio @beeankha @tiagodread

Reviewed-by: Kersom <None>
Reviewed-by: Bianca Henderson <beeankha@gmail.com>
Reviewed-by: Julen Landa Alustiza <None>
2021-05-13 14:44:38 +00:00
softwarefactory-project-zuul[bot]
d477f04d75
Merge pull request #10175 from AlanCoding/only_have_eyes_for_you
Add more fields to .only since they get referenced

SUMMARY
Fixes a performance bottleneck when saving playbook_on_stats for jobs that use --limit against a small number of hosts while it has a large number in the inventory.
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

API

ADDITIONAL INFORMATION
'tis the problem with .only(), that only the developer who wrote the queryset remembers that the other fields cannot be referenced except at the cost of another query
https://github.com/ansible/awx/pull/7352/files

Reviewed-by: Chris Meyers <None>
Reviewed-by: Alan Rominger <arominge@redhat.com>
2021-05-13 14:44:33 +00:00
Alan Rominger
e5f059806b
Add instance_group to inventory update serializer 2021-05-13 09:00:43 -04:00
softwarefactory-project-zuul[bot]
117bb07f0d
Merge pull request #10187 from jakemcdermott/warn-and-recompile-lint
Warn but still recompile on lint error

Reviewed-by: Alex Corey <Alex.swansboro@gmail.com>
Reviewed-by: Keith Grant <keithjgrant@gmail.com>
2021-05-12 21:32:55 +00:00
softwarefactory-project-zuul[bot]
01fdc482be
Merge pull request #10169 from jakemcdermott/fix-10127
Always resolve launching status

SUMMARY
Resolves #10127
Always resolve the launching status after any intermediate async activity that needs to occur while loading prompts, etc.

Reviewed-by: Kersom <None>
Reviewed-by: Tiago Góes <tiago.goes2009@gmail.com>
2021-05-12 21:31:35 +00:00
softwarefactory-project-zuul[bot]
875abcd31a
Merge pull request #10161 from nixocio/ui_issue_10144
Display error for boolean fields

Display error when modifying Allow Override Branch on Projects.
See: #10144

Reviewed-by: Keith Grant <keithjgrant@gmail.com>
Reviewed-by: Kersom <None>
2021-05-12 21:30:09 +00:00
Jake McDermott
3468153619
Warn but still recompile on lint error 2021-05-12 16:47:49 -04:00
softwarefactory-project-zuul[bot]
27b1d15a7a
Merge pull request #10063 from nixocio/ui_issue_7777_style
Add slider to adjust capacity_adjustment

Add slider to adjust capacity adjustment.
Also add a new custom hook, useDebounce.

See: #7777

Reviewed-by: Kersom <None>
Reviewed-by: Alex Corey <Alex.swansboro@gmail.com>
Reviewed-by: Keith Grant <keithjgrant@gmail.com>
Reviewed-by: Tiago Góes <tiago.goes2009@gmail.com>
2021-05-12 20:17:28 +00:00
Jake McDermott
39ce0ade6d
Update image descriptions, add examples 2021-05-12 16:10:42 -04:00
nixocio
dfb0710d69 Add slider to adjust capacity_adjustment
Add slider to adjust capacity adjustment.

Also add a new custom hook, useDebounce.

See: https://github.com/ansible/awx/issues/7777
2021-05-12 15:42:31 -04:00
nixocio
f6c9621510 Display error for boolean fields
Display error when modifying Allow Override Branch on Projects.

See: https://github.com/ansible/awx/issues/10144
2021-05-12 14:49:16 -04:00
softwarefactory-project-zuul[bot]
7f90a8b2b3
Merge pull request #10183 from beeankha/null_ee_show_error
Show Error if No Execution Environment is Found on Project Sync or Job Run

SUMMARY

Duplicate of PR #10147 fixing issue #10118

Reviewed-by: Jeff Bradberry <None>
Reviewed-by: Shane McDonald <me@shanemcd.com>
2021-05-12 18:47:50 +00:00
mabashian
0d17dfcd87 Pass config request through to subscription edit 2021-05-12 14:47:07 -04:00
mabashian
91134b2537 Remove erroneouos extra param 2021-05-12 14:47:06 -04:00