diff --git a/artifactomat/Gemfile.lock b/artifactomat/Gemfile.lock index 0cf01116072605eacf300ec8e3e4eb69b793eeab..c57ee88da5892f03e4f5ccc4b9b71de9d268b92b 100644 --- a/artifactomat/Gemfile.lock +++ b/artifactomat/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - artifactomat (4.1.0-x86_64-linux) + artifactomat (5.0.0-x86_64-linux) activerecord (= 5.2.6.2) async-dns (= 1.2.6) biz (= 1.8.2) @@ -59,7 +59,7 @@ GEM timers (~> 4.1) async-dns (1.2.6) async-io (~> 1.15) - async-io (1.32.2) + async-io (1.33.0) async biz (1.8.2) clavius (~> 1.0) @@ -73,7 +73,7 @@ GEM clavius (1.0.4) codeclimate-engine-rb (0.4.2) coderay (1.1.3) - concurrent-ruby (1.1.9) + concurrent-ruby (1.1.10) connection_pool (2.2.5) console (1.14.0) fiber-local @@ -83,7 +83,7 @@ GEM diff-lcs (1.5.0) docile (1.4.0) erubi (1.10.0) - et-orbi (1.2.6) + et-orbi (1.2.7) tzinfo factory_bot (5.2.0) activesupport (>= 4.2.0) @@ -106,7 +106,7 @@ GEM listen (3.7.1) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - loofah (2.14.0) + loofah (2.15.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) method_source (0.8.2) @@ -121,7 +121,7 @@ GEM childprocess (>= 0.6.3, < 5) iniparse (~> 1.4) rexml (~> 3.2) - parallel (1.21.0) + parallel (1.22.0) parser (2.7.2.0) ast (~> 2.4.1) pg (1.2.3) @@ -227,9 +227,9 @@ GEM tzinfo (>= 1.0.0) unf (0.1.4) unf_ext - unf_ext (0.0.8) + unf_ext (0.0.8.1) unicode-display_width (1.6.1) - uniform_notifier (1.14.2) + uniform_notifier (1.16.0) webmock (3.14.0) addressable (>= 2.8.0) crack (>= 0.3.2) @@ -260,4 +260,4 @@ DEPENDENCIES webmock (~> 3.7, >= 3.7.6) BUNDLED WITH - 2.3.8 + 2.3.10 diff --git a/artifactomat/db/migrate/20220309101235_watch_arguments_default_nil.rb b/artifactomat/db/migrate/20220309101235_watch_arguments_default_nil.rb new file mode 100644 index 0000000000000000000000000000000000000000..1dde8323619c9e77d7e3378719ef5e2deab75202 --- /dev/null +++ b/artifactomat/db/migrate/20220309101235_watch_arguments_default_nil.rb @@ -0,0 +1,7 @@ +class WatchArgumentsDefaultNil < ActiveRecord::Migration[5.2] + def change + change_column_null :jobs, :watch_arguments, true + change_column_default :jobs, :watch_arguments, from: "{}", to: nil + end +end + diff --git a/artifactomat/db/schema.rb b/artifactomat/db/schema.rb index 08ed98523df24d954385eb107a15d2c5676c1a05..25579ff6ab8ba51fe3a64cbe3f5c7eecda0296d3 100644 --- a/artifactomat/db/schema.rb +++ b/artifactomat/db/schema.rb @@ -2,15 +2,15 @@ # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. # -# Note that this schema.rb definition is the authoritative source for your -# database schema. If you need to create the application database on another -# system, you should be using db:schema:load, not running all the migrations -# from scratch. The latter is a flawed and unsustainable approach (the more migrations -# you'll amass, the slower it'll run and the greater likelihood for issues). +# This file is the source Rails uses to define your schema when running `rails +# db:schema:load`. When creating a new database, `rails db:schema:load` tends to +# be faster and is potentially less error prone than running all of your +# migrations from scratch. Old migrations may fail to apply correctly if those +# migrations use external dependencies or application code. # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2021_08_23_102733) do +ActiveRecord::Schema.define(version: 2022_03_09_101235) do create_table "infra_elements_recipies", id: false, force: :cascade do |t| t.integer "infrastructure_element_id" @@ -26,7 +26,7 @@ ActiveRecord::Schema.define(version: 2021_08_23_102733) do t.datetime "expiration_date" t.datetime "creation_date" t.datetime "collection_date" - t.string "watch_arguments", default: "{}", null: false + t.string "watch_arguments" t.index ["user"], name: "idx_jobs_user" end diff --git a/artifactomat/dist/etc/artifactomat/conf.yml b/artifactomat/dist/etc/artifactomat/conf.yml index 1fa6f809f4027d5dc35f23dab562b4a8ba2ed6b9..5207e2ce45b68370bbfa555010b4379e10c0bde1 100644 --- a/artifactomat/dist/etc/artifactomat/conf.yml +++ b/artifactomat/dist/etc/artifactomat/conf.yml @@ -179,7 +179,7 @@ ape_job_spooler: windows_client: # version of the windows-client that you want to build. # manually changing this version may lead to errors when trying to build the windows-client - version: 1.0.1 + version: 1.0.2 # configuration to access a docker registry # docker: diff --git a/artifactomat/lib/artifactomat/models/job.rb b/artifactomat/lib/artifactomat/models/job.rb index bdf601a00a966d8e2594618d14597db2911e813e..b9d2affe09e871671a667afb43e628ad053f3aa4 100644 --- a/artifactomat/lib/artifactomat/models/job.rb +++ b/artifactomat/lib/artifactomat/models/job.rb @@ -16,7 +16,7 @@ class Job < ActiveRecord::Base allow_blank: true, allow_nil: false validates :creation_date, presence: true - validates :watch_arguments, presence: true, allow_blank: false, allow_nil: false + validates :watch_arguments, presence: true, allow_blank: false, allow_nil: true enum status: %i[waiting completed failed] enum action: %i[copy execute remove start_detection stop_detection] diff --git a/artifactomat/lib/artifactomat/version.rb b/artifactomat/lib/artifactomat/version.rb index bc3e9ad19c29e13b244a8a0b0589d2c37c006d0c..4e241d5efc59e9f236e795e940f1fd13fcee8620 100644 --- a/artifactomat/lib/artifactomat/version.rb +++ b/artifactomat/lib/artifactomat/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module ARTIFACTOMAT - VERSION = '4.1.0' + VERSION = '5.0.0' end diff --git a/artifactomat/spec/stress/job_stress_spec.rb b/artifactomat/spec/stress/job_stress_spec.rb index 7c34210ea03a471b5d9a81450bc6f84ade3b0fa6..bfccf4e9859808c577de3f4797a6e5bce1fffd86 100644 --- a/artifactomat/spec/stress/job_stress_spec.rb +++ b/artifactomat/spec/stress/job_stress_spec.rb @@ -204,7 +204,7 @@ describe "JOB STRESS TEST – #{SUBJECT_AMOUNT} subjects", system: true, order: 'action' => 'execute', 'file_path' => '/tmp/itsapetestfile.txt', 'deploy_path' => '', - 'watch_arguments' => '{}' + 'watch_arguments' => nil } job2 = { 'user' => "sub#{i}", @@ -212,7 +212,7 @@ describe "JOB STRESS TEST – #{SUBJECT_AMOUNT} subjects", system: true, order: 'action' => 'copy', 'file_path' => '/tmp/itsapetestfile.txt', 'deploy_path' => '%USER_PROFILE\\DESKTOP', - 'watch_arguments' => '{}' + 'watch_arguments' => nil } expect(jobs).to include(job1) expect(jobs).to include(job2) diff --git a/artifactomat/spec/test_conf.yml b/artifactomat/spec/test_conf.yml index 2530a30e2faa99e87b3c907938c91f50554330b4..219fbff9cf6815c4fa9267b022e8423230e543be 100644 --- a/artifactomat/spec/test_conf.yml +++ b/artifactomat/spec/test_conf.yml @@ -168,4 +168,4 @@ ape_job_spooler: port: 8123 windows_client: - version: 1.0.1 + version: 1.0.2 diff --git a/changelog.md b/changelog.md index e69285d367003e7b26e0c84f67abf58e0d38c8d0..102290fa733dd7161bbc23fe25e7657e69db786b 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,6 @@ +# 5.0.0 + * Jobs default `watch_arguments` value changed from `{}` to `nil` + # 4.1.0 * Expose all infrastructure element parameters to the recipe scripts as environment variables