awx icon indicating copy to clipboard operation
awx copied to clipboard

Adding prevent_instance_group_fallback

Open john-westcott-iv opened this issue 1 year ago • 4 comments

SUMMARY

Adds a prevent_instnace_group_fallback field to job templates and inventories and refactors preferred_instance_groups too "short circuit" if it finds a flag in either location.

WIP status: Needs unit test updates.

ISSUE TYPE
  • New or Enhanced Feature
COMPONENT NAME
  • API
  • UI
AWX VERSION
awx: 21.5.1.dev2+g1585f02bff.d20220824
ADDITIONAL INFORMATION

john-westcott-iv avatar Aug 24 '22 14:08 john-westcott-iv

This is really great work. I realize this is a WIP but wanted to provide some feedback. We still need to update the details view for Job Templates, and for Inventory, along with the unit tests to reflect these new fields.

AlexSCorey avatar Aug 24 '22 15:08 AlexSCorey

Thanks, the checkbox on inventories is a little wonky and I'll probably need some help getting it aligned a little better.

john-westcott-iv avatar Aug 24 '22 16:08 john-westcott-iv

Needs QE tests to be created.

AlexSCorey avatar Sep 13 '22 20:09 AlexSCorey

The only test case for integration tests is whether the Prevent fallback.... value shows up on the details page after save.

AlexSCorey avatar Sep 15 '22 15:09 AlexSCorey

There are several other implementations of this method preferred_instance_groups, and I don't think we can call this complete without updating those. For example, for ad hoc commands.

https://github.com/ansible/awx/blob/85a5b58d1882c683341573390b9213dc292f97ff/awx/main/models/ad_hoc_commands.py#L230-L242

If I set this flag for my inventory, I would expect that jobs will not fallback to organization instance groups. But why should I expect otherwise when running ad hoc commands against that inventory?

I think that's a pretty critical change needed here before merge. Otherwise I don't have any major objections. You could re-apply the pattern you have to those methods, or maybe delete some of the non-unified versions of that method if what you have is general enough.

AlanCoding avatar Sep 26 '22 16:09 AlanCoding

@AlanCoding good feedback. I modified ad_hoc and inventory source updates as well. Please have a look and let me know what you think.

john-westcott-iv avatar Sep 26 '22 20:09 john-westcott-iv



Test summary

662 4 771 0Flakiness 1


Run details

Project AWX - Functional
Status Failed
Commit 08bcc70b67
Started Sep 28, 2022 5:46 PM
Ended Sep 28, 2022 9:15 PM
Duration 28:47 💡
OS Linux Debian - 11.3
Browser Chrome 100

View run in Cypress Dashboard ➡️


Failures

credentials/credential-crud.cy.js Failed
1 Create and delete Credentials > Can create, edit, and delete Google Compute Engine credential using required fields
instance-groups/instance-group-crud.cy.js Failed
1 Create a instance group > Delete an instance group > Deleting an instance group will alert user that job templates associated with that instance group will be affected
2 Create a instance group > Delete an instance group > Deleting an instance group will alert user that inventories associated with that instance group will be affected
3 Create a instance group > Delete an instance group > Deleting an instance group will alert user that organizations associated with that instance group will be affected

Flakiness

cypress/e2e/integration/user-journeys/auditor-journey.cy.js Flakiness
1 Inventories > cannot Run command, add or disassociate related groups

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

cypress[bot] avatar Sep 26 '22 20:09 cypress[bot]

One of the big next steps I think we should take in this area (and notifications too) is to express the search criteria used in the UI... in some special place the user can drill down into, and have this self-document. Same for notification templates and other organization-fallback kind of things.

AlanCoding avatar Sep 27 '22 00:09 AlanCoding

verified by QE

jay-steurer avatar Sep 28 '22 21:09 jay-steurer