-
Notifications
You must be signed in to change notification settings - Fork 296
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
Fixes #36852 - Allow fetching capsule sync task per env #10779
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm seeing an error:
Last sync failed: comparison of ActiveSupport::TimeWithZone with nil failed
023-10-27T20:29:16 [E|app|cf6ae499] ActionView::Template::Error: comparison of ActiveSupport::TimeWithZone with nil failed
cf6ae499 | /home/vagrant/katello/app/models/katello/concerns/smart_proxy_extensions.rb:456:in `>'
cf6ae499 | /home/vagrant/katello/app/models/katello/concerns/smart_proxy_extensions.rb:456:in `last_env_sync_task'
cf6ae499 | (eval):40:in `block (2 levels) in cached_source_2878749412122931441'
cf6ae499 | /home/vagrant/foreman/.vendor/ruby/2.7.0/gems/rabl-0.16.1/lib/rabl/builder.rb:158:in `node'
cf6ae499 | /home/vagrant/foreman/.vendor/ruby/2.7.0/gems/rabl-0.16.1/lib/rabl/builder.rb:116:in `block in compile_settings'
cf6ae499 | /home/vagrant/foreman/.vendor/ruby/2.7.0/gems/rabl-0.16.1/lib/rabl/builder.rb:115:in `each'
cf6ae499 | /home/vagrant/foreman/.vendor/ruby/2.7.0/gems/rabl-0.16.1/lib/rabl/builder.rb:115:in `compile_settings'
cf6ae499 | /home/vagrant/foreman/.vendor/ruby/2.7.0/gems/rabl-0.16.1/lib/rabl/builder.rb:60:in `block in to_hash'
cf6ae499 | /home/vagrant/foreman/.vendor/ruby/2.7.0/gems/rabl-0.16.1/lib/rabl/builder.rb:253:in `cache_results'
cf6ae499 | /home/vagrant/foreman/.vendor/ruby/2.7.0/gems/rabl-0.16.1/lib/rabl/builder.rb:51:in `to_hash'
cf6ae499 | /home/vagrant/foreman/.vendor/ruby/2.7.0/gems/rabl-0.16.1/lib/rabl/multi_builder.rb:27:in `map'
cf6ae499 | /home/vagrant/foreman/.vendor/ruby/2.7.0/gems/rabl-0.16.1/lib/rabl/multi_builder.rb:27:in `to_a'
cf6ae499 | /home/vagrant/foreman/.vendor/ruby/2.7.0/gems/rabl-0.16.1/lib/rabl/engine.rb:93:in `to_hash'
cf6ae499 | /home/vagrant/foreman/.vendor/ruby/2.7.0/gems/rabl-0.16.1/lib/rabl/engine.rb:51:in `block in render'
cf6ae499 | /home/vagrant/foreman/.vendor/ruby/2.7.0/gems/rabl-0.16.1/lib/rabl/engine.rb:392:in `cache_results'
cf6ae499 | /home/vagrant/foreman/.vendor/ruby/2.7.0/gems/rabl-0.16.1/lib/rabl/engine.rb:50:in `render'
cf6ae499 | /home/vagrant/foreman/config/initializers/rabl_init.rb:49:in `render'
...
bf5c415
to
4699f3b
Compare
I added https://projects.theforeman.org/issues/36873 as an issue..Is a corner case on newly added envs before a sync so we can tackle it in code chill.. |
If I cleanup all of my ForemanTasks I get the following 500 error:
|
Looking at the code... maybe that bug already existed? Edit: nope, it's not reproducible on master, huh I'm guessing the |
The 500 aside, it's looking good where there are sync tasks to find |
4699f3b
to
75592c9
Compare
The 500 makes sense for when no tasks exist..Added nil check for that..Should show N/A as last sync on UI when tasks are cleaned up. |
Maybe that's just fine, the last sync says N/A instead of not synced I realize. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking fine to me!
What are the changes introduced in this pull request?
Update Smart Proxy content UI to show env level sync tasks if those exist.
Considerations taken when implementing this change?
We are showing env level records on new smart proxy page. We have a column to show the last sync task for the environments individually. The only way to start an env sync is via hammer/API which starts a capsule sync task with environment_id set in input[:options]
PS: There's a known issue here where if you run a complete sync and then later add a new env to the smart proxy, the complete sync task will appear to have run on the env on the page. Right now we have no way of telling if envs were added before or after a sync was run. Open to ideas. In these cases, even if the env suggests capsule is synced, the expansion aka CV will show not synced cause that information comes from smart_proxy_sync_history record.
What are the testing steps for this pull request?
hammer capsule content synchronize --lifecycle-environment-id=4 --id=2