Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve performance on Tower schedule runs with bugfix for missing schedules #630

Merged
merged 3 commits into from
Jun 29, 2021

Conversation

paulbarfuss
Copy link
Contributor

What does this PR do?

  • Fix a condition in latest process-project update where is true fails and should be == true
  • Use the 400 response code when creating a schedule with a POST to determine if it should instead be updated with a PUT
  • Use /api/v2/schedules/?name={{ schedule.name }} to lookup existing schedules instead of looping through all schedules. This will enhance performance while bypassing a potential bug where not all schedules show up in the global /api/v2/schedules even when accounting for pagination. (The API browser is also missing some schedules from the global endpoint)

How should this be tested?

Tested all changes against one of the failing playbooks in Tower by pointing to the incoming paulbarfuss/infra-ansible fork/branch.

For some unknown reason, when looking up all schedules in {{ ansible_tower_url }}/api/v2/schedules/ using the rest_get module a few are not appearing. For example:

  • {{ ansible_tower_url }}/api/v2/schedules/86 does not appear in the global schedules
  • {{ ansible_tower_url }}/api/v2/job_templates/94/schedules/ does include the schedule with "id": 86
  • {{ ansible_tower_url }}/api/v2/schedules/?name={{ schedule.name }} quickly finds the correct schedule.id and only checks once we know from the 400 response code that the schedule does indeed already exist.

People to notify

cc: @redhat-cop/infra-ansible

@paulbarfuss paulbarfuss changed the title Bugfix unset schedule Improve performance on Tower schedule runs with bugfix for missing schedules Jun 29, 2021
@paulbarfuss paulbarfuss requested a review from oybed June 29, 2021 00:18
@oybed oybed merged commit 9a11ead into redhat-cop:main Jun 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants