Multi-project trigger job fails triggering "on_success" but works "manually"

I’m trying to trigger a pipeline from another project as described in docs but it fails with “Downstream project could not be found”.

When I make the job “manual” it works as expected but trying to trigger the job automatically “on_success” leads to the error message.

Here is the job definition:

variables:
    CURRENT_VERSION: 123

.template__only_release:
  rules:
    - if: !reference [.release_bumpversion_rules]
      when: on_success

.template__only_release_manual:
  rules:
    - if: !reference [.release_bumpversion_rules]
      allow_failure: true
      when: manual

upgrade-dev:
  stage: deploy
  extends: .template__only_release_manual  # this works but not with .template__only_release
  needs:
    - publish_docker_image
  variables:
    UPGRADE: "true"
    AUTOMERGE: "true"
    TARGET_VERSION: ${CURRENT_VERSION}
    CURRENT_COMMIT: ${CI_COMMIT_SHORT_SHA}
    TRIGGERED_BY: ${GITLAB_USER_LOGIN}
  trigger:
    project: my_group/devops/saas-deployment
    branch: main
    strategy: depend

So the moment I switch to .template__only_release, It no longer works.

Hi @viktor.danyliuk1

please always provide your GitLab version or if you are using GitLab.com.

I cannot replicate your issue on GitLab.com.

@balonik thanks for taking a look!

It’s gitlab.com with specific gitlab runner: 15.2.0

I see that a similar code works in another repo with no issues (but from a child pipeline), so I’m pretty confused.

Another difference is a workflow, not sure if it might be related. I have now both, manual and auto jobs defined like this but only auto job fails:

workflow:
  rules:
    - if: $CI_PIPELINE_SOURCE == "merge_request_event"
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
    - if: $CI_COMMIT_TAG
      when: never

variables:
    CURRENT_VERSION: 123

.template__only_release:
... the same
.template__only_release_manual:
... the same
upgrade-dev:
... the same

upgrade-dev auto:
  extends:
    - upgrade-dev auto
    - .template__only_release

Here is a screenshot:

What else could be related?

The thing is that the error doesn’t make any sense at all. It can find the project for manual job, but not for the other job?

This seems like something fishy is going on, raising a issue might be needed.

1 Like