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

The cleanup_jobs management job now deletes the last project updates of projects #10625

Closed
3 tasks done
AlanCoding opened this issue Jul 12, 2021 · 4 comments
Closed
3 tasks done

Comments

@AlanCoding
Copy link
Member

Please confirm the following

  • I agree to follow this project's code of conduct.
  • I have checked the current issues for duplicates.
  • I understand that AWX is open source software provided for free and that I am not entitled to status updates or other assurances.

Summary

Prior behavior was the AWX would preserve some project updates even if the cleanup jobs management job was ran with 0 days.

In particular, I'd expect a project's last update (link in related) to be kept. The first update from a project was also kept (I don't have full details as to why right now).

This behavior was intentional, and seems to have changed now. All project updates are unexpectedly deleted now.

AWX version

19.2.2

Installation method

docker on linux

Modifications

no

Ansible version

N/A

Operating system

N/A

Web browser

Chrome

Steps to reproduce

  • Create a project
  • wait for the initial automatic update to finish
  • update that project 2 more times
  • run the cleanup_jobs management job with days=0

Expected results

This leaves 2 project updates for that project - this was the behavior in Ansible Tower 3.8

It leaves the first automatic update, and it leaves the 2nd of the 2 manual updates. Only the first manual update is deleted.

Actual results

Deletes all 3 updates from the project.

Put another way, there are 0 project updates in the system after running the cleanup_jobs management job.

Additional information

No response

@AlanCoding
Copy link
Member Author

Probably fallout from #6166 or #10023, with the latter being more likely I think, ping @chrismeyersfsu

If we're dropping the tables, then it seems hard to imagine that we're keeping the original / last project updates.

@chrismeyersfsu
Copy link
Member

chrismeyersfsu commented Jul 12, 2021

Selectively keeping a project update was an unknown unknown that was not taken into account when doing the db partition work. But after looking at the code for a little bit it looks like the logic to skip certain project update when running cleanup is still in tact

elif pu in (pu.project.current_update, pu.project.last_update) and pu.project.scm_type:

But the logic that was added to work on the new partitions does not take the special project updates and inventory updates into account.
https://github.com/ansible/awx/blob/devel/awx/main/management/commands/cleanup_jobs.py#L72

To fix this find_jobs_to_delete() should take into account what the old non-partition logic takes into account.

@AlanCoding
Copy link
Member Author

I'm not saying we have to fix this.

We should consider the original reason someone wanted this behavior. If you run cleanup jobs and look at the project list, what do you see, and is it acceptable? There might be other workarounds, I'm not sure.

@AlanCoding
Copy link
Member Author

Heads up to @fosterseth, closing as not-a-bug because we merged UI changes to allow a project without a marked last update to display cleanly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants