Skip to content

Revert usage of withArtifacts filter

Miranda Fluharty requested to merge 382074-revert-filter-usage into master

What does this MR do and why?

This page is behind the artifacts_management_page feature flag.

This MR undoes some of what !104304 (merged) did: it removes withArtifacts: true from the GraphQL query that gets the list of jobs to show on the artifacts page, which means that all jobs will be shown in the list (instead of only jobs that have >0 artifacts).

Why? Because this query needs more optimization before we can use it safely for projects with high job/artifact counts (the query times out and gives an error for the GitLab project, for example), see this thread in the issue for details: #382074 (comment 1209912062)

Screenshots or screen recordings

before after
for large job/artifact counts "Request timed out. Please try a less complex query or a smaller set of records." Screen_Shot_2022-11-28_at_17.11.56 all jobs are shown
for small job/artifact counts Screen_Shot_2022-11-28_at_17.33.37 only jobs that have artifacts are shown Screen_Shot_2022-11-28_at_17.11.56 all jobs are shown

How to set up and validate locally

  1. echo "Feature.enable(:artifacts_management_page)" | bundle exec rails console
  2. git checkout 382074-revert-filter-usage
  3. find/make/import a project with a pipeline with a job that generates artifacts
you can use this CI yaml to generate some sample artifacts:
# .gitlab-ci.yml

potato:
  stage: build
  script:
    - echo 'potato' >> potato.txt
  artifacts:
    expose_as: 'potato'
    paths: ['potato.txt']

tomato:
  stage: build
  script:
    - echo 'tomato' >> tomato.txt
  artifacts:
    expose_as: 'tomato'
    paths: ['tomato.txt']

pineapple:
  stage: build
  script:
    - echo 'pineapple' >> pineapple.txt
  artifacts:
    expose_as: 'pineapple'
    paths: ['pineapple.txt']

apple:
  stage: build
  script:
    - echo 'apple' >> apple.txt
  artifacts:
    expose_as: 'apple'
    paths: ['apple.txt']

toblerone:
  stage: build
  script:
    - echo 'toblerone' >> toblerone.txt
  artifacts:
    expose_as: 'toblerone'
    paths: ['toblerone.txt']
  1. run a pipeline for that project - for this you'll need to set up a local runner for GDK or enable runners in gitpod
  2. navigate to the project, and in the sidebar select CI/CD => Artifacts
  3. all jobs (even those with 0 artifacts) should be shown in the list

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 #382074 (closed)

Edited by Miranda Fluharty

Merge request reports