30623 Commits

Author SHA1 Message Date
Alan Rominger
15effd7ade
Add some conditions for always-send and never-send event types
Always send websocket messages for
  high priority events like playbook_on_stats

Never send websocket messages for
  events with no output
  unless they are a high priority event type
2021-06-08 13:33:53 -04:00
Alan Rominger
b919befc90
Add option to record websocket received time 2021-06-08 13:33:53 -04:00
Jake McDermott
faded278e3
Disable follow mode on scroll 2021-06-08 13:33:53 -04:00
Jake McDermott
768ac01f58
Add basic output tailing
When follow mode is enabled, fix the scroll position to the highest row
so that the output panel is always displaying the latest events.
2021-06-08 13:33:53 -04:00
Alan Rominger
4052603238
make sure log format does not error 2021-06-08 13:33:53 -04:00
Alan Rominger
b306c6f258
Put new setting in defaults so unit tests will run 2021-06-08 13:33:52 -04:00
Alan Rominger
4b6b8f2bdd
Finish up the immediate or average rate method 2021-06-08 13:33:52 -04:00
Alan Rominger
70420dc3e4
THIS DOES NOT WORK pass events if they fit either timing criteria 2021-06-08 13:33:52 -04:00
Alan Rominger
50ca2d47ce
Further log adjustments 2021-06-08 13:33:52 -04:00
Alan Rominger
faa0a6cf9a
fix up log wording 2021-06-08 13:33:52 -04:00
Alan Rominger
01228cea02
Implement max event websocket rate as setting 2021-06-08 13:33:50 -04:00
Alan Rominger
cbb461ab71
Fix bug 2021-06-08 13:33:23 -04:00
Alan Rominger
b551608f16
Move websocket skip logic into event_handler 2021-06-08 13:33:22 -04:00
Marliana Lara
7a25f22078
Remove i18n prop 2021-06-08 13:33:03 -04:00
Alan Rominger
b43d8e2c7f
Enforce a 30-per-second max event websocket rate 2021-06-08 13:32:05 -04:00
softwarefactory-project-zuul[bot]
2ad84b60b3
Merge pull request #10381 from AlanCoding/tox_configish
Enter flake8 rules in tox config as actual config entries

I really like to do things like
flake8 awx/main/models

but this is made impractical where running flake8 for the project carries with it an assumption that you will pass a specific set of options.
https://flake8.pycqa.org/en/latest/user/configuration.html
Blessedly, flake8 is flexible in their config options so that it may weather the storm of python project config wars.

Reviewed-by: Jeff Bradberry <None>
Reviewed-by: Bianca Henderson <beeankha@gmail.com>
2021-06-08 15:49:01 +00:00
Marliana Lara
d1981fcb4a
Extend launched by details to handle scheduled JTs and WFJTs 2021-06-08 11:34:58 -04:00
softwarefactory-project-zuul[bot]
df8ce801cf
Merge pull request #10325 from wenottingham/count-von-count
Add a field for hosts automated across to the subscription info

SUMMARY
This is populated by the new table we've added.
Update the subs check to check against this, not imported hosts.

ISSUE TYPE

Feature Pull Request
Bugfix Pull Request

COMPONENT NAME

API
UI

Reviewed-by: Bill Nottingham <None>
Reviewed-by: Amol Gautam <amol_gautam25@yahoo.co.in>
Reviewed-by: Alex Corey <Alex.swansboro@gmail.com>
Reviewed-by: Chris Meyers <None>
Reviewed-by: Tiago Góes <tiago.goes2009@gmail.com>
2021-06-08 15:30:43 +00:00
nixocio
50e6348bef Do not show not as choice for Advanced Search on Smart Inventory
Do not show `not` as choice for Advanced Search on Smart Inventory since
this feature is not implemented on the API side yet.

See: https://github.com/ansible/awx/issues/2817
2021-06-08 11:17:01 -04:00
Alan Rominger
5ab449c90f
Add event-specific template to all event types 2021-06-08 11:01:14 -04:00
softwarefactory-project-zuul[bot]
66a9ffc376
Merge pull request #10339 from mabashian/8596-websocket-connecting-state
Only attempt to reconnect socket if connection wasn't closed cleanly

SUMMARY
link #8596
After some investigation, I believe that this error is caused by the reconnect logic that we have.  When the component that references the ws hook unmounts, we disconnect the socket.  There's some logic in the onclose method that attempts to reconnect the socket but if we've disconnected cleanly we shouldn't try to reconnect (because we probably meant to disconnect in the first place).
This should clean up the console errors that we've been seeing about the socket already being in a connected state since we won't have timers running past the lifecycle of the component.
cc @keithjgrant does this sound good to you?
Here's the spec for the disconnect event https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent#properties
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

UI

Reviewed-by: Keith Grant <keithjgrant@gmail.com>
Reviewed-by: Tiago Góes <tiago.goes2009@gmail.com>
2021-06-08 14:36:41 +00:00
Alex Corey
16c6e2d716 uses pf date and time picker to schedule form 2021-06-08 10:32:38 -04:00
softwarefactory-project-zuul[bot]
ac5b53b13c
Merge pull request #10334 from mabashian/outdated-revision
Adds ability to refresh project revision on sync'd rows in the project list

SUMMARY
This PR also adds the revision to the project details view as well as handles updating the revision on the project details view when the project is done syncing.
Since the project revision is not included in the websocket payload, when a project is done syncing the displayed revision may be out of date.  As such, we wanted to expose that information to the user and give them the ability to "refresh" and fetch the new revision.
Here's what that flow looks like:

When a particular row finishes syncing the user should see this in place of the revision:

Clicking on that refresh button goes out and fetches the updated project (and with it the potentially updated revision).
We don't do this automatically on the projects list (and force the user to click on the refresh button) is due to issues we've had in the past with the UI triggering API calls based on websocket events.
The flow when a user is on the project details view is a little different because I wasn't as worried about spamming the API with requests.
When a project finishes syncing and the user is viewing the details I do go ahead and automatically refresh the project data (and with it, the revision).  Here's what that looks like:

A few other notes:

@tiagodread @akus062381 @one-t I'm almost certain this is going to break some tests because I removed the ClipboardCopyButton in favor of PF's ClipboardCopy component.  This component looks and behaves slightly differently from our home grown solution.  Additionally, the PF ClipboardCopy button does not expose the ouiaId prop so I had to add a data-cy on that component.  You'll likely have to use that identifier to then grab the button inside in order to test out the clipboard copy functionality.
Source Control Revision is a net-new detail in the project details.  I think this was simply missed on our initial build of this page.

Here are the identifiers on the various bits:



Note that the identifiers on the project rows have the id of the project appended to them for uniqueness.
ISSUE TYPE

Feature Pull Request

COMPONENT NAME

UI

Reviewed-by: Jake McDermott <yo@jakemcdermott.me>
Reviewed-by: Michael Abashian <None>
Reviewed-by: Sarah Akus <sarah.akus@gmail.com>
2021-06-08 14:14:54 +00:00
softwarefactory-project-zuul[bot]
6d433cc42a
Merge pull request #10379 from jakemcdermott/fix-logout-reload2
Avoid reload on manual logout

SUMMARY
#10383
Instead of reloading, set the authRedirectTo context variable to "/logout" and handle it as a special case when routing

Reviewed-by: Marliana Lara <marliana.lara@gmail.com>
2021-06-08 13:58:14 +00:00
softwarefactory-project-zuul[bot]
7c442f3f50
Merge pull request #10359 from AlanCoding/stop_setting_venv
Remove uses of ansible_virtualenv_path

Run a job with recent AWX, then inspect:
In [2]: Job.objects.order_by('-created').first().custom_virtualenv
Out[2]: '/var/lib/awx/venv/ansible'

We shouldn't do this. The job was ran after the custom_virtualenv field has become entirely informative / non-functional. It is very arguable whether jobs should keep this field. For pre-migration jobs, it is an accurate record of fact, so I'm not going out of my way to argue for removal.
With this change, new jobs will record a blank value for custom_virtualenv, which is more correct, because we don't do this.
I have carefully looked over @rebeccahhh's #10090, and I don't see any way that ansible_virtualenv_path is used. Model use is reported for templates, so that doesn't block removing the field on jobs either.

Reviewed-by: Alan Rominger <arominge@redhat.com>
Reviewed-by: Rebeccah Hunter <rhunter@redhat.com>
Reviewed-by: Bill Nottingham <None>
Reviewed-by: Shane McDonald <me@shanemcd.com>
2021-06-08 12:26:38 +00:00
Alan Rominger
d79f73ab7a
Remove references to Ansible venv path because it does not exist 2021-06-07 21:14:35 -04:00
Alan Rominger
b26eaa3bd2
Remove uses of ansible_virtualenv_path 2021-06-07 21:14:35 -04:00
mabashian
de46fb409e Adds version context processor back in to fix api browser doc link 2021-06-07 19:52:01 -04:00
Keith J. Grant
8078daa733 convert InstanceList to table 2021-06-07 15:06:12 -07:00
softwarefactory-project-zuul[bot]
e4931bde6c
Merge pull request #10346 from jakemcdermott/fix-9905
Disable cancel button on http 405

SUMMARY
for #9905
When a 405 is received, it means the job is already cancelled. Treat the
request as a success and don't show an error modal.
We disable the button to handle a rare scenario where we receive the 405 long before
the job status is properly updated to "cancelled" over websockets. We want to prevent
more cancel requests when this happens. We're disabling instead of hiding the button
because, assuming the status hasn't changed over sockets, the buttons that usually
replace the cancel button on the toolbar won't be shown yet and we don't want to
needlessly flicker and shift button positions around by rapidly loading and unloading
a different number of buttons onto the bar.

Reviewed-by: Keith Grant <keithjgrant@gmail.com>
Reviewed-by: Sarah Akus <sarah.akus@gmail.com>
2021-06-07 21:25:05 +00:00
Elijah DeLee
e2b0a4f7a7 Make changed result accurate for credentials 2021-06-07 17:16:14 -04:00
Jake McDermott
5da6b02801
Avoid reload on manual logout 2021-06-07 16:51:06 -04:00
Elijah DeLee
326184da0f fixup changed behavior for EEso its accurate 2021-06-07 16:50:53 -04:00
Alan Rominger
dad5533816
Enter flake8 rules in tox config as actual config entries 2021-06-07 16:21:50 -04:00
Bill Nottingham
ca07946c24 Adjust subscription calculation & warning behavior
- Add a field for hosts automated across

  This is populated by the new table we've added.
- Update the subs check to check against this, not imported hosts.
- Reword messages on inventory import
2021-06-07 15:47:55 -04:00
Elijah DeLee
2ce276455a Break out control plane EE as its own thing 2021-06-07 15:39:20 -04:00
mabashian
4db6b8c1fe Rolls back aggressive find/replace on fetchProjects 2021-06-07 14:21:34 -04:00
mabashian
03209fe2f2 Updates onCopy functions to use navigator.clipboard instead of deprecated execCommand 2021-06-07 14:18:27 -04:00
softwarefactory-project-zuul[bot]
7832639c25
Merge pull request #10361 from nixocio/ui_issue_10355
Update message for missing EE for Job pages

Update message for missing EE for Job pages
See: #10355

Reviewed-by: Keith Grant <keithjgrant@gmail.com>
Reviewed-by: Kersom <None>
Reviewed-by: Michael Abashian <None>
2021-06-07 18:18:15 +00:00
mabashian
121db42699 Fix data-cy 2021-06-07 13:33:08 -04:00
mabashian
ddb6c775b1 Adds dataCy to revision copy in project details 2021-06-07 13:33:07 -04:00
mabashian
7467779ea9 Remove clipboard copy button component 2021-06-07 13:33:07 -04:00
mabashian
66f140bb70 Adds ability to get latest revision from project list when a project is done syncing. Automatically refresh project data on project detail when it's done syncing. 2021-06-07 13:33:06 -04:00
mabashian
151f9e79ed Move debug message inside if statement so that it only triggers when we try to reconnect 2021-06-07 13:30:19 -04:00
mabashian
f83343592b Only attempt to reconnect socket if connection wasn't closed cleanly 2021-06-07 13:29:14 -04:00
mabashian
12504c9bc3 Changes settings revert all to send DELETE on individual endpoint rather than PATCHing 2021-06-07 13:19:16 -04:00
Shane McDonald
023cc68ba2
Surface default instance group names in /api/v2/settings/all 2021-06-07 12:22:58 -04:00
Shane McDonald
ec8ac6f1a7
Introduce distinct controlplane instance group 2021-06-07 11:25:59 -04:00
Yanis Guenane
82c4f6bb88
Define a DEFAULT_QUEUE_NAME 2021-06-07 11:25:23 -04:00
Alan Rominger
5beb68f527
Remove templates from views that were removed 2021-06-07 11:15:19 -04:00