Skip to content

Qs#2643

Draft
adonispuente wants to merge 1 commit into
RedHatInsights:foreman-3.18from
adonispuente:qs
Draft

Qs#2643
adonispuente wants to merge 1 commit into
RedHatInsights:foreman-3.18from
adonispuente:qs

Conversation

@adonispuente

@adonispuente adonispuente commented May 19, 2026

Copy link
Copy Markdown
Contributor

Summary by Sourcery

Implement batched vulnerability export with parameter transformation and update build and pipeline configurations.

New Features:

  • Add batched CVE export support with configurable batch size and concurrent page fetching.

Enhancements:

  • Apply existing parameter transformation utilities to vulnerability export queries for consistency with other fetches.

Build:

  • Upgrade axios dependency and add p-all for handling concurrent batched requests.
  • Pin the qs package version via package.json overrides.

CI:

  • Run container image build-and-publish workflow on pull_request events and refine signing conditions.
  • Update Tekton PipelineRun definitions to use a newer shared docker-build-oci-ta pipeline version and add new IoP vulnerability frontend pipelines for Satellite 6.19 pull_request and push events.

@sourcery-ai

sourcery-ai Bot commented May 19, 2026

Copy link
Copy Markdown

Reviewer's Guide

Implements batched, concurrent export of CVE data with query param transformations, updates axios and introduces p-all, adjusts GitHub Actions and Tekton pipelines to build on pull requests and new Konflux pipeline versions, pins qs via overrides, and adds new IoP-specific Tekton pipelines for Satellite 6.19.

Sequence diagram for batched CVE export in useExport hook

sequenceDiagram
  participant Component
  participant useExport
  participant queryTotalBatched
  participant queryBatch
  participant queryPage
  participant axiosInstance
  participant downloadFile

  Component->>useExport: const exportFnc = useExport(params)
  Component->>useExport: exportFnc(format)
  activate useExport
  useExport->>queryTotalBatched: queryTotalBatched({report, data_format, params})
  activate queryTotalBatched
  queryTotalBatched->>queryPage: queryPage(1, params)
  activate queryPage
  queryPage->>axiosInstance: get(/vulnerabilities/cves, transformedParams)
  axiosInstance-->>queryPage: response(meta, data)
  deactivate queryPage
  queryTotalBatched-->>queryTotalBatched: total = meta.total_items
  alt [total > 0]
    queryTotalBatched->>queryBatch: queryBatch(total, params)
    activate queryBatch
    loop for each page
      queryBatch->>queryPage: queryPage(page, params)
      activate queryPage
      queryPage->>axiosInstance: get(/vulnerabilities/cves, transformedParams)
      axiosInstance-->>queryPage: response(data)
      deactivate queryPage
    end
    queryBatch-->>queryTotalBatched: batchedResponses
    deactivate queryBatch
  else [total == 0]
    queryTotalBatched-->>queryTotalBatched: results = []
  end
  queryTotalBatched-->>useExport: response (csv string or array)
  deactivate queryTotalBatched

  useExport-->>useExport: data = string or JSON.stringify(array)
  useExport->>downloadFile: downloadFile(data, filename, format)
  deactivate useExport
Loading

File-Level Changes

Change Details Files
Implement batched, concurrent CVE export with reusable query helpers and param transformations.
  • Refactored useExport hook to accept batchSize instead of limit/offset and to orchestrate paginated fetching of CVE data.
  • Introduced queryPage, queryBatch, and queryTotalBatched helpers using axiosInstance, p-all, and new transform* param utilities from Common.
  • Changed exportFnc to use batched query helper, support CSV vs JSON response shaping, and still download a timestamped CVE export file.
src/Components/SmartComponents/IoP/Hooks.js
Update dependencies to support new HTTP behavior and control qs version.
  • Bumped axios dependency from 1.10.0 to 1.15.0.
  • Added p-all dependency for controlling concurrency of multiple promises.
  • Pinned qs version to 6.14.1 via package.json overrides to force a specific transitive version.
package.json
package-lock.json
Adjust GitHub Actions container publish workflow to run on pull requests and clean up conditions.
  • Triggered container-publish workflow on pull_request events in addition to push to master.
  • Removed top-level job if condition limiting execution to push events so PRs run the build job.
  • Simplified cosign signing step condition to use github.event_name != 'pull_request' expression syntax without GitHub expression delimiters.
.github/workflows/container-publish.yaml
Align Tekton Konflux pipeline references to newer version and add IoP Satellite 6.19-specific pipelines.
  • Updated existing Tekton PipelineRun definitions to reference konflux-pipelines v1.66.0 docker-build-oci-ta pipeline.
  • Added new Tekton PipelineRun definitions for iop-vulnerability-frontend-sat-6-19 for both pull_request and push events on foreman-3.18, including build args, labels, hermetic build settings, and git auth workspace.
.tekton/vulnerability-ui-hermetic-pull-request.yaml
.tekton/vulnerability-ui-hermetic-push.yaml
.tekton/vulnerability-ui-pull-request.yaml
.tekton/vulnerability-ui-push.yaml
.tekton/iop-vulnerability-frontend-sat-6-19-pull-request.yaml
.tekton/iop-vulnerability-frontend-sat-6-19-push.yaml
Minor build tooling housekeeping.
  • Touched or updated build-tools and lockfile artifacts to align with new pipeline and dependency configuration.
build-tools

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@adonispuente adonispuente changed the base branch from master to foreman-3.18 May 19, 2026 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant