Skip to content

Remove promptMangement devFlag and move it to TP feature flag#6897

Open
divyanshiGupta wants to merge 1 commit intoopendatahub-io:mainfrom
divyanshiGupta:add-tp-ff
Open

Remove promptMangement devFlag and move it to TP feature flag#6897
divyanshiGupta wants to merge 1 commit intoopendatahub-io:mainfrom
divyanshiGupta:add-tp-ff

Conversation

@divyanshiGupta
Copy link
Contributor

@divyanshiGupta divyanshiGupta commented Mar 26, 2026

https://redhat.atlassian.net/browse/RHOAIENG-55013

Description

Removed devFlag and added TP feature flag for promptManagement

How Has This Been Tested?

Test Impact

Request review criteria:

Self checklist (all need to be checked):

  • The developer has manually tested the changes and verified that the changes work
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has added tests or explained why testing cannot be added (unit or cypress tests for related changes)
  • The code follows our Best Practices (React coding standards, PatternFly usage, performance considerations)

If you have UI changes:

  • Included any necessary screenshots or gifs if it was a UI change.
  • Included tags to the UX team if it was a UI/UX change.

After the PR is posted & before it merges:

  • The developer has tested their solution on a cluster by using the image produced by the PR to main

Summary by CodeRabbit

  • New Features

    • Added Prompt Management feature flag to dashboard configuration, enabling users to control this capability through dashboard settings.
  • Refactor

    • Updated Prompt Management feature flag gating mechanism to use standard feature flags instead of development flags for improved feature control and availability management.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 26, 2026

📝 Walkthrough

Walkthrough

A new promptManagement boolean feature flag is being introduced across the stack. The field is added to TypeScript type definitions in both backend and frontend layers, initialized with a default value of false in configuration constants and mock factories, added to the OpenDataHub Dashboard Config Custom Resource Definition schema, and wired into the UI extension layer. Additionally, the PROMPT_MANAGEMENT area extension is being switched from dev-flag gating (devFlags) to feature-flag gating (featureFlags).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Security considerations

No actionable security issues detected. The addition of a boolean configuration flag does not introduce new vulnerability classes. However, verify that:

  • The transition from devFlags to featureFlags gating for the PROMPT_MANAGEMENT extension correctly enforces intended access controls (confirm the feature flag is evaluated with appropriate authorization context)
  • Default-disabled state (false) is appropriate for production deployments; ensure no security-critical functionality depends on this flag being unconditionally enabled
  • The CRD field addition permits only boolean values and rejects malformed inputs (validate schema validation rules in the manifest)
🚥 Pre-merge checks | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title contains a typo: 'promptMangement' instead of 'promptManagement'. While it clearly describes the main change (moving a flag from devFlags to feature flags), the typo undermines clarity. Fix the typo: change 'promptMangement' to 'promptManagement' in the PR title for accuracy and professionalism.
Description check ⚠️ Warning The description is incomplete: no testing details provided, all self-checklist items remain unchecked, and 'How Has This Been Tested?' and 'Test Impact' sections are empty despite the template requirements. Complete the testing sections: document how changes were tested, check/uncheck all checklist items, and provide justification for why testing cannot be added if applicable.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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 and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
packages/gen-ai/frontend/src/odh/extensions.ts (1)

50-53: Add a regression test for the PROMPT_MANAGEMENT gate source change.

Line 52 changes this area to featureFlags, but there’s no accompanying coverage proving the area is gated by featureFlags.promptManagement (and not by devFlags.promptManagement). Add/adjust a unit test around area availability to lock this behavior.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/gen-ai/frontend/src/odh/extensions.ts` around lines 50 - 53, Add a
regression unit test that verifies the PROMPT_MANAGEMENT area is gated by
featureFlags.promptManagement (not devFlags.promptManagement): locate the area
definition using the PROMPT_MANAGEMENT constant (and related PLUGIN_GEN_AI) in
extensions.ts and write/modify an area-availability test (e.g., for the function
that computes available areas or gate evaluation) to assert that toggling
featureFlags.promptManagement enables/disables the area while toggling
devFlags.promptManagement has no effect; ensure the test covers both enabled and
disabled states so the change from devFlags to featureFlags is locked in.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@packages/gen-ai/frontend/src/odh/extensions.ts`:
- Around line 50-53: Add a regression unit test that verifies the
PROMPT_MANAGEMENT area is gated by featureFlags.promptManagement (not
devFlags.promptManagement): locate the area definition using the
PROMPT_MANAGEMENT constant (and related PLUGIN_GEN_AI) in extensions.ts and
write/modify an area-availability test (e.g., for the function that computes
available areas or gate evaluation) to assert that toggling
featureFlags.promptManagement enables/disables the area while toggling
devFlags.promptManagement has no effect; ensure the test covers both enabled and
disabled states so the change from devFlags to featureFlags is locked in.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 7f225630-ce1f-465f-984f-a4e0c5fc03c1

📥 Commits

Reviewing files that changed from the base of the PR and between 7a7e3b0 and 8ca4523.

📒 Files selected for processing (7)
  • backend/src/types.ts
  • backend/src/utils/constants.ts
  • frontend/src/__mocks__/mockDashboardConfig.ts
  • frontend/src/concepts/areas/const.ts
  • frontend/src/k8sTypes.ts
  • manifests/common/crd/odhdashboardconfigs.opendatahub.io.crd.yaml
  • packages/gen-ai/frontend/src/odh/extensions.ts

@codecov
Copy link

codecov bot commented Mar 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.16%. Comparing base (7a7e3b0) to head (8ca4523).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #6897      +/-   ##
==========================================
+ Coverage   64.09%   64.16%   +0.07%     
==========================================
  Files        2529     2523       -6     
  Lines       76692    76637      -55     
  Branches    19202    19189      -13     
==========================================
+ Hits        49152    49175      +23     
+ Misses      27540    27462      -78     
Files with missing lines Coverage Δ
backend/src/types.ts 100.00% <ø> (ø)
backend/src/utils/constants.ts 100.00% <ø> (ø)
frontend/src/concepts/areas/const.ts 100.00% <ø> (ø)
frontend/src/k8sTypes.ts 100.00% <ø> (ø)

... and 19 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7a7e3b0...8ca4523. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@divyanshiGupta
Copy link
Contributor Author

CI failure is not related to this PR.

@danpierce1
Copy link
Contributor

/lgtm

@danpierce1
Copy link
Contributor

/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 26, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: danpierce1
Once this PR has been reviewed and has the lgtm label, please assign danpierce1, emilys314, nickgagan for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:
  • OWNERS [danpierce1]

    Need more approvers for rest parts.

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@divyanshiGupta
Copy link
Contributor Author

This PR should be merged once complete prompt management feature is in

/hold

@openshift-ci openshift-ci bot added the do-not-merge/hold This PR is hold for some reason label Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants