Skip to content

fix(PDF): fix export to make pdf work#2648

Merged
LightOfHeaven1994 merged 1 commit into
RedHatInsights:masterfrom
LightOfHeaven1994:fix-exports-pdf
May 20, 2026
Merged

fix(PDF): fix export to make pdf work#2648
LightOfHeaven1994 merged 1 commit into
RedHatInsights:masterfrom
LightOfHeaven1994:fix-exports-pdf

Conversation

@LightOfHeaven1994
Copy link
Copy Markdown
Contributor

@LightOfHeaven1994 LightOfHeaven1994 commented May 20, 2026

wrong export affected dependency graph and as the result pdf export was failing with

[1] Error: Shared module react-router-dom doesn't exist in shared scope default

Summary by Sourcery

Centralize the vulnerability backend deployment name in a shared constants module and update reports to consume it from there.

Bug Fixes:

  • Fix PDF export failure caused by an incorrect export affecting the shared module dependency graph.

Enhancements:

  • Introduce a dedicated constants module for the vulnerability backend deployment name and reuse it across CVE report components.

@LightOfHeaven1994 LightOfHeaven1994 requested a review from a team as a code owner May 20, 2026 15:25
@LightOfHeaven1994 LightOfHeaven1994 self-assigned this May 20, 2026
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented May 20, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Centralizes the VULNERABILITY_BACKEND_DEPLOYMENT_NAME constant into a new shared constants module and updates existing imports so the PDF export’s module graph resolves correctly.

File-Level Changes

Change Details Files
Move VULNERABILITY_BACKEND_DEPLOYMENT_NAME to a dedicated constants module and update all consumers to import from it.
  • Remove the inline VULNERABILITY_BACKEND_DEPLOYMENT_NAME export from the CVEsReport helpers module.
  • Create a new constants module that exports VULNERABILITY_BACKEND_DEPLOYMENT_NAME with the same value and reference comment.
  • Update CVEsReport-related components to import VULNERABILITY_BACKEND_DEPLOYMENT_NAME from the new constants module instead of helpers.
src/Components/SmartComponents/Reports/CVEsReport/helpers.js
src/Components/SmartComponents/Reports/CVEsReport/CVEsReportFetch.js
src/Components/SmartComponents/Reports/CVEsReport/CVEsReportFetchTable.js
src/Components/SmartComponents/Reports/CVEsReport/constants.js

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

Copy link
Copy Markdown
Member

@bastilian bastilian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you @LightOfHeaven1994!

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="src/Components/SmartComponents/Reports/CVEsReport/constants.js" line_range="1" />
<code_context>
 import { fetchCVEs } from '../helpers';
-
-// selecting correct vulnerability-backend deployment name
-// https://github.com/RedHatInsights/vulnerability-engine/blob/master/deploy/clowdapp.yaml
-export const VULNERABILITY_BACKEND_DEPLOYMENT_NAME = 'manager-service';
+import { VULNERABILITY_BACKEND_DEPLOYMENT_NAME } from './constants';
</code_context>
<issue_to_address>
**issue (review_instructions):** This change introduces a new file, which violates the instruction to avoid file-level changes.

The review instructions explicitly say not to make file-level changes, but this PR adds a new `constants.js` file. If possible, the new constant should be placed into an existing file instead of creating a new one, or the change should be cleared with whoever provided the instructions.

<details>
<summary>Review instructions:</summary>

**Path patterns:** `*`

**Instructions:**
Do not generate any diagrams (class, ER, etc.) or file level changes

</details>
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread src/Components/SmartComponents/Reports/CVEsReport/constants.js
@LightOfHeaven1994 LightOfHeaven1994 enabled auto-merge (squash) May 20, 2026 15:27
@LightOfHeaven1994 LightOfHeaven1994 merged commit ddde63b into RedHatInsights:master May 20, 2026
9 checks passed
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.

2 participants