Renders Command Module in job detail view and improves Ad Hoc Commands execution permissions
SUMMARY
This closes#10440 and #8660.
On the job details view we now render the command module name, and the arguments. We also remove the run command button for user that do not have permission to launch a ad hoc command.
ISSUE TYPE
-enhancement
COMPONENT NAME
UI
AWX VERSION
ADDITIONAL INFORMATION
Reviewed-by: Kersom <None>
Reviewed-by: Sarah Akus <sakus@redhat.com>
Adds Ad Hoc Preview step and adds workflow similar to prompt on launch
SUMMARY
This closes#9399 it also introduce the same workflow that prompt on launch uses in the Ad Hoc Commands, where the user to go between steps as they wish.
ISSUE TYPE
Feature Pull Request
COMPONENT NAME
UI
AWX VERSION
ADDITIONAL INFORMATION
Reviewed-by: Kersom <None>
Reviewed-by: Jake McDermott <yo@jakemcdermott.me>
Reviewed-by: Sarah Akus <sakus@redhat.com>
Fix inaccurate translation
SUMMARY
Fix some inaccurate translation in zh meesage.po
ISSUE TYPE
Bugfix Pull Request
COMPONENT NAME
UI
AWX VERSION
devel branch
ADDITIONAL INFORMATION
Reviewed-by: Christian Adams <rooftopcellist@gmail.com>
Reviewed-by: weidong <None>
Properly compile translated API strings
SUMMARY
Fixes: #10681
Now when make ui-devel is run, it will compile the API translated strings and display them to the client browser.
[chadams@chadams-work awx]$ make ui-devel
make[1]: Entering directory '/home/chadams/awx'
python3.8 tools/scripts/compilemessages.py
processing file django.po in /home/chadams/awx/awx/locale/fr/LC_MESSAGES
processing file django.po in /home/chadams/awx/awx/locale/zh/LC_MESSAGES
processing file django.po in /home/chadams/awx/awx/locale/en-us/LC_MESSAGES
processing file django.po in /home/chadams/awx/awx/locale/ja/LC_MESSAGES
processing file django.po in /home/chadams/awx/awx/locale/es/LC_MESSAGES
processing file django.po in /home/chadams/awx/awx/locale/nl/LC_MESSAGES
npm --prefix awx/ui_next --loglevel warn run compile-strings
...
ISSUE TYPE
Bugfix Pull Request
Reviewed-by: Jake McDermott <yo@jakemcdermott.me>
Reviewed-by: Christian Adams <rooftopcellist@gmail.com>
Fix relative imports in src code, relocate src
(Lots of files modified but the changes are low-risk and automated)
This PR is a follow-up to #6954, specifically the part where we removed webpack aliases to pick up react-scripts.
SUMMARY
Add the jsconfig.json w/ baseUrl to enable absolute imports from src. Replaces all the ../../../../../ importing
jsx -> js extension renaming
hooks directory
[ ] ui_next -> ui see: #10676
For posterity, the script used to fix the relative imports is included in the commit history.
python3 tools/fixrelative.py awx/ui_next/src
npm --prefix=awx/ui_next run lint -- --fix
npm --prefix=awx/ui_next run prettier
import argparse
import glob
import os
from shutil import move, copymode
from tempfile import mkstemp
def get_new_import_string(old_import_str, root):
if not root.startswith("./"):
raise Exception("root must start with './'")
name = root.replace("./", "")
left, right = old_import_str.split("from")
left += "from '"
_, trailing = right.split(name)
return left + name + trailing
roots = [
"./api",
"./components",
# "./constants",
"./contexts",
"./screens",
"./types",
"./util",
]
def get_root(line):
matched_root = None
for root in roots:
if root in line:
matched_root = root
break
if "jest" in line:
matched_root = None
return matched_root
def find_and_replace_roots(file_path, root_dir, preview):
fh, temp_path = mkstemp()
has_logged_file_name = False
with os.fdopen(fh, "w") as new_file:
with open(file_path) as old_file:
for (line_number, line) in enumerate(old_file):
matched_root = get_root(line)
if matched_root:
new_line = get_new_import_string(line, matched_root)
if not preview:
new_file.write(new_line)
if not has_logged_file_name:
log_file_replacement(root_dir, file_path)
has_logged_file_name = True
log_line_replacement(line_number, line, new_line)
elif not preview:
new_file.write(line)
if not preview:
copymode(file_path, temp_path)
os.remove(file_path)
move(temp_path, file_path)
def log_line_replacement(line_number, line, new_line):
display_line = line.replace(os.linesep, "")
display_new_line = new_line.replace(os.linesep, "")
print(f"\t (line {line_number}): {display_line} --> {display_new_line}")
def log_file_replacement(root_dir, file_path):
display_path = os.path.relpath(file_path, root_dir)
print("")
print(f"{display_path}:")
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument("root_dir", help="Root directory")
parser.add_argument("--preview", help="Preview (no write)", action="store_true")
args = parser.parse_args()
return args
def run():
args = parse_args()
search_path = args.root_dir + "**/**/*.js*"
for file_path in glob.iglob(search_path, recursive=True):
find_and_replace_roots(file_path, args.root_dir, args.preview)
if __name__ == "__main__":
run()
Reviewed-by: Kersom <None>
Reviewed-by: Tiago Góes <tiago.goes2009@gmail.com>
Fix conditional to check that minikube should start
SUMMARY
make docker-compose tries to start container group without this fix
ISSUE TYPE
Bugfix Pull Request
COMPONENT NAME
API
AWX VERSION
awx: 19.2.2
Reviewed-by: Jake McDermott <yo@jakemcdermott.me>
Reviewed-by: Alan Rominger <arominge@redhat.com>
Update User screens
Add modified field to user endpoints. The API returns the last login
date as the modified field to the users.
Modify user form layout to be as per mockups.
Remove last name and first name from user row, since it is
already on the column title.
closes: #5687closes: #9564
Reviewed-by: Alex Corey <Alex.swansboro@gmail.com>
Reviewed-by: Jake McDermott <yo@jakemcdermott.me>
Reviewed-by: Sarah Akus <sakus@redhat.com>
* Add `modified` field to user endpoints. The API returns the last login
date as the `modified` field to the users.
* Add modified to user details.
* Modify user form layout to be as per mockups.
* Remove `last name` and `first name` from user row, since it is
already on the column title.
closes: https://github.com/ansible/awx/issues/5687
closes: https://github.com/ansible/awx/issues/9564
Adds functionality for expand all
SUMMARY
Closes#4208. Adds basically the same work as useSelected, in a useExpanded hook.
ISSUE TYPE
Feature Pull Request
COMPONENT NAME
UI
AWX VERSION
ADDITIONAL INFORMATION
Reviewed-by: Keith Grant <keithjgrant@gmail.com>
Reviewed-by: Sarah Akus <sakus@redhat.com>
Add edit icon to SurveyListItem
Add edit icon to SurveyListItem
closes: #10095
Reviewed-by: Alex Corey <Alex.swansboro@gmail.com>
Reviewed-by: Sarah Akus <sakus@redhat.com>
Update login redirect to a be text input field
Update login redirect to a be text input field. Allowing values like
/sso/login/saml/?idp=SSO
closes: #10612
Reviewed-by: Jake McDermott <yo@jakemcdermott.me>
Reviewed-by: Sarah Akus <sakus@redhat.com>
Fix close button alert modal
Fix close button alert modal
closes: #10620
Reviewed-by: Keith Grant <keithjgrant@gmail.com>
Reviewed-by: Sarah Akus <sakus@redhat.com>
Disable remove button if row is being dragged
Disable remove button if row is being dragged.
Also, disable drag button there is just one item selected.
closes: #10548
Reviewed-by: Alex Corey <Alex.swansboro@gmail.com>
Reviewed-by: Sarah Akus <sakus@redhat.com>
Update RBAC sidebar
Update RBAC sidebar. Do the following:
Expose read-only applications to normal users in the UI
Expose read-only credential types to normal users in the UI
closes: #10432closes: #10433
Reviewed-by: Jake McDermott <yo@jakemcdermott.me>
Reviewed-by: Sarah Akus <sakus@redhat.com>
Point REST API favicon at the one the UI uses
SUMMARY
Don't ship one that is only used for the API browser.
ISSUE TYPE
Bugfix Pull Request
COMPONENT NAME
API
UI
AWX VERSION
devel
Reviewed-by: Jake McDermott <yo@jakemcdermott.me>
Identify sliced jobs on Job List and Job Details
Identify sliced jobs on Job List and Job details - for workflow jobs.
closes: #2479closes: #10593
Jobs List
Job Details - Workflow Job
Reviewed-by: Alex Corey <Alex.swansboro@gmail.com>
Reviewed-by: Sarah Akus <sakus@redhat.com>
Incorporates Minikube to devel environment
SUMMARY
Incorporates Minikube to devel environment
This PR allows creating a smooth devel environment deploying Minikube connected to the AWX devel network interface using Docker.
Furthermore, both CredentialType and Container Group gets created automatically.
Steps performed by the target make docker-compose-container-group
Downloads Minikube (currently supported Linux and MacOS)
Downloads kubectl (currently supported Linux and MacOS)
Starts Minikube using docker as backend
Creates a Service Account, Role and RoleBinding on Minikube
Exports Minikube ServiceAccount token to be used on AWX Credential
Creates Minikube AWX Credential
Creates Container Group to use Minikube backend
Starts regular AWX devel instances and connected with Minikube network
ISSUE TYPE
Feature Pull Request
COMPONENT NAME
API
AWX VERSION
devel
ADDITIONAL INFORMATION
Quick step-by-step to use this PR:
$ make docker-compose-container-group-clean # this will remove your database and any old Minikube already deployed
$ make docker-compose-container-group
Verifying some work:
$ kubectl get serviceaccount awx-devel
NAME SECRETS AGE
awx-devel 1 130m
$ kubectl get roles
NAME CREATED AT
awx-devel 2021-07-15T00:47:37Z
$ kubectl get rolebindings
NAME ROLE AGE
awx-devel Role/awx-devel 131m
Credential
Container Instance Group
After updating a Job Template and assigning to the Container Instance Group
kubectl get pods -w
NAME READY STATUS RESTARTS AGE
automation-job-6-w6rmh 0/1 Pending 0 0s
automation-job-6-w6rmh 0/1 Pending 0 0s
automation-job-6-w6rmh 0/1 ContainerCreating 0 0s
automation-job-6-w6rmh 1/1 Running 0 5s
automation-job-6-w6rmh 1/1 Terminating 0 6s
Reviewed-by: Shane McDonald <me@shanemcd.com>
Reviewed-by: Elijah DeLee <kdelee@redhat.com>
Reviewed-by: Marcelo Moreira de Mello <tchello.mello@gmail.com>
Reviewed-by: Sarabraj Singh <singh.sarabraj@gmail.com>
Update kubernetes pod doc url
SUMMARY
Just a little change allowing users to find the Kubernetes pod core documentation.
ISSUE TYPE
Docs Pull Request
COMPONENT NAME
UI
AWX VERSION
N/A
ADDITIONAL INFORMATION
N/A
Reviewed-by: Shane McDonald <me@shanemcd.com>
Update defaults.py
we missed this...need it for container groups to work out of the box in the dev environment
Reviewed-by: Bianca Henderson <beeankha@gmail.com>
Fixes missing key values in ad hoc credental step advanced search
SUMMARY
Resolves#10547
ISSUE TYPE
Bugfix Pull Request
COMPONENT NAME
UI
AWX VERSION
ADDITIONAL INFORMATION
Reviewed-by: Kersom <None>
Reviewed-by: Jake McDermott <yo@jakemcdermott.me>
Reviewed-by: Sarah Akus <sakus@redhat.com>
Removes tabs from survey form
SUMMARY
Resolves#10499
ISSUE TYPE
Bugfix Pull Request
COMPONENT NAME
UI
AWX VERSION
ADDITIONAL INFORMATION
Reviewed-by: Kersom <None>
Reviewed-by: Sarah Akus <sakus@redhat.com>
Display error message if schedule does not exist
Display error message if schedule does not exist when redirecting to
details page.
closes: #9550
Reviewed-by: Alex Corey <Alex.swansboro@gmail.com>
Reviewed-by: Sarah Akus <sakus@redhat.com>
Update EE lookup title
Upated EE lookup name to be singular. Also, another reference that to EE
that should be singular.
Closes: #10497
Reviewed-by: Marliana Lara <marliana.lara@gmail.com>
Reviewed-by: Sarah Akus <sakus@redhat.com>
Test cleanup
SUMMARY
Makes a unit test fail if any errors or warnings are logged (see setupTest.js)
Updates/fixes all tests that were logging errors
Fixes a key cause of test flake caused by Jobs.test.jsx (I have still seen a rogue "Network error" cause a flaky failure once; which I will hopefully take care of in a subsequent PR)
Removes all unnecessary calls to wrapper.unmount() (this also surfaced several instances of tests leaving asynchronous code running after test completion, which are now fixed)
ISSUE TYPE
Bugfix Pull Request
COMPONENT NAME
UI
Reviewed-by: Kersom <None>
Reviewed-by: Keith Grant <keithjgrant@gmail.com>
Reviewed-by: Jake McDermott <yo@jakemcdermott.me>
Reviewed-by: Tiago Góes <tiago.goes2009@gmail.com>
Conditional polymorphic setnull
SUMMARY
ISSUE TYPE
Bugfix Pull Request
COMPONENT NAME
API
AWX VERSION
ADDITIONAL INFORMATION
Reviewed-by: Alan Rominger <arominge@redhat.com>
Reviewed-by: Bianca Henderson <beeankha@gmail.com>
Wait until inventory is fully deleted in silent_delete
The silent_delete method does not appear to be used by the AWX CLI. I believe the only use is from:
awx/awxkit/awxkit/api/pages/base.py
Lines 185 to 187
in
eec4f8d
def cleanup(self):
log.debug('{0.endpoint} cleaning up.'.format(self))
return self._cleanup(self.delete)
This is used in integration tests to cleanup at the end of a test. Whenever inventory gets deleted, this leads to various conflict scenarios and deadlocks. This tends to play out by:
DELETE request for the inventory object
DELETE request for the organization
within the request-response cycle, this cascade deletes other objects, or takes SET_NULL action
Because the actual inventory deletion happens in a separate task, this means that inventory and organization deletion cascades are happening simultaneously (dependent on timing and resources).
This is low-priority on our list of practical concerns, because the inventory object accurately reports that its deletion is in progress. Clients can workaround if needed - and that's what I'm trying to do here. In an effort to reduce the flakiness and erroneous errors in integration tests, I propose that this will basically serialize the teardown process (for a given test agent), and that will eliminate a large cluster of flaky errors.
Reviewed-by: Elijah DeLee <kdelee@redhat.com>
Reviewed-by: Jeff Bradberry <None>