Skip to content

Updating PipelineJobResolver for type filter

Max Fan requested to merge 407277-undefined-method-deployment into master

What does this MR do and why?

Regression from when we switched to calling graphQL for failed traces.

The current graphQL endpoint returns both Ci::Builds and Ci::Bridge jobs. Because Ci::Bridge jobs should not be populated in the failed_jobs tab, we'll need someway to filter them out.

Database queries:

Since this job resolver is nested under pipeline, it will only be called in the context of a pipeline. (eg. pipeline.statuses_order_id_desc.with_type("Ci::Bridge"))

https://console.postgres.ai/gitlab/gitlab-production-ci/sessions/18244/commands/60289

Screenshots or screen recordings

Current State 1 (jobKind: BUILD filter). ---- THIS FIX WILL NOT BE IN THIS MR FOR BACKWARD COMPATIBILITY REASONS

  • This is to remove Ci::Bridge jobs from showing, as they do not have a trace or job log. The actual graphQL change will be in %16.1

image

Before the fix:

image

After the fix:

image

Current State 2 (retried: false filter)

  • This is to prevent duplicate jobs that have been retried

image

Before the fix:

image

After the fix:

image

How to set up and validate locally

  1. Set up a trigger job
trigger_job:
  stage: deploy
  trigger:
    strategy: depend
    include:
      - local: Child/child-pipeline.yml
  1. Have a simple child pipeline
stages:          # List of stages for jobs, and their order of execution
  - build
  - test
  - deploy

build-job:       # This job runs in the build stage, which runs first.
  stage: build
  script:
    - echo "CHILD Compiling the code..."
    - echo "CHILD Compile complete."
    - unknown_command

test-job...

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #407277 (closed)

Edited by Max Fan

Merge request reports