Skip to content

feat(RHINENG-26171): add iop mode - #2102

Merged
adonispuente merged 2 commits into
RedHatInsights:foreman-3.16from
adonispuente:316iop
Jul 28, 2026
Merged

feat(RHINENG-26171): add iop mode#2102
adonispuente merged 2 commits into
RedHatInsights:foreman-3.16from
adonispuente:316iop

Conversation

@adonispuente

@adonispuente adonispuente commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

To test this PR, all you need to do:

Run npm i
export IOP_URL={current IOP instance, DM if you need a url} npm run start:proxy:iop
verify everything works as expected after navigating to iop.foo.redhat.com and logging in
Theres currently an issue where when trying to kill the applicaiton, it doesnt always kill webpack instances. If it hangs up, try
ps aux | grep webpack | grep -v grep
and then kill -9 whatever port is running

Theres a currently a PR in FEC to fix this: RedHatInsights/frontend-components#2397

Summary by Sourcery

Add support and documentation for running Advisor in IOP proxy mode.

New Features:

  • Introduce an npm script to run Advisor via an IOP-enabled frontend development proxy.

Enhancements:

  • Update frontend components configuration dependency to a newer version and align proxy configuration for IOP usage.

Build:

  • Add IOP-specific dev-proxy script wiring environment variables and custom routes configuration.

Documentation:

  • Document how to run Advisor in IOP mode via the frontend-development-proxy README section.

@adonispuente
adonispuente requested a review from a team as a code owner July 28, 2026 14:58
@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e336e300-3727-4060-8fc7-a5dfb7565254

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sourcery-ai

sourcery-ai Bot commented Jul 28, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adds an IOP development mode for Advisor, including a new IOP proxy start script, configuration updates, and documentation for running via the frontend-development-proxy, while updating frontend-components-config and wiring in custom IOP routes.

File-Level Changes

Change Details Files
Add IOP-specific start script and wiring for frontend-development-proxy IOP mode.
  • Introduce npm script to start Advisor with PROXY and IOP flags, HCC IOP environment variables, and custom routes configuration, delegating to fec dev-proxy with --iop.
  • Wire the IOP URL via HCC_ENV_URL and require IOP_URL to be set in the environment for the new script.
package.json
Document how to run Advisor in IOP mode using the new script and frontend-development-proxy.
  • Add README section describing IOP mode, linking to the frontend-development-proxy IOP instructions.
  • Document use of npm run start:proxy:iop and the requirement for IOP_URL.
README.md
Align webpack/fec configuration with newer frontend-components-config and module federation expectations.
  • Remove explicit webpack output.publicPath configuration in fec.config to rely on defaults provided by the updated frontend-components-config.
  • Update @redhat-cloud-services/frontend-components-config dev dependency to a newer version compatible with IOP / dev-proxy usage.
fec.config.js
package.json
package-lock.json
Introduce custom routes configuration for IOP proxy mode.
  • Add a custom_routes.json file to define application-specific routes used by the IOP dev proxy (exact routes should be reviewed in the diff).
custom_routes.json

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

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 9 security issues, 1 other issue, and left some high level feedback:

Security issues:

  • FSL-1.1-MIT: Open-source license could not be identified (link)
  • FSL-1.1-MIT: Open-source license could not be identified (link)
  • FSL-1.1-MIT: Open-source license could not be identified (link)
  • FSL-1.1-MIT: Open-source license could not be identified (link)
  • FSL-1.1-MIT: Open-source license could not be identified (link)
  • FSL-1.1-MIT: Open-source license could not be identified (link)
  • FSL-1.1-MIT: Open-source license could not be identified (link)
  • FSL-1.1-MIT: Open-source license could not be identified (link)
  • FSL-1.1-MIT: Open-source license could not be identified (link)

Fixed security issues:

General comments:

  • The new start:proxy:iop script relies on shell-specific syntax like $(pwd) and ${IOP_URL}, which may not work on non-POSIX environments (e.g., Windows); consider using a cross-platform approach (e.g., cross-env or a small Node script) to construct these values.
  • Since start:proxy:iop depends on IOP_URL being set, you might want to add a simple guard (e.g., in a wrapper script) that fails fast with a clear error message when IOP_URL is missing, to avoid confusing runtime failures.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The new `start:proxy:iop` script relies on shell-specific syntax like `$(pwd)` and `${IOP_URL}`, which may not work on non-POSIX environments (e.g., Windows); consider using a cross-platform approach (e.g., `cross-env` or a small Node script) to construct these values.
- Since `start:proxy:iop` depends on `IOP_URL` being set, you might want to add a simple guard (e.g., in a wrapper script) that fails fast with a clear error message when `IOP_URL` is missing, to avoid confusing runtime failures.

## Individual Comments

### Comment 1
<location path="package.json" line_range="22" />
<code_context>
     "server:ctr": "node src/server/generateServerKey.js",
     "start": "fec dev",
     "start:proxy": "PROXY=true fec dev",
+    "start:proxy:iop": "PROXY=true IOP=true HCC_ENV=iop HCC_ENV_URL=${IOP_URL} FEC_IOP_CUSTOM_ROUTES_PATH=$(pwd)/custom_routes.json fec dev-proxy --iop",
     "static": "fec static",
     "test": "jest --passWithNoTests",
</code_context>
<issue_to_address>
**suggestion:** Consider making the `start:proxy:iop` script more robust to shell differences and paths with spaces.

This command relies on POSIX syntax (`$(pwd)`, `${IOP_URL}`) and leaves `$(pwd)/custom_routes.json` unquoted, which can fail on Windows and in paths containing spaces. To make this more robust, either quote the path (e.g. `"FEC_IOP_CUSTOM_ROUTES_PATH=\"$(pwd)/custom_routes.json\""`) or move the path/ENV construction into a small Node script using `process.cwd()` so it’s platform‑agnostic.

Suggested implementation:

```
    "start:proxy": "PROXY=true fec dev",
    "start:proxy:iop": "node scripts/startProxyIop.js",
    "static": "fec static",

```

Create a new file `scripts/startProxyIop.js` (or adjust the path/name to match your repo conventions) with contents similar to:

```js
// scripts/startProxyIop.js
const { spawn } = require('child_process');
const path = require('path');

const env = {
  ...process.env,
  PROXY: 'true',
  IOP: 'true',
  HCC_ENV: 'iop',
  HCC_ENV_URL: process.env.IOP_URL,
  FEC_IOP_CUSTOM_ROUTES_PATH: path.join(process.cwd(), 'custom_routes.json'),
};

const child = spawn('fec', ['dev-proxy', '--iop'], {
  stdio: 'inherit',
  env,
  shell: process.platform === 'win32', // helps on Windows
});

child.on('exit', (code) => {
  process.exit(code ?? 0);
});
child.on('error', (err) => {
  console.error('Failed to start dev proxy:', err);
  process.exit(1);
});
```

This moves all POSIX-specific syntax into Node, uses `process.cwd()` for the path, and sets environment variables in a cross-platform way. If your project uses ES modules, adjust to `import` syntax and `type: "module"` accordingly.
</issue_to_address>

### Comment 2
<location path="package-lock.json" line_range="7323-7331" />
<code_context>

</code_context>
<issue_to_address>
**security (license/@sentry/cli):** FSL-1.1-MIT: Open-source license could not be identified

The obligations of the `FSL-1.1-MIT` license for this code could not be determined automatically. Unknown licenses may carry obligations or restrictions and should be reviewed manually to ensure compliance

*Source: trivy*
</issue_to_address>

### Comment 3
<location path="package-lock.json" line_range="7353-7360" />
<code_context>

</code_context>
<issue_to_address>
**security (license/@sentry/cli-darwin):** FSL-1.1-MIT: Open-source license could not be identified

The obligations of the `FSL-1.1-MIT` license for this code could not be determined automatically. Unknown licenses may carry obligations or restrictions and should be reviewed manually to ensure compliance

*Source: trivy*
</issue_to_address>

### Comment 4
<location path="package-lock.json" line_range="7366-7383" />
<code_context>

</code_context>
<issue_to_address>
**security (license/@sentry/cli-linux-arm):** FSL-1.1-MIT: Open-source license could not be identified

The obligations of the `FSL-1.1-MIT` license for this code could not be determined automatically. Unknown licenses may carry obligations or restrictions and should be reviewed manually to ensure compliance

*Source: trivy*
</issue_to_address>

### Comment 5
<location path="package-lock.json" line_range="7384-7401" />
<code_context>

</code_context>
<issue_to_address>
**security (license/@sentry/cli-linux-arm64):** FSL-1.1-MIT: Open-source license could not be identified

The obligations of the `FSL-1.1-MIT` license for this code could not be determined automatically. Unknown licenses may carry obligations or restrictions and should be reviewed manually to ensure compliance

*Source: trivy*
</issue_to_address>

### Comment 6
<location path="package-lock.json" line_range="7402-7420" />
<code_context>

</code_context>
<issue_to_address>
**security (license/@sentry/cli-linux-i686):** FSL-1.1-MIT: Open-source license could not be identified

The obligations of the `FSL-1.1-MIT` license for this code could not be determined automatically. Unknown licenses may carry obligations or restrictions and should be reviewed manually to ensure compliance

*Source: trivy*
</issue_to_address>

### Comment 7
<location path="package-lock.json" line_range="7421-7438" />
<code_context>

</code_context>
<issue_to_address>
**security (license/@sentry/cli-linux-x64):** FSL-1.1-MIT: Open-source license could not be identified

The obligations of the `FSL-1.1-MIT` license for this code could not be determined automatically. Unknown licenses may carry obligations or restrictions and should be reviewed manually to ensure compliance

*Source: trivy*
</issue_to_address>

### Comment 8
<location path="package-lock.json" line_range="7439-7454" />
<code_context>

</code_context>
<issue_to_address>
**security (license/@sentry/cli-win32-arm64):** FSL-1.1-MIT: Open-source license could not be identified

The obligations of the `FSL-1.1-MIT` license for this code could not be determined automatically. Unknown licenses may carry obligations or restrictions and should be reviewed manually to ensure compliance

*Source: trivy*
</issue_to_address>

### Comment 9
<location path="package-lock.json" line_range="7455-7466" />
<code_context>

</code_context>
<issue_to_address>
**security (license/@sentry/cli-win32-i686):** FSL-1.1-MIT: Open-source license could not be identified

The obligations of the `FSL-1.1-MIT` license for this code could not be determined automatically. Unknown licenses may carry obligations or restrictions and should be reviewed manually to ensure compliance

*Source: trivy*
</issue_to_address>

### Comment 10
<location path="package-lock.json" line_range="7472-7482" />
<code_context>

</code_context>
<issue_to_address>
**security (license/@sentry/cli-win32-x64):** FSL-1.1-MIT: Open-source license could not be identified

The obligations of the `FSL-1.1-MIT` license for this code could not be determined automatically. Unknown licenses may carry obligations or restrictions and should be reviewed manually to ensure compliance

*Source: trivy*
</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 package.json
Comment thread package-lock.json
Comment thread package-lock.json
Comment thread package-lock.json
Comment thread package-lock.json
Comment thread package-lock.json
Comment thread package-lock.json
Comment thread package-lock.json
Comment thread package-lock.json
Comment thread package-lock.json

@Fewwy Fewwy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@adonispuente

Copy link
Copy Markdown
Contributor Author

/retest

@adonispuente
adonispuente merged commit 121e983 into RedHatInsights:foreman-3.16 Jul 28, 2026
1 of 4 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