Does skipping everything else in a job skip deploy?

The title is the short version. Unless I’m missing something, overriding phases with skip prevented the deployment from happening. (Not sure which category is best to post here, but since my problem came about because of config imports, I’m putting under that.)

Context: I’m developing a tool to implement a complex Python release cycle based on Travis stages. I’ve been copying parts of this into projects ever since stages were released; the release of config imports allows me to keep all the fancy Travis stages is a single, unified location (yay! thanks!)

As I’ve been migrating my projects over to this, I recently made it so my imported config jobs skip everything except the phases are used in that stage. But when I did this, the deploy phase didn’t run.

The recycle cycle also includes a test deployment job (directly using twine in the script phase), so I know the credentials are working. It’s the final deployment job, which uses dpl, that didn’t work. And it didn’t even seem to download the stuff for dpl.

Here’s the relevant build: https://travis-ci.org/openpathsampling/openpathsampling/builds/624268394, particularly the deploy pypi job.

The possibilities I’ve thought of are:

  1. doing nothing looks like a job failure to deploy (but reports passing!)
  2. skipping something else (maybe after_script?) causes deploy to be skipped
  3. I found a bug

Maybe I’m missing something else? If it isn’t a bug, it would be really helpful if the docs at https://docs.travis-ci.com/user/job-lifecycle/ could be updated.

Thanks for the report. I don’t think we tested this use case, so it is quite possible that you’ve come across a bug.

Could you try not skipping after_success and see if that makes any difference? Something simple like: after_success: 'true' should be sufficient for testing my hypothesis.

1 Like

Yep, that seems to fix it! Different repo (did this on the new Autorelease tool itself; I found the problem on the project that is my most widely-used, so I didn’t spam users by cutting another release there.)

The one caveat is that the project where this works only does local config-imports (so it can test itself), instead of bringing in the configs from a github repo. But that’s the only uncontrolled variable I can think of, and you’ll know whether it matters.

Successful deployment: https://travis-ci.org/dwhswenson/autorelease/builds/624827334

According to https://github.com/travis-ci/travis-build/blob/master/lib/travis/build/addons/deploy.rb#L18, deploy: is implemented as a build addon which runs its functionality after after_success:’ payload.

So deployment is skipped if you skip after_success:.

Imprint