Skip to content

Commit

Permalink
Validate connection on Preprocess step (#227)
Browse files Browse the repository at this point in the history
This *could* be fixed in the collectionspace-mapper (see below) but I
am doing it here on the principle of saving the user time and effort. They
shouldn't have to go through the preprocess step (which can take a few
minutes) and click through to Processing and starting that step to
find out their connection credentials will not let them complete a
batch.

The preprocessing step doesn't require a connection to the
CollectionSpace instance, but it does make calls to methods on the
collectionspace-mapper handler associated with the batch.

On instantiation, the handler class attempts to set instance domain
by calling client.domain, which fails if the client cannot
authenticate. It probably shouldn't do that on instantiation, I will
make a note to improve that later, but again, an unusable connection
should be caught/reported to users ASAP by the importer, which means
at the beginning of preprocessing (if not on batch creation).
  • Loading branch information
kspurgin authored Feb 4, 2025
1 parent 404c02a commit 9f98aeb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/models/step/preprocess.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

module Step
class Preprocess < ApplicationRecord
include ConnectionStatus
include WorkflowMetadata
belongs_to :batch
validate :connection_is_active?

def name
:preprocessing
Expand Down

0 comments on commit 9f98aeb

Please sign in to comment.