Skip to content

Change sort order of packages and packageFiles

- requested to merge 351632-fix-package-and-pipeline-order into master

What does this MR do and why?

Change sort order for packages and packageFiles so the corpus row shows the correct details. We want to show the data for the latest corpus. Notice that the ID is larger after the fix.

Note: the first is returning the latest package, since it seems to be the default sort order from backend

Fixes #351632 (closed)

Expected

Screen_Shot_2022-02-01_at_1.48.20_AM

Actual

Screen_Shot_2022-02-01_at_1.48.57_AM

How to set up and validate locally

  • From the gitlab repo open a rails console and enable the :corpus_management AND :corpus_management_ui feature flag
bundle exec rails c

then

[4] pry(main)> Feature.enable(:corpus_management)
[4] pry(main)> Feature.enable(:corpus_management_ui)

Navigate to as a maintainer:

http://172.16.123.1:3000/<group>/<project>/-/security/configuration/corpus_management

Demo

corpus_sort_order_demo

Fix

In ee/app/assets/javascripts/security_configuration/corpus_management/graphql/queries/get_corpuses.query.graphql

Change last to first

          packageFiles(last: 1) {
            nodes {
             ...
            }
          }
          pipelines(last: 1) {
            nodes {
              ...
            }
      packageFiles(first: 1) {
        nodes {
         ...
        }
      }
      pipelines(first: 1) {
        nodes {
          ...
        }
      }
Edited by -

Merge request reports