The bug here exposes itself is a weird way too, as the Software still successfully creates even though a "Create Failed" message is surfaced to the end-user. If they try again, they just get a 422 response since that org/name is already taken.
Started POST "/api/v1/software/create" for ::1 at 2020-08-14 09:48:24 -0500
Processing by Api::V1::SoftwareController#create as JSON
Parameters: {"name"=>"kops", "org"=>"kubernetes", "full_name"=>"kubernetes/kops", "in_use_release"=>"1.16.2", "software"=>{"name"=>"kops", "org"=>"kubernetes", "full_name"=>"kubernetes/kops", "in_use_release"=>"1.16.2"}}
Unpermitted parameters: :format, :software
(0.0ms) begin transaction
↳ app/controllers/api/v1/software_controller.rb:8
Software Exists (0.2ms) SELECT 1 AS one FROM "softwares" WHERE "softwares"."name" = ? AND "softwares"."org" = ? LIMIT ? [["name", "kops"], ["org", "kubernetes"], ["LIMIT", 1]]
↳ app/controllers/api/v1/software_controller.rb:8
Software Exists (0.1ms) SELECT 1 AS one FROM "softwares" WHERE "softwares"."full_name" = ? LIMIT ? [["full_name", "kubernetes/kops"], ["LIMIT", 1]]
↳ app/controllers/api/v1/software_controller.rb:8
Software Create (2.0ms) INSERT INTO "softwares" ("name", "org", "full_name", "created_at", "updated_at", "in_use_release") VALUES (?, ?, ?, ?, ?, ?) [["name", "kops"], ["org", "kubernetes"], ["full_name", "kubernetes/kops"], ["created_at", "2020-08-14 14:48:24.348402"], ["updated_at", "2020-08-14 14:48:24.348402"], ["in_use_release", "1.16.2"]]
↳ app/controllers/api/v1/software_controller.rb:8
(1.1ms) commit transaction
↳ app/controllers/api/v1/software_controller.rb:8
[ActiveJob] [ReconcileSoftware] [097ca3d3-c869-431f-b448-05a85257e07a] Performing ReconcileSoftware (Job ID: 097ca3d3-c869-431f-b448-05a85257e07a) from Async(default) with arguments: #<GlobalID:0x00007ff798bcac18 @uri=#<URI::GID gid://tps-report/Software/9>>
[ActiveJob] [ReconcileSoftware] [097ca3d3-c869-431f-b448-05a85257e07a] Error performing ReconcileSoftware (Job ID: 097ca3d3-c869-431f-b448-05a85257e07a) from Async(default) in 1396.76ms: NoMethodError (undefined method `published_at' for nil:NilClass):
/Users/dpramann/repos/tps-report/app/models/software.rb:34:in `reconcile_with_github'
/Users/dpramann/repos/tps-report/app/models/software.rb:14:in `reconcile!'
/Users/dpramann/repos/tps-report/app/jobs/reconcile_software.rb:5:in `perform'
/Users/dpramann/.rvm/gems/ruby-2.6.3/gems/activejob-5.2.4.2/lib/active_job/execution.rb:39:in `block in perform_now'
/Users/dpramann/.rvm/gems/ruby-2.6.3/gems/activesupport-5.2.4.2/lib/active_support/callbacks.rb:109:in `block in run_callbacks'