maintenance_tasks 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.md +18 -0
- data/README.md +10 -33
- data/app/models/maintenance_tasks/run.rb +3 -1
- data/app/tasks/maintenance_tasks/task.rb +4 -0
- metadata +7 -6
- data/Rakefile +0 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 45bd2df064845d494e9bfd74589131d6b77caf345b3d5f4c852403dfa05fd5ac
|
4
|
+
data.tar.gz: a48816bc76477c58717f273a1318249dd638daf5b186c8b196df57d41b2e50ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d96b17402de319cef50393e133100317cbb480180e6c1041e998e24fa1ccd224a4f252832b60c068f489217c4c1ea60121e15e015559746bf6dfc967bceb4d12
|
7
|
+
data.tar.gz: 5fe898977ebda4b13829df10917466ab4c7474cf705600f5574b561073b9191cf3b200b36bc32d34f9477be51b80b70335e2ed759b241de62771500ff7e74ed5
|
data/LICENSE.md
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
Copyright 2020-present, Shopify Inc.
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
4
|
+
this software and associated documentation files (the "Software"), to deal in
|
5
|
+
the Software without restriction, including without limitation the rights to
|
6
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
7
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
8
|
+
subject to the following conditions:
|
9
|
+
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
11
|
+
copies or substantial portions of the Software.
|
12
|
+
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
15
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
16
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
17
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
18
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
@@ -2,35 +2,6 @@
|
|
2
2
|
|
3
3
|
A Rails engine for queuing and managing maintenance tasks.
|
4
4
|
|
5
|
-
## Table of Contents
|
6
|
-
|
7
|
-
* [Demo](#demo)
|
8
|
-
* [Installation](#installation)
|
9
|
-
* [Active Job Dependency](#active-job-dependency)
|
10
|
-
* [Usage](#usage)
|
11
|
-
* [Creating a Task](#creating-a-task)
|
12
|
-
* [Creating a CSV Task](#creating-a-csv-task)
|
13
|
-
* [Considerations when writing Tasks](#considerations-when-writing-tasks)
|
14
|
-
* [Writing tests for a Task](#writing-tests-for-a-task)
|
15
|
-
* [Writing tests for a CSV Task](#writing-tests-for-a-csv-task)
|
16
|
-
* [Running a Task](#running-a-task)
|
17
|
-
* [Monitoring your Task's status](#monitoring-your-tasks-status)
|
18
|
-
* [How Maintenance Tasks runs a Task](#how-maintenance-tasks-runs-a-task)
|
19
|
-
* [Help! My Task is stuck](#help-my-task-is-stuck)
|
20
|
-
* [Configuring the gem](#configuring-the-gem)
|
21
|
-
* [Customizing the error handler](#customizing-the-error-handler)
|
22
|
-
* [Customizing the maintenance tasks module](#customizing-the-maintenance-tasks-module)
|
23
|
-
* [Customizing the underlying job class](#customizing-the-underlying-job-class)
|
24
|
-
* [Customizing the rate at which task progress gets updated](#customizing-the-rate-at-which-task-progress-gets-updated)
|
25
|
-
* [Customizing which Active Storage service to use](#customizing-which-active-storage-service-to-use)
|
26
|
-
* [Upgrading](#upgrading)
|
27
|
-
* [Contributing](#contributing)
|
28
|
-
* [Releasing new versions](#releasing-new-versions)
|
29
|
-
|
30
|
-
## Demo
|
31
|
-
|
32
|
-
Watch this demo video to see the gem in action:
|
33
|
-
|
34
5
|
[![Link to demo video](static/demo.png)](https://www.youtube.com/watch?v=BTuvTQxlFzs)
|
35
6
|
|
36
7
|
## Installation
|
@@ -453,6 +424,12 @@ pull requests. You can find the contribution guidelines on
|
|
453
424
|
|
454
425
|
[contributing]: https://github.com/Shopify/maintenance_tasks/blob/main/.github/CONTRIBUTING.md
|
455
426
|
|
427
|
+
### Dependabot updates
|
428
|
+
|
429
|
+
Whenever Dependabot creates a PR for a gem bump, check out the branch locally
|
430
|
+
and run `bin/update-gemfile <gem>` to ensure all the gemfiles have the gem
|
431
|
+
updated consistently.
|
432
|
+
|
456
433
|
## Releasing new versions
|
457
434
|
|
458
435
|
Updates should be added to the latest draft release on GitHub as Pull Requests
|
@@ -461,14 +438,14 @@ are merged.
|
|
461
438
|
Once a release is ready, follow these steps:
|
462
439
|
|
463
440
|
* Update `spec.version` in `maintenance_tasks.gemspec`.
|
464
|
-
* Run `
|
441
|
+
* Run `bin/gemfile-update install` to bump the version in all the lockfiles.
|
465
442
|
* Open a PR and merge on approval.
|
466
443
|
* Deploy via [Shipit][shipit] and see the new version on
|
467
444
|
<https://rubygems.org/gems/maintenance_tasks>.
|
468
445
|
* Ensure the release has documented all changes and publish it.
|
469
|
-
* Create a new [draft release on GitHub][release] with the title
|
470
|
-
|
471
|
-
|
446
|
+
* Create a new [draft release on GitHub][release] with the title 'Upcoming
|
447
|
+
Release'. The tag version can be left blank. This will be the starting point
|
448
|
+
for documenting changes related to the next release.
|
472
449
|
|
473
450
|
[release]: https://help.github.com/articles/creating-releases/
|
474
451
|
[shipit]: https://shipit.shopify.io/shopify/maintenance_tasks/rubygems
|
@@ -43,6 +43,7 @@ module MaintenanceTasks
|
|
43
43
|
|
44
44
|
# Ensure ActiveStorage is in use before preloading the attachments
|
45
45
|
scope :with_attached_csv, -> do
|
46
|
+
return unless defined?(ActiveStorage)
|
46
47
|
with_attached_csv_file if ActiveStorage::Attachment.table_exists?
|
47
48
|
end
|
48
49
|
|
@@ -51,7 +52,7 @@ module MaintenanceTasks
|
|
51
52
|
if MaintenanceTasks.active_storage_service.present?
|
52
53
|
has_one_attached :csv_file,
|
53
54
|
service: MaintenanceTasks.active_storage_service
|
54
|
-
|
55
|
+
elsif respond_to?(:has_one_attached)
|
55
56
|
has_one_attached :csv_file
|
56
57
|
end
|
57
58
|
|
@@ -211,6 +212,7 @@ module MaintenanceTasks
|
|
211
212
|
#
|
212
213
|
# @return [ActiveStorage::Attached::One] the attached CSV file
|
213
214
|
def csv_file
|
215
|
+
return unless defined?(ActiveStorage)
|
214
216
|
return unless ActiveStorage::Attachment.table_exists?
|
215
217
|
super
|
216
218
|
end
|
@@ -38,6 +38,10 @@ module MaintenanceTasks
|
|
38
38
|
# An input to upload a CSV will be added in the form to start a Run. The
|
39
39
|
# collection and count method are implemented.
|
40
40
|
def csv_collection
|
41
|
+
if !defined?(ActiveStorage) || !ActiveStorage::Attachment.table_exists?
|
42
|
+
raise NotImplementedError, "Active Storage needs to be installed\n"\
|
43
|
+
"To resolve this issue run: bin/rails active_storage:install"
|
44
|
+
end
|
41
45
|
include(CsvCollection)
|
42
46
|
end
|
43
47
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: maintenance_tasks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shopify Engineering
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-04-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|
@@ -87,8 +87,8 @@ executables:
|
|
87
87
|
extensions: []
|
88
88
|
extra_rdoc_files: []
|
89
89
|
files:
|
90
|
+
- LICENSE.md
|
90
91
|
- README.md
|
91
|
-
- Rakefile
|
92
92
|
- app/controllers/maintenance_tasks/application_controller.rb
|
93
93
|
- app/controllers/maintenance_tasks/runs_controller.rb
|
94
94
|
- app/controllers/maintenance_tasks/tasks_controller.rb
|
@@ -136,12 +136,13 @@ files:
|
|
136
136
|
- lib/maintenance_tasks/engine.rb
|
137
137
|
- lib/tasks/maintenance_tasks_tasks.rake
|
138
138
|
homepage: https://github.com/Shopify/maintenance_tasks
|
139
|
-
licenses:
|
139
|
+
licenses:
|
140
|
+
- MIT
|
140
141
|
metadata:
|
141
|
-
source_code_uri: https://github.com/Shopify/maintenance_tasks/tree/v1.2.
|
142
|
+
source_code_uri: https://github.com/Shopify/maintenance_tasks/tree/v1.2.2
|
142
143
|
allowed_push_host: https://rubygems.org
|
143
144
|
post_install_message: |-
|
144
|
-
Thank you for installing Maintenance Tasks 1.2.
|
145
|
+
Thank you for installing Maintenance Tasks 1.2.2. To complete, please run:
|
145
146
|
|
146
147
|
rails generate maintenance_tasks:install
|
147
148
|
rdoc_options: []
|
data/Rakefile
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
begin
|
3
|
-
require "bundler/setup"
|
4
|
-
rescue LoadError
|
5
|
-
puts "You must `gem install bundler` and `bundle install` to run rake tasks"
|
6
|
-
end
|
7
|
-
|
8
|
-
require "rdoc/task"
|
9
|
-
RDoc::Task.new(:rdoc) do |rdoc|
|
10
|
-
rdoc.rdoc_dir = "rdoc"
|
11
|
-
rdoc.title = "MaintenanceTasks"
|
12
|
-
rdoc.options << "--line-numbers"
|
13
|
-
rdoc.rdoc_files.include("README.md")
|
14
|
-
rdoc.rdoc_files.include("lib/**/*.rb")
|
15
|
-
end
|
16
|
-
|
17
|
-
APP_RAKEFILE = File.expand_path("test/dummy/Rakefile", __dir__)
|
18
|
-
load("rails/tasks/engine.rake")
|
19
|
-
|
20
|
-
load("rails/tasks/statistics.rake")
|
21
|
-
|
22
|
-
require "bundler/gem_tasks"
|
23
|
-
|
24
|
-
require "rubocop/rake_task"
|
25
|
-
RuboCop::RakeTask.new
|
26
|
-
|
27
|
-
task(test: "app:test")
|
28
|
-
task("test:system" => "app:test:system")
|
29
|
-
task(default: ["db:test:prepare", "test", "test:system", "rubocop"])
|