Skip to content

Comments

FLPATH-2749 | Refactor the Plugin code based on new structure to cost-management#2341

Open
asmasarw wants to merge 1 commit intoredhat-developer:mainfrom
asmasarw:feature/cost-m
Open

FLPATH-2749 | Refactor the Plugin code based on new structure to cost-management#2341
asmasarw wants to merge 1 commit intoredhat-developer:mainfrom
asmasarw:feature/cost-m

Conversation

@asmasarw
Copy link
Contributor

@asmasarw asmasarw commented Feb 17, 2026

FLPATH-2749 | Refactor the Plugin code based on new structure to cost-management

@rhdh-gh-app
Copy link

rhdh-gh-app bot commented Feb 17, 2026

Missing Changesets

The following package(s) are changed by this PR but do not have a changeset:

  • @red-hat-developer-hub/plugin-redhat-resource-optimization-common
  • @red-hat-developer-hub/plugin-redhat-resource-optimization

See CONTRIBUTING.md for more information about how to add changesets.

Changed Packages

Package Name Package Path Changeset Bump Current Version
app workspaces/cost-management/packages/app none v0.0.5
backend workspaces/cost-management/packages/backend none v0.0.5
@red-hat-developer-hub/plugin-redhat-resource-optimization-backend workspaces/cost-management/plugins/redhat-resource-optimization-backend patch v2.0.2
@red-hat-developer-hub/plugin-redhat-resource-optimization-common workspaces/cost-management/plugins/redhat-resource-optimization-common none v2.0.1
@red-hat-developer-hub/plugin-redhat-resource-optimization workspaces/cost-management/plugins/redhat-resource-optimization none v2.0.1

@asmasarw asmasarw changed the title Modify Yaml files FLPATH-2749 | Refactor the Plugin code based on new structure to cost-management Feb 17, 2026
@asmasarw asmasarw requested review from a team as code owners February 17, 2026 10:46
Copy link
Member

@alizard0 alizard0 left a comment

Choose a reason for hiding this comment

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

Left some comments.

credentials: dangerously-allow-unauthenticated
resourceOptimization:
costManagement:
clientId: ${ROS_CLIENT_ID}
Copy link
Member

Choose a reason for hiding this comment

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

@asmasarw if it is called costManagement, why do we still have env variables with ROS_ shouldn't it be refactored too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

agree,
changed to CM_

const baseUrl =
configApi.getOptionalString('costManagementProxyBaseUrl') ??
configApi.getOptionalString(
'costManagement.costManagementProxyBaseUrl',
Copy link
Member

Choose a reason for hiding this comment

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

@asmasarw this seem to be a breaking change, you added a prefix.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was done by mistake, Reverted.
Thanks

'costManagement.costManagementProxyBaseUrl',
) ??
configApi.getOptionalString(
'costManagement.optimizationsBaseUrl',
Copy link
Member

Choose a reason for hiding this comment

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

@asmasarw here too, the prefix was added not refactored.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was done by mistake, Reverted.
Thanks


export interface Config {
resourceOptimization: {
costManagement: {
Copy link
Member

Choose a reason for hiding this comment

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

As I commented before, previously this was used without prefix, and after the refactor you introduced a prefix, is thsi expect? is this the config?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here the name is fine, but the nested values were incorrect.
Reverted.

* Override generated pluginId so discovery matches the backend plugin ID
* (OpenAPI info.title is set to 'cost-management' for the API name).
*/
setPluginIdValue(pluginIdFilePath, value) {
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need this? If this is a refactoring PR, why do we have new code. I don't understand why is this relevant and previously wasnt.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was done by mistake, Reverted.
Thanks

console.log('Setting pluginId to backend plugin ID for discovery');
tsSourceFileMutator.setPluginIdValue(
`${commonPackageDir}/src/generated/pluginId.ts`,
'redhat-resource-optimization',
Copy link
Member

Choose a reason for hiding this comment

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

redhat-resource-optimization?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was done by mistake, Reverted.

const result: any = [];

series.map((s, index) => {
series.forEach((s, index) => {
Copy link
Member

Choose a reason for hiding this comment

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

Why is that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a Sonar Qube Issue fixed here.
CI fail here, unless we're changing the map to forEach.

@sonarqubecloud
Copy link

@asmasarw asmasarw requested a review from alizard0 February 18, 2026 10:20
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