-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #91 from nextflow-io/observer-check
Move unpinned version check to an observer
- Loading branch information
Showing
4 changed files
with
45 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
plugins/nf-schema/src/main/nextflow/validation/ValidationObserver.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package nextflow.validation | ||
|
||
import nextflow.Session | ||
import nextflow.trace.TraceObserver | ||
|
||
import groovy.util.logging.Slf4j | ||
|
||
/** | ||
* An observer for initial checks that always need to be run at the start of the pipeline | ||
* | ||
* @author : nvnieuwk <[email protected]> | ||
*/ | ||
|
||
|
||
@Slf4j | ||
class ValidationObserver implements TraceObserver { | ||
|
||
@Override | ||
void onFlowCreate(Session session) { | ||
def plugins = session?.config?.navigate("plugins") as ArrayList | ||
if(plugins?.contains("nf-schema")) { | ||
log.warn(""" | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
! ! | ||
! WARNING! ! | ||
! ! | ||
! You just entered the danger zone! ! | ||
! Please pin the nf-schema version in your config! ! | ||
! Not pinning your version can't guarantee the reproducibility ! | ||
! and the functionality of this pipeline in the future ! | ||
! ! | ||
! plugins { ! | ||
! id "nf-schema@<version>" ! | ||
! } ! | ||
! ! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
""") | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters