Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create GitHub workflow to act as PR watchdog; protect the release pipelines #145

Closed
kltm opened this issue Nov 19, 2019 · 3 comments · Fixed by #340
Closed

Create GitHub workflow to act as PR watchdog; protect the release pipelines #145

kltm opened this issue Nov 19, 2019 · 3 comments · Fixed by #340

Comments

@kltm
Copy link
Member

kltm commented Nov 19, 2019

In order to both better protect snapshot, release, and maybe master, we should create a .travis.yml that

  • checks to make sure that Jenkinsfile still has the verbatim watchdog block
  • performs similar checks to the current watchdog
  • does additional checks that should be easy in back or python, such as ensuring that Zenodo and AWS targets (all publication targets) do not seem coherent or do not exist; possibly enforce a rule such as "null"
@kltm
Copy link
Member Author

kltm commented Nov 19, 2019

This would improve the software and data developer experience by lowering the bar of knowledge needed to develop the pipeline.

In addition, we may want to also "lock down" the snapshot and release pipelines to just a few individuals.

@kltm kltm changed the title Create .travis.yml to act as PR watchdog to protect release pipeline Create .travis.yml to act as PR watchdog; protect the release pipelines Nov 19, 2019
@kltm
Copy link
Member Author

kltm commented Apr 3, 2020

New best way to do this:

A simple hard-coded paragraph check that the following text exists in the Jenkinsfile as an as-is template:

    stages {
	// Very first: pause for a few minutes to give a chance to
	// cancel and clean the workspace before use.
	stage('Ready and clean') {
	    steps {

		// Check that we do not affect public targets on
		// non-mainline runs.
		script {
		    if( BRANCH_NAME != 'master' && TARGET_BUCKET == 'go-data-product-experimental'){
			echo 'Only master can touch that target.'
			sh '`exit -1`'
		    }else if( BRANCH_NAME != 'snapshot' && TARGET_BUCKET == 'go-data-product-snapshot'){
			echo 'Only master can touch that target.'
			sh '`exit -1`'
		    }else if( BRANCH_NAME != 'release' && TARGET_BUCKET == 'go-data-product-release'){
			echo 'Only master can touch that target.'
			sh '`exit -1`'
		    }
		}

		// Give us a minute to cancel if we want.
		sleep time: 1, unit: 'MINUTES'
		cleanWs()
	    }
	}

The only way to bypass this would be by research and actively making code to undermine it.

@kltm kltm changed the title Create .travis.yml to act as PR watchdog; protect the release pipelines Create GitHub workflow to act as PR watchdog; protect the release pipelines Sep 27, 2023
@kltm
Copy link
Member Author

kltm commented Sep 27, 2023

Updated to reflect GH and lack of travis.

@kltm kltm closed this as completed in #340 Sep 27, 2023
kltm added a commit that referenced this issue Sep 27, 2023
fixes #145, add a GH action to check that watchdog code in Jenkinsfile is not bei…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
1 participant