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

Add missing jobs for initiatives rake tasks #474

Merged
merged 1 commit into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,5 @@ coverage/
public/sw.js*
app/compiled_views/
certificate-https-local/

.DS_Store
7 changes: 7 additions & 0 deletions app/jobs/check_published_initiatives.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# frozen_string_literal: true

class CheckPublishedInitiatives < ApplicationJob
def perform
system "rake decidim_initiatives:check_published"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer to call directly objects as the rake task rather than invoking a system command

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see the point but in that case these tasks already have tests
https://github.com/decidim/decidim/tree/release/0.27-stable/decidim-initiatives/spec/lib/tasks

Besides we might want to call directly these tasks instead of copy the code in them in case this code changes in the future release

end
end
7 changes: 7 additions & 0 deletions app/jobs/check_validating_initiatives.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# frozen_string_literal: true

class CheckValidatingInitiatives < ApplicationJob
def perform
system "rake decidim_initiatives:check_validating"
end
end
7 changes: 7 additions & 0 deletions app/jobs/notify_progress_initiatives.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# frozen_string_literal: true

class NotifyProgressInitiatives < ApplicationJob
def perform
system "rake decidim_initiatives:notify_progress"
end
end
2 changes: 1 addition & 1 deletion app/views/decidim/devise/shared/_omniauth_buttons.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class="social-register">
<% if provider.match?("france") %>
<span class="register__separator">
<span class="register__separator__text"><%= t("devise.shared.links.sign_in_with_france_connect")%></span>
<span class="register__separator__text"><%= t("devise.shared.links.sign_in_with_france_connect") %></span>
</span>
<div class="text-center">
<p><%= t("decidim.omniauth.france_connect.explanation") %></p>
Expand Down
13 changes: 13 additions & 0 deletions config/sidekiq.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
- reminders
- active_storage_analysis
- active_storage_purge
- initiatives

:scheduler:
:schedule:
Expand Down Expand Up @@ -44,3 +45,15 @@
class: NotificationsDigestMailJob
queue: mailers
args: :weekly
CheckPublishedInitiatives:
cron: '0 1 * * *'
class: CheckPublishedInitiatives
queue: initiatives
CheckValidatingInitiatives:
cron: '0 1 * * *'
class: CheckValidatingInitiatives
queue: initiatives
NotifyProgressInitiatives:
cron: '0 1 * * *'
class: NotifyProgressInitiatives
queue: initiatives
Loading