Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix (update_centreon_storage_logs): Rename $path variable (#4128) #4259

Merged
merged 1 commit into from
May 30, 2024

Conversation

callapa
Copy link
Contributor

@callapa callapa commented May 30, 2024

Description

Backport of #4128

@callapa callapa requested review from a team as code owners May 30, 2024 12:04
@callapa callapa changed the base branch from develop to release-24.05-next May 30, 2024 12:04
Copy link
Contributor

coderabbitai bot commented May 30, 2024

Warning

Review failed

Failed to post review comments.

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 536f7cb and 30bd9dd.

Files ignored due to path filters (9)
  • centreon/config/features.json is excluded by !**/*.json
  • centreon/cypress/visual-testing-snapshots/www/front_src/src/Dashboards/SingleInstancePage/Dashboard/AddEditWidget/WidgetProperties/Inputs/Resources/Resources.cypress.spec.tsx/Resources tree -- confirms that the 'Add Filter' button is disabled when the 'Service' type is selected.snap.png is excluded by !**/*.png, !**/*.png
  • centreon/cypress/visual-testing-snapshots/www/front_src/src/Dashboards/SingleInstancePage/Dashboard/AddEditWidget/WidgetProperties/Inputs/Resources/Resources.cypress.spec.tsx/Resources tree -- displays only the available resource types depending on the previous dataset Host Category.snap.png is excluded by !**/*.png, !**/*.png
  • centreon/cypress/visual-testing-snapshots/www/front_src/src/Dashboards/SingleInstancePage/Dashboard/AddEditWidget/WidgetProperties/Inputs/Resources/Resources.cypress.spec.tsx/Resources tree -- displays only the available resource types depending on the previous dataset Host Group.snap.png is excluded by !**/*.png, !**/*.png
  • centreon/cypress/visual-testing-snapshots/www/front_src/src/Dashboards/SingleInstancePage/Dashboard/AddEditWidget/WidgetProperties/Inputs/Resources/Resources.cypress.spec.tsx/Resources tree -- displays only the available resource types depending on the previous dataset Host.snap.png is excluded by !**/*.png, !**/*.png
  • centreon/cypress/visual-testing-snapshots/www/front_src/src/Dashboards/SingleInstancePage/Dashboard/AddEditWidget/WidgetProperties/Inputs/Resources/Resources.cypress.spec.tsx/Resources tree -- displays only the available resource types depending on the previous dataset Service Category.snap.png is excluded by !**/*.png, !**/*.png
  • centreon/cypress/visual-testing-snapshots/www/front_src/src/Dashboards/SingleInstancePage/Dashboard/AddEditWidget/WidgetProperties/Inputs/Resources/Resources.cypress.spec.tsx/Resources tree -- displays only the available resource types depending on the previous dataset Service Group.snap.png is excluded by !**/*.png, !**/*.png
  • centreon/cypress/visual-testing-snapshots/www/front_src/src/Dashboards/SingleInstancePage/Dashboard/AddEditWidget/WidgetProperties/Inputs/Resources/Resources.cypress.spec.tsx/Resources tree -- ensures that all resource types are available in the first line item of the dataset selection.snap.png is excluded by !**/*.png, !**/*.png
  • centreon/cypress/visual-testing-snapshots/www/front_src/src/Dashboards/SingleInstancePage/Dashboard/AddEditWidget/WidgetProperties/Inputs/Resources/Resources.cypress.spec.tsx/Resources tree -- removes all subsequent resource lines, if a resource type line in the middle of the tree is updated.snap.png is excluded by !**/*.png, !**/*.png
Files selected for processing (27)
  • .github/actions/cypress-e2e-testing/action.yml (1 hunks)
  • .github/actions/gherkin-lint/action.yml (1 hunks)
  • .github/actions/promote-to-stable/action.yml (3 hunks)
  • .github/actions/release/action.yml (2 hunks)
  • .github/actions/rpm-delivery/action.yml (1 hunks)
  • .github/docker/centreon-web/alma8/slim-configuration/include-path.txt (1 hunks)
  • .github/docker/centreon-web/alma9/slim-configuration/include-path.txt (1 hunks)
  • centreon/packages/js-config/cypress/e2e/plugins.ts (1 hunks)
  • centreon/tests/e2e/features/Api-Token/02-api-token-listing/index.ts (2 hunks)
  • centreon/tests/e2e/features/Api-Token/03-api-token-sorting/index.ts (2 hunks)
  • centreon/tests/e2e/features/Api-Token/04-api-token-delete/index.ts (2 hunks)
  • centreon/tests/e2e/features/Api-Token/06-api-token-filter/index.ts (2 hunks)
  • centreon/tests/e2e/features/Dashboards/06-dashboard-sharing.feature (1 hunks)
  • centreon/tests/e2e/features/Dashboards/06-dashboard-sharing/index.ts (1 hunks)
  • centreon/tests/e2e/features/Dashboards/09-widget-single-metric-configuration.feature (1 hunks)
  • centreon/tests/e2e/features/Dashboards/09-widget-single-metric-configuration/index.ts (1 hunks)
  • centreon/tests/e2e/features/Dashboards/13-dashboard-all-widgets/index.ts (1 hunks)
  • centreon/tests/e2e/features/Resources-Access-Management/commands.ts (2 hunks)
  • centreon/tests/e2e/support/e2e.ts (1 hunks)
  • centreon/tools/update_centreon_storage_logs.php (2 hunks)
  • centreon/www/front_src/src/App/useApp.ts (1 hunks)
  • centreon/www/front_src/src/Dashboards/SingleInstancePage/Dashboard/AddEditWidget/WidgetProperties/Inputs/Resources/Resources.cypress.spec.tsx (4 hunks)
  • centreon/www/front_src/src/Dashboards/SingleInstancePage/Dashboard/AddEditWidget/WidgetProperties/Inputs/Resources/Resources.tsx (6 hunks)
  • centreon/www/front_src/src/Dashboards/SingleInstancePage/Dashboard/AddEditWidget/WidgetProperties/Inputs/Resources/useResources.ts (9 hunks)
  • centreon/www/front_src/src/Main/Main.cypress.spec.tsx (1 hunks)
  • centreon/www/front_src/src/Main/Provider.tsx (2 hunks)
  • centreon/www/front_src/src/federatedModules/utils.ts (1 hunks)
Files not reviewed due to errors (3)
  • centreon/www/front_src/src/Main/Provider.tsx (no review received)
  • centreon/tests/e2e/features/Api-Token/04-api-token-delete/index.ts (no review received)
  • centreon/tests/e2e/features/Api-Token/03-api-token-sorting/index.ts (no review received)
Files skipped from review due to trivial changes (7)
  • .github/actions/gherkin-lint/action.yml
  • .github/docker/centreon-web/alma8/slim-configuration/include-path.txt
  • .github/docker/centreon-web/alma9/slim-configuration/include-path.txt
  • centreon/tests/e2e/features/Dashboards/06-dashboard-sharing.feature
  • centreon/tests/e2e/features/Dashboards/09-widget-single-metric-configuration.feature
  • centreon/tests/e2e/support/e2e.ts
  • centreon/www/front_src/src/Main/Main.cypress.spec.tsx
Additional context used
Biome
centreon/www/front_src/src/federatedModules/utils.ts

[error] 1-1: All these imports are only used as types.

centreon/tests/e2e/features/Resources-Access-Management/commands.ts

[error] 39-39: All exports are only types and should thus use export type.

centreon/www/front_src/src/Main/Provider.tsx

[error] 30-30: This hook does not specify all of its dependencies: basename


[error] 30-30: This hook does not specify all of its dependencies: pathStartsWithBasename

centreon/tests/e2e/features/Api-Token/04-api-token-delete/index.ts

[error] 20-22: Prefer for...of instead of forEach.


[error] 41-63: Prefer for...of instead of forEach.


[error] 1-2: Some named imports are only used as types.

centreon/tests/e2e/features/Api-Token/03-api-token-sorting/index.ts

[error] 17-19: Prefer for...of instead of forEach.


[error] 38-60: Prefer for...of instead of forEach.


[error] 1-2: Some named imports are only used as types.


[error] 80-80: This let declares a variable that is only assigned once.


[error] 81-81: This let declares a variable that is only assigned once.

centreon/tests/e2e/features/Api-Token/02-api-token-listing/index.ts

[error] 13-15: Prefer for...of instead of forEach.


[error] 43-43: Unexpected any. Specify a different type.


[error] 44-67: Prefer for...of instead of forEach.


[error] 80-80: Unexpected any. Specify a different type.


[error] 81-102: Prefer for...of instead of forEach.


[error] 1-2: Some named imports are only used as types.

centreon/www/front_src/src/App/useApp.ts

[error] 25-26: All these imports are only used as types.


[error] 92-92: This hook does not specify all of its dependencies: getAcl


[error] 92-92: This hook does not specify all of its dependencies: getNavigation


[error] 92-92: This hook does not specify all of its dependencies: setAcknowledgement


[error] 92-92: This hook does not specify all of its dependencies: setRefreshInterval


[error] 92-92: This hook does not specify all of its dependencies: setPlaformName


[error] 92-92: This hook does not specify all of its dependencies: setDowntime


[error] 92-92: This hook does not specify all of its dependencies: platformVersion


[error] 92-92: This hook does not specify all of its dependencies: setAcl


[error] 92-92: This hook does not specify all of its dependencies: logout


[error] 92-92: This hook does not specify all of its dependencies: getCustomPlatformRequest


[error] 92-92: This hook does not specify all of its dependencies: getParameters


[error] 105-105: Use Number.parseInt instead of the equivalent global.


[error] 114-114: Use Number.parseInt instead of the equivalent global.


[error] 157-157: This hook does not specify all of its dependencies: keepAlive

centreon/www/front_src/src/Dashboards/SingleInstancePage/Dashboard/AddEditWidget/WidgetProperties/Inputs/Resources/Resources.tsx

[error] 26-27: All these imports are only used as types.

centreon/tests/e2e/features/Api-Token/06-api-token-filter/index.ts

[error] 37-37: Template literals are preferred over string concatenation.


[error] 63-65: Prefer for...of instead of forEach.


[error] 84-106: Prefer for...of instead of forEach.


[error] 1-2: Some named imports are only used as types.


[error] 37-37: This let declares a variable that is only assigned once.


[error] 171-171: This let declares a variable that is only assigned once.

centreon/www/front_src/src/Dashboards/SingleInstancePage/Dashboard/AddEditWidget/WidgetProperties/Inputs/Resources/Resources.cypress.spec.tsx

[error] 22-23: All these imports are only used as types.

centreon/www/front_src/src/Dashboards/SingleInstancePage/Dashboard/AddEditWidget/WidgetProperties/Inputs/Resources/useResources.ts

[error] 1-1: Some named imports are only used as types.


[error] 18-19: Some named imports are only used as types.


[error] 21-27: Some named imports are only used as types.


[error] 140-140: This hook does not specify all of its dependencies: propertyName


[error] 140-140: This hook does not specify all of its dependencies: values


[error] 140-140: This hook specifies more dependencies than necessary: getDataProperty({ obj: values, propertyName })


[error] 145-145: This hook does not specify all of its dependencies: propertyName


[error] 145-145: This hook does not specify all of its dependencies: touched


[error] 145-145: This hook specifies more dependencies than necessary: getDataProperty({ obj: touched, propertyName })


[error] 294-294: This hook does not specify all of its dependencies: propertyName


[error] 294-294: This hook does not specify all of its dependencies: value


[error] 294-294: This hook specifies more dependencies than necessary: values.moduleName


[error] 294-294: This hook does not specify all of its dependencies: widgetProperties?.singleResourceSelection


[error] 294-294: This hook does not specify all of its dependencies: setFieldValue


[error] 294-294: This hook does not specify all of its dependencies: widgetProperties?.singleMetricSelection

centreon/tests/e2e/features/Dashboards/09-widget-single-metric-configuration/index.ts

[error] 219-219: Use Number.parseFloat instead of the equivalent global.

centreon/tests/e2e/features/Dashboards/13-dashboard-all-widgets/index.ts

[error] 77-77: Do not use template literals if interpolation and special-character handling are not needed.


[error] 173-173: Do not use template literals if interpolation and special-character handling are not needed.


[error] 177-177: Do not use template literals if interpolation and special-character handling are not needed.


[error] 370-370: This variable implicitly has the any type.


[error] 427-427: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.


[error] 438-438: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.


[error] 453-464: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.

centreon/tests/e2e/features/Dashboards/06-dashboard-sharing/index.ts

[error] 37-37: Do not use template literals if interpolation and special-character handling are not needed.


[error] 115-115: Do not use template literals if interpolation and special-character handling are not needed.


[error] 516-516: Do not use template literals if interpolation and special-character handling are not needed.

Additional comments not posted (16)
centreon/www/front_src/src/federatedModules/utils.ts (1)

17-17: Verify the intended behavior of the path replacement.

Verification successful

The functions getFederatedWidgetFolder and getFederatedModuleFolder both return paths that start with ./, ensuring that the scriptPath arguments passed to loadScript will start with a dot. Therefore, the replacement of the leading dot in scriptPath with centreonBaseURL in the loadScript function is consistent with the intended behavior.

  • getFederatedWidgetFolder returns ./widgets/${moduleName}/static
  • getFederatedModuleFolder returns ./modules/${moduleName}/static

This confirms that the scriptPath will always start with ./, making the replacement logic valid.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the usage of `scriptPath` in the `loadScript` function to ensure it starts with a dot.

# Test: Search for the usage of `loadScript` function. Expect: All `scriptPath` arguments start with a dot.
rg --type python $'loadScript'

Length of output: 60



Script:

#!/bin/bash
# Description: Verify the usage of `scriptPath` in the `loadScript` function to ensure it starts with a dot.

# Test: Search for the usage of `loadScript` function. Expect: All `scriptPath` arguments start with a dot.
rg --type typescript 'loadScript'

Length of output: 68



Script:

#!/bin/bash
# Description: Verify the usage of `scriptPath` in the `loadScript` function to ensure it starts with a dot.

# Test: Search for the usage of `loadScript` function. Expect: All `scriptPath` arguments start with a dot.
rg --type ts 'loadScript'

Length of output: 1442



Script:

#!/bin/bash
# Description: Verify the definitions of `getFederatedWidgetFolder` and `getFederatedModuleFolder` to ensure they return paths starting with a dot.

# Test: Search for the definitions of `getFederatedWidgetFolder` and `getFederatedModuleFolder`.
rg 'function getFederatedWidgetFolder' --type ts
rg 'function getFederatedModuleFolder' --type ts

Length of output: 101



Script:

#!/bin/bash
# Description: Trace the origins of `getFederatedWidgetFolder` and `getFederatedModuleFolder` by searching for their usage.

# Test: Search for the usage of `getFederatedWidgetFolder` and `getFederatedModuleFolder`.
rg 'getFederatedWidgetFolder' --type ts
rg 'getFederatedModuleFolder' --type ts

Length of output: 1066



Script:

#!/bin/bash
# Description: Extract the full definitions of `getFederatedWidgetFolder` and `getFederatedModuleFolder` to verify if they return paths starting with a dot.

# Extract the full definition of `getFederatedWidgetFolder`.
rg --multiline --multiline-dotall --type ts 'const getFederatedWidgetFolder = \(moduleName: string\): string => \{[^}]*\}' centreon/www/front_src/src/federatedModules/useFederatedWidgets.ts

# Extract the full definition of `getFederatedModuleFolder`.
rg --multiline --multiline-dotall --type ts 'export const getFederatedModuleFolder = \(moduleName: string\): string => \{[^}]*\}' centreon/www/front_src/src/federatedModules/useFederatedModules.ts

Length of output: 390



Script:

#!/bin/bash
# Description: Extract the full definitions of `getFederatedWidgetFolder` and `getFederatedModuleFolder` to verify if they return paths starting with a dot.

# Extract the full definition of `getFederatedWidgetFolder`.
rg --multiline --multiline-dotall --type ts 'const getFederatedWidgetFolder = \(moduleName: string\): string => \{[^}]*\}' centreon/www/front_src/src/federatedModules/useFederatedWidgets.ts -A 10

# Extract the full definition of `getFederatedModuleFolder`.
rg --multiline --multiline-dotall --type ts 'export const getFederatedModuleFolder = \(moduleName: string\): string => \{[^}]*\}' centreon/www/front_src/src/federatedModules/useFederatedModules.ts -A 10

Length of output: 402



Script:

#!/bin/bash
# Description: Extract the full definitions of `getFederatedWidgetFolder` and `getFederatedModuleFolder` to verify if they return paths starting with a dot.

# Extract the full definition of `getFederatedWidgetFolder`.
rg --multiline --multiline-dotall --type ts 'getFederatedWidgetFolder' centreon/www/front_src/src/federatedModules/useFederatedWidgets.ts -A 10

# Extract the full definition of `getFederatedModuleFolder`.
rg --multiline --multiline-dotall --type ts 'getFederatedModuleFolder' centreon/www/front_src/src/federatedModules/useFederatedModules.ts -A 10

Length of output: 2114

centreon/tests/e2e/features/Resources-Access-Management/commands.ts (2)

14-14: LGTM! Using shorthand property names enhances readability.


27-27: Ensure the sed command is correctly updating the configuration as intended.

Verification successful

The sed command in the enableResourcesAccessManagementFeature function correctly updates the resource_access_management value from 2 to 3 in the centreon/config/features.json file.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the `sed` command in `enableResourcesAccessManagementFeature` function updates the configuration correctly.

# Test: Check the `features.json` file before and after running the command. Expect: `resource_access_management` value changes from 2 to 3.
cat /usr/share/centreon/config/features.json

Length of output: 119



Script:

#!/bin/bash
# Description: Search for the `features.json` file in the repository to verify its existence and correct path.

# Search for the `features.json` file
fd features.json

Length of output: 82



Script:

#!/bin/bash
# Description: Verify the `sed` command in `enableResourcesAccessManagementFeature` function updates the configuration correctly.

# Check the contents of `centreon/config/features.json` before running the command
echo "Contents of centreon/config/features.json before running the sed command:"
cat centreon/config/features.json

# Run the sed command to update the configuration
sed -i 's/"resource_access_management": 2,/"resource_access_management": 3,/g' centreon/config/features.json

# Check the contents of `centreon/config/features.json` after running the command
echo "Contents of centreon/config/features.json after running the sed command:"
cat centreon/config/features.json

Length of output: 982

centreon/packages/js-config/cypress/e2e/plugins.ts (1)

31-31: Good addition! Setting the window size for all browsers ensures consistent test environments.

.github/actions/cypress-e2e-testing/action.yml (1)

70-70: Change from Chromium to Electron browser for Cypress tests.

Please ensure that all existing tests pass with Electron, as browser behavior differences might affect test outcomes.

centreon/tests/e2e/features/Api-Token/02-api-token-listing/index.ts (2)

36-40: Added checks for snackbar messages post-login.

Consider adding more specific assertions to verify the content of the snackbar messages, ensuring they match expected success or error notifications.


71-71: Improved navigation to the API tokens page by ensuring the page is refreshed correctly.

Good practice to ensure that stale data isn't shown to the user.

centreon/www/front_src/src/App/useApp.ts (1)

53-53: Added HTTP 403 to the list of status codes that bypass error snackbar notifications.

Consider adding a comment explaining why HTTP 403 errors are handled this way, to maintain clarity for future developers.

.github/actions/rpm-delivery/action.yml (1)

50-58: Added validation checks for required inputs module_name and distrib.

Consider enhancing the error messages to provide more details on how to resolve the configuration issues, such as expected input formats or examples.

centreon/www/front_src/src/Dashboards/SingleInstancePage/Dashboard/AddEditWidget/WidgetProperties/Inputs/Resources/Resources.tsx (1)

55-55: Improved handling of single resource selection in widget properties.

Ensure thorough testing of this change to verify that it interacts correctly with other UI components and does not introduce regressions.

.github/actions/promote-to-stable/action.yml (1)

119-123: Improved the promotion logic for Debian packages from testing to stable.

Consider adding more detailed logging to help troubleshoot issues during the promotion process, especially for cases where no source paths are found.

centreon/tests/e2e/features/Api-Token/06-api-token-filter/index.ts (2)

75-79: Correct handling of the snackbar message post-login.


111-111: Correct navigation to the API tokens page.

.github/actions/release/action.yml (1)

41-41: Correct handling of the RELEASE_CLOUD variable based on the branch name.

Also applies to: 48-48, 51-51

centreon/tools/update_centreon_storage_logs.php (1)

313-317: Variable renaming from $path to $pathDirectory improves clarity.

centreon/tests/e2e/features/Dashboards/06-dashboard-sharing/index.ts (1)

579-671: Commented out test scenarios related to dashboard sharing.

Comments failed to post (1)
centreon/www/front_src/src/Dashboards/SingleInstancePage/Dashboard/AddEditWidget/WidgetProperties/Inputs/Resources/Resources.cypress.spec.tsx

22-23: Mark imports used only as types to optimize the bundle size.

- import { Method, TestQueryProvider } from '@centreon/ui';
+ import type { Method, TestQueryProvider } from '@centreon/ui';

Committable suggestion was skipped due low confidence.

Walkthrough

This update involves several modifications across different areas of the project, including changes to GitHub Actions configurations, Cypress end-to-end testing adjustments, and updates to various frontend and backend scripts. Key changes include switching the browser for Cypress tests, updating input descriptions, adding validation checks, commenting out specific test scenarios, and refining resource management logic. These changes aim to enhance functionality, improve consistency, and ensure proper input validation.

Changes

File/Path Change Summary
.github/actions/cypress-e2e-testing/action.yml Switched Cypress browser from Chromium to Electron.
.github/actions/gherkin-lint/action.yml Updated description for features_path input to include quotes.
.github/actions/promote-to-stable/action.yml Introduced ROOT_REPO_PATH, modified SRC_PATHS and TARGET_PATH, refactored artifact search pattern.
.github/actions/release/action.yml Added and set RELEASE_CLOUD flag based on branch name for tag generation logic.
.github/actions/rpm-delivery/action.yml Added validation checks for module_name and distrib inputs.
.github/docker/centreon-web/alma8/slim-configuration/include-path.txt Changed path from /usr/lib64/perl5/vendor_perl to /usr/lib64/perl5.
.github/docker/centreon-web/alma9/slim-configuration/include-path.txt Changed path from /usr/lib64/perl5/vendor_perl to /usr/lib64/perl5.
centreon/packages/js-config/cypress/e2e/plugins.ts Included window size in Cypress launch options.
centreon/tests/e2e/features/Api-Token/... Added snackbar check after admin login, changed navigation to API tokens page.
centreon/tests/e2e/features/Dashboards/... Commented out scenarios related to user sharing and widget duplication.
centreon/tests/e2e/features/Resources-Access-Management/commands.ts Updated object property assignment for name, modified sed command for JSON file.
centreon/tests/e2e/support/e2e.ts Switched to single quotes for consistency, added error message checks in Cypress.on event handler.
centreon/tools/update_centreon_storage_logs.php Renamed variables in functions for clarity.
centreon/www/front_src/src/App/useApp.ts Added httpCodesBypassErrorSnackbar: [403] to getParameters request.
centreon/www/front_src/src/Dashboards/... Removed and refactored logic for button visibility and disabled states in Resources component.
centreon/www/front_src/src/Main/Main.cypress.spec.tsx Commented out test case for public page display, focused on login page.
centreon/www/front_src/src/Main/Provider.tsx Commented out PublicPagesManager component import and usage.
centreon/www/front_src/src/federatedModules/utils.ts Modified replacement of dot in scriptPath without adding slash before centreonBaseURL.

Poem

In the code's deep, where changes flow,
We switch from Chromium's bright glow,
To Electron's hum, a new test flight,
Ensuring our paths are just right.
With quotes around and checks so clear,
Our scripts now sing, no need to fear.
A rabbit's touch, in every line,
Our software shines, a work divine.

🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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.

Actionable comments posted: 1

Outside diff range and nitpick comments (11)
centreon/www/front_src/src/federatedModules/utils.ts (1)

Line range hint 1-1: Consider using type-only imports for unused runtime imports.

- import { createStore } from 'jotai';
- import { centreonBaseURL } from '@centreon/ui';
- import { additionalResourcesAtom } from '@centreon/ui-context';
+ import type { createStore } from 'jotai';
+ import type { centreonBaseURL } from '@centreon/ui';
+ import type { additionalResourcesAtom } from '@centreon/ui-context';
centreon/tests/e2e/features/Resources-Access-Management/commands.ts (1)

Line range hint 39-39: Use export type for exporting only types.

- export {};
+ export type {};
centreon/tests/e2e/features/Api-Token/06-api-token-filter/index.ts (2)

Line range hint 63-65: Replace forEach with for...of for better performance.

- Object.values(tokens).forEach((token) => {
+ for (const token of Object.values(tokens)) {

Line range hint 37-37: Use template literals for string concatenation.

- const daysToAddOrSubtract = durationMap[duration + ' ' + dayOrYear];
+ const daysToAddOrSubtract = durationMap[`${duration} ${dayOrYear}`];
centreon/www/front_src/src/Dashboards/SingleInstancePage/Dashboard/AddEditWidget/WidgetProperties/Inputs/Resources/useResources.ts (2)

Line range hint 1-1: Mark imports used only as types to optimize the bundle size.

- import { ChangeEvent, useEffect, useMemo } from 'react';
+ import type { ChangeEvent } from 'react';
+ import { useEffect, useMemo } from 'react';
- import { SelectEntry, buildListingEndpoint } from '@centreon/ui';
+ import type { SelectEntry } from '@centreon/ui';
+ import { buildListingEndpoint } from '@centreon/ui';
- import { additionalResourcesAtom } from '@centreon/ui-context';
+ import type { additionalResourcesAtom } from '@centreon/ui-context';

Also applies to: 18-19, 21-27


Line range hint 140-140: Add missing dependencies to useMemo and useEffect hooks to ensure correct reactivity.

- const value = useMemo<Array<WidgetDataResource> | undefined>(
+ const value = useMemo<Array<WidgetDataResource> | undefined>(() => getDataProperty({ obj: values, propertyName }), [values, propertyName]);
- const isTouched = useMemo<boolean | undefined>(
+ const isTouched = useMemo<boolean | undefined>(() => getDataProperty({ obj: touched, propertyName }), [touched, propertyName]);
- useEffect(() => {
+ useEffect(() => {
+   // Add all used state and props to the dependency array
+ }, [values, propertyName, widgetProperties?.singleResourceSelection, widgetProperties?.singleMetricSelection, setFieldValue]);

Also applies to: 145-145, 294-294

centreon/tests/e2e/features/Dashboards/09-widget-single-metric-configuration/index.ts (1)

Line range hint 219-219: Use Number.parseFloat instead of the global parseFloat for better clarity and consistency.

- if (parseFloat(text) !== 0) {
+ if (Number.parseFloat(text) !== 0) {
centreon/tests/e2e/features/Dashboards/13-dashboard-all-widgets/index.ts (4)

Line range hint 77-77: Avoid using template literals when not necessary.

- cy.getByLabel({ label: 'Edit dashboard', tag: 'button' }).click();
+ cy.getByLabel({ label: 'Edit dashboard', tag: 'button' }).click();

Line range hint 173-173: Avoid using template literals when not necessary.

- cy.getByLabel({ label: 'Add a widget' }).click();
+ cy.getByLabel({ label: 'Add a widget' }).click();
- cy.getByLabel({ label: 'Add a widget' }).click();
+ cy.getByLabel({ label: 'Add a widget' }).click();

Also applies to: 177-177


Line range hint 370-370: Declare the variable with a specific type to avoid implicit 'any'.

- let eqIndex;
+ let eqIndex: number | undefined;

Line range hint 427-427: Wrap the variable declaration in a block to restrict its scope within the switch case.

case 'single metric':
+ {
    let eqIndex = 0;
    break;
+ }
case 'metrics graph':
+ {
    let eqIndex = 1;
    break;
+ }
case 'top bottom':
+ {
    let eqIndex = 2;
    break;
+ }
case 'status grid':
+ {
    let eqIndex = 3;
    break;
+ }

Also applies to: 438-438, 453-464

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 536f7cb and 30bd9dd.

Files ignored due to path filters (9)
  • centreon/config/features.json is excluded by !**/*.json
  • centreon/cypress/visual-testing-snapshots/www/front_src/src/Dashboards/SingleInstancePage/Dashboard/AddEditWidget/WidgetProperties/Inputs/Resources/Resources.cypress.spec.tsx/Resources tree -- confirms that the 'Add Filter' button is disabled when the 'Service' type is selected.snap.png is excluded by !**/*.png, !**/*.png
  • centreon/cypress/visual-testing-snapshots/www/front_src/src/Dashboards/SingleInstancePage/Dashboard/AddEditWidget/WidgetProperties/Inputs/Resources/Resources.cypress.spec.tsx/Resources tree -- displays only the available resource types depending on the previous dataset Host Category.snap.png is excluded by !**/*.png, !**/*.png
  • centreon/cypress/visual-testing-snapshots/www/front_src/src/Dashboards/SingleInstancePage/Dashboard/AddEditWidget/WidgetProperties/Inputs/Resources/Resources.cypress.spec.tsx/Resources tree -- displays only the available resource types depending on the previous dataset Host Group.snap.png is excluded by !**/*.png, !**/*.png
  • centreon/cypress/visual-testing-snapshots/www/front_src/src/Dashboards/SingleInstancePage/Dashboard/AddEditWidget/WidgetProperties/Inputs/Resources/Resources.cypress.spec.tsx/Resources tree -- displays only the available resource types depending on the previous dataset Host.snap.png is excluded by !**/*.png, !**/*.png
  • centreon/cypress/visual-testing-snapshots/www/front_src/src/Dashboards/SingleInstancePage/Dashboard/AddEditWidget/WidgetProperties/Inputs/Resources/Resources.cypress.spec.tsx/Resources tree -- displays only the available resource types depending on the previous dataset Service Category.snap.png is excluded by !**/*.png, !**/*.png
  • centreon/cypress/visual-testing-snapshots/www/front_src/src/Dashboards/SingleInstancePage/Dashboard/AddEditWidget/WidgetProperties/Inputs/Resources/Resources.cypress.spec.tsx/Resources tree -- displays only the available resource types depending on the previous dataset Service Group.snap.png is excluded by !**/*.png, !**/*.png
  • centreon/cypress/visual-testing-snapshots/www/front_src/src/Dashboards/SingleInstancePage/Dashboard/AddEditWidget/WidgetProperties/Inputs/Resources/Resources.cypress.spec.tsx/Resources tree -- ensures that all resource types are available in the first line item of the dataset selection.snap.png is excluded by !**/*.png, !**/*.png
  • centreon/cypress/visual-testing-snapshots/www/front_src/src/Dashboards/SingleInstancePage/Dashboard/AddEditWidget/WidgetProperties/Inputs/Resources/Resources.cypress.spec.tsx/Resources tree -- removes all subsequent resource lines, if a resource type line in the middle of the tree is updated.snap.png is excluded by !**/*.png, !**/*.png
Files selected for processing (27)
  • .github/actions/cypress-e2e-testing/action.yml (1 hunks)
  • .github/actions/gherkin-lint/action.yml (1 hunks)
  • .github/actions/promote-to-stable/action.yml (3 hunks)
  • .github/actions/release/action.yml (2 hunks)
  • .github/actions/rpm-delivery/action.yml (1 hunks)
  • .github/docker/centreon-web/alma8/slim-configuration/include-path.txt (1 hunks)
  • .github/docker/centreon-web/alma9/slim-configuration/include-path.txt (1 hunks)
  • centreon/packages/js-config/cypress/e2e/plugins.ts (1 hunks)
  • centreon/tests/e2e/features/Api-Token/02-api-token-listing/index.ts (2 hunks)
  • centreon/tests/e2e/features/Api-Token/03-api-token-sorting/index.ts (2 hunks)
  • centreon/tests/e2e/features/Api-Token/04-api-token-delete/index.ts (2 hunks)
  • centreon/tests/e2e/features/Api-Token/06-api-token-filter/index.ts (2 hunks)
  • centreon/tests/e2e/features/Dashboards/06-dashboard-sharing.feature (1 hunks)
  • centreon/tests/e2e/features/Dashboards/06-dashboard-sharing/index.ts (1 hunks)
  • centreon/tests/e2e/features/Dashboards/09-widget-single-metric-configuration.feature (1 hunks)
  • centreon/tests/e2e/features/Dashboards/09-widget-single-metric-configuration/index.ts (1 hunks)
  • centreon/tests/e2e/features/Dashboards/13-dashboard-all-widgets/index.ts (1 hunks)
  • centreon/tests/e2e/features/Resources-Access-Management/commands.ts (2 hunks)
  • centreon/tests/e2e/support/e2e.ts (1 hunks)
  • centreon/tools/update_centreon_storage_logs.php (2 hunks)
  • centreon/www/front_src/src/App/useApp.ts (1 hunks)
  • centreon/www/front_src/src/Dashboards/SingleInstancePage/Dashboard/AddEditWidget/WidgetProperties/Inputs/Resources/Resources.cypress.spec.tsx (4 hunks)
  • centreon/www/front_src/src/Dashboards/SingleInstancePage/Dashboard/AddEditWidget/WidgetProperties/Inputs/Resources/Resources.tsx (6 hunks)
  • centreon/www/front_src/src/Dashboards/SingleInstancePage/Dashboard/AddEditWidget/WidgetProperties/Inputs/Resources/useResources.ts (9 hunks)
  • centreon/www/front_src/src/Main/Main.cypress.spec.tsx (1 hunks)
  • centreon/www/front_src/src/Main/Provider.tsx (2 hunks)
  • centreon/www/front_src/src/federatedModules/utils.ts (1 hunks)
Files not reviewed due to errors (3)
  • centreon/www/front_src/src/Main/Provider.tsx (no review received)
  • centreon/tests/e2e/features/Api-Token/04-api-token-delete/index.ts (no review received)
  • centreon/tests/e2e/features/Api-Token/03-api-token-sorting/index.ts (no review received)
Files skipped from review due to trivial changes (7)
  • .github/actions/gherkin-lint/action.yml
  • .github/docker/centreon-web/alma8/slim-configuration/include-path.txt
  • .github/docker/centreon-web/alma9/slim-configuration/include-path.txt
  • centreon/tests/e2e/features/Dashboards/06-dashboard-sharing.feature
  • centreon/tests/e2e/features/Dashboards/09-widget-single-metric-configuration.feature
  • centreon/tests/e2e/support/e2e.ts
  • centreon/www/front_src/src/Main/Main.cypress.spec.tsx
Additional context used
Biome
centreon/www/front_src/src/federatedModules/utils.ts

[error] 1-1: All these imports are only used as types.

centreon/tests/e2e/features/Resources-Access-Management/commands.ts

[error] 39-39: All exports are only types and should thus use export type.

centreon/www/front_src/src/Main/Provider.tsx

[error] 30-30: This hook does not specify all of its dependencies: basename


[error] 30-30: This hook does not specify all of its dependencies: pathStartsWithBasename

centreon/tests/e2e/features/Api-Token/04-api-token-delete/index.ts

[error] 20-22: Prefer for...of instead of forEach.


[error] 41-63: Prefer for...of instead of forEach.


[error] 1-2: Some named imports are only used as types.

centreon/tests/e2e/features/Api-Token/03-api-token-sorting/index.ts

[error] 17-19: Prefer for...of instead of forEach.


[error] 38-60: Prefer for...of instead of forEach.


[error] 1-2: Some named imports are only used as types.


[error] 80-80: This let declares a variable that is only assigned once.


[error] 81-81: This let declares a variable that is only assigned once.

centreon/tests/e2e/features/Api-Token/02-api-token-listing/index.ts

[error] 13-15: Prefer for...of instead of forEach.


[error] 43-43: Unexpected any. Specify a different type.


[error] 44-67: Prefer for...of instead of forEach.


[error] 80-80: Unexpected any. Specify a different type.


[error] 81-102: Prefer for...of instead of forEach.


[error] 1-2: Some named imports are only used as types.

centreon/www/front_src/src/App/useApp.ts

[error] 25-26: All these imports are only used as types.


[error] 92-92: This hook does not specify all of its dependencies: getAcl


[error] 92-92: This hook does not specify all of its dependencies: getNavigation


[error] 92-92: This hook does not specify all of its dependencies: setAcknowledgement


[error] 92-92: This hook does not specify all of its dependencies: setRefreshInterval


[error] 92-92: This hook does not specify all of its dependencies: setPlaformName


[error] 92-92: This hook does not specify all of its dependencies: setDowntime


[error] 92-92: This hook does not specify all of its dependencies: platformVersion


[error] 92-92: This hook does not specify all of its dependencies: setAcl


[error] 92-92: This hook does not specify all of its dependencies: logout


[error] 92-92: This hook does not specify all of its dependencies: getCustomPlatformRequest


[error] 92-92: This hook does not specify all of its dependencies: getParameters


[error] 105-105: Use Number.parseInt instead of the equivalent global.


[error] 114-114: Use Number.parseInt instead of the equivalent global.


[error] 157-157: This hook does not specify all of its dependencies: keepAlive

centreon/www/front_src/src/Dashboards/SingleInstancePage/Dashboard/AddEditWidget/WidgetProperties/Inputs/Resources/Resources.tsx

[error] 26-27: All these imports are only used as types.

centreon/tests/e2e/features/Api-Token/06-api-token-filter/index.ts

[error] 37-37: Template literals are preferred over string concatenation.


[error] 63-65: Prefer for...of instead of forEach.


[error] 84-106: Prefer for...of instead of forEach.


[error] 1-2: Some named imports are only used as types.


[error] 37-37: This let declares a variable that is only assigned once.


[error] 171-171: This let declares a variable that is only assigned once.

centreon/www/front_src/src/Dashboards/SingleInstancePage/Dashboard/AddEditWidget/WidgetProperties/Inputs/Resources/Resources.cypress.spec.tsx

[error] 22-23: All these imports are only used as types.

centreon/www/front_src/src/Dashboards/SingleInstancePage/Dashboard/AddEditWidget/WidgetProperties/Inputs/Resources/useResources.ts

[error] 1-1: Some named imports are only used as types.


[error] 18-19: Some named imports are only used as types.


[error] 21-27: Some named imports are only used as types.


[error] 140-140: This hook does not specify all of its dependencies: propertyName


[error] 140-140: This hook does not specify all of its dependencies: values


[error] 140-140: This hook specifies more dependencies than necessary: getDataProperty({ obj: values, propertyName })


[error] 145-145: This hook does not specify all of its dependencies: propertyName


[error] 145-145: This hook does not specify all of its dependencies: touched


[error] 145-145: This hook specifies more dependencies than necessary: getDataProperty({ obj: touched, propertyName })


[error] 294-294: This hook does not specify all of its dependencies: propertyName


[error] 294-294: This hook does not specify all of its dependencies: value


[error] 294-294: This hook specifies more dependencies than necessary: values.moduleName


[error] 294-294: This hook does not specify all of its dependencies: widgetProperties?.singleResourceSelection


[error] 294-294: This hook does not specify all of its dependencies: setFieldValue


[error] 294-294: This hook does not specify all of its dependencies: widgetProperties?.singleMetricSelection

centreon/tests/e2e/features/Dashboards/09-widget-single-metric-configuration/index.ts

[error] 219-219: Use Number.parseFloat instead of the equivalent global.

centreon/tests/e2e/features/Dashboards/13-dashboard-all-widgets/index.ts

[error] 77-77: Do not use template literals if interpolation and special-character handling are not needed.


[error] 173-173: Do not use template literals if interpolation and special-character handling are not needed.


[error] 177-177: Do not use template literals if interpolation and special-character handling are not needed.


[error] 370-370: This variable implicitly has the any type.


[error] 427-427: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.


[error] 438-438: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.


[error] 453-464: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.

centreon/tests/e2e/features/Dashboards/06-dashboard-sharing/index.ts

[error] 37-37: Do not use template literals if interpolation and special-character handling are not needed.


[error] 115-115: Do not use template literals if interpolation and special-character handling are not needed.


[error] 516-516: Do not use template literals if interpolation and special-character handling are not needed.

Additional comments not posted (16)
centreon/www/front_src/src/federatedModules/utils.ts (1)

17-17: Verify the intended behavior of the path replacement.

Verification successful

The functions getFederatedWidgetFolder and getFederatedModuleFolder both return paths that start with ./, ensuring that the scriptPath arguments passed to loadScript will start with a dot. Therefore, the replacement of the leading dot in scriptPath with centreonBaseURL in the loadScript function is consistent with the intended behavior.

  • getFederatedWidgetFolder returns ./widgets/${moduleName}/static
  • getFederatedModuleFolder returns ./modules/${moduleName}/static

This confirms that the scriptPath will always start with ./, making the replacement logic valid.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the usage of `scriptPath` in the `loadScript` function to ensure it starts with a dot.

# Test: Search for the usage of `loadScript` function. Expect: All `scriptPath` arguments start with a dot.
rg --type python $'loadScript'

Length of output: 60



Script:

#!/bin/bash
# Description: Verify the usage of `scriptPath` in the `loadScript` function to ensure it starts with a dot.

# Test: Search for the usage of `loadScript` function. Expect: All `scriptPath` arguments start with a dot.
rg --type typescript 'loadScript'

Length of output: 68



Script:

#!/bin/bash
# Description: Verify the usage of `scriptPath` in the `loadScript` function to ensure it starts with a dot.

# Test: Search for the usage of `loadScript` function. Expect: All `scriptPath` arguments start with a dot.
rg --type ts 'loadScript'

Length of output: 1442



Script:

#!/bin/bash
# Description: Verify the definitions of `getFederatedWidgetFolder` and `getFederatedModuleFolder` to ensure they return paths starting with a dot.

# Test: Search for the definitions of `getFederatedWidgetFolder` and `getFederatedModuleFolder`.
rg 'function getFederatedWidgetFolder' --type ts
rg 'function getFederatedModuleFolder' --type ts

Length of output: 101



Script:

#!/bin/bash
# Description: Trace the origins of `getFederatedWidgetFolder` and `getFederatedModuleFolder` by searching for their usage.

# Test: Search for the usage of `getFederatedWidgetFolder` and `getFederatedModuleFolder`.
rg 'getFederatedWidgetFolder' --type ts
rg 'getFederatedModuleFolder' --type ts

Length of output: 1066



Script:

#!/bin/bash
# Description: Extract the full definitions of `getFederatedWidgetFolder` and `getFederatedModuleFolder` to verify if they return paths starting with a dot.

# Extract the full definition of `getFederatedWidgetFolder`.
rg --multiline --multiline-dotall --type ts 'const getFederatedWidgetFolder = \(moduleName: string\): string => \{[^}]*\}' centreon/www/front_src/src/federatedModules/useFederatedWidgets.ts

# Extract the full definition of `getFederatedModuleFolder`.
rg --multiline --multiline-dotall --type ts 'export const getFederatedModuleFolder = \(moduleName: string\): string => \{[^}]*\}' centreon/www/front_src/src/federatedModules/useFederatedModules.ts

Length of output: 390



Script:

#!/bin/bash
# Description: Extract the full definitions of `getFederatedWidgetFolder` and `getFederatedModuleFolder` to verify if they return paths starting with a dot.

# Extract the full definition of `getFederatedWidgetFolder`.
rg --multiline --multiline-dotall --type ts 'const getFederatedWidgetFolder = \(moduleName: string\): string => \{[^}]*\}' centreon/www/front_src/src/federatedModules/useFederatedWidgets.ts -A 10

# Extract the full definition of `getFederatedModuleFolder`.
rg --multiline --multiline-dotall --type ts 'export const getFederatedModuleFolder = \(moduleName: string\): string => \{[^}]*\}' centreon/www/front_src/src/federatedModules/useFederatedModules.ts -A 10

Length of output: 402



Script:

#!/bin/bash
# Description: Extract the full definitions of `getFederatedWidgetFolder` and `getFederatedModuleFolder` to verify if they return paths starting with a dot.

# Extract the full definition of `getFederatedWidgetFolder`.
rg --multiline --multiline-dotall --type ts 'getFederatedWidgetFolder' centreon/www/front_src/src/federatedModules/useFederatedWidgets.ts -A 10

# Extract the full definition of `getFederatedModuleFolder`.
rg --multiline --multiline-dotall --type ts 'getFederatedModuleFolder' centreon/www/front_src/src/federatedModules/useFederatedModules.ts -A 10

Length of output: 2114

centreon/tests/e2e/features/Resources-Access-Management/commands.ts (2)

14-14: LGTM! Using shorthand property names enhances readability.


27-27: Ensure the sed command is correctly updating the configuration as intended.

Verification successful

The sed command in the enableResourcesAccessManagementFeature function correctly updates the resource_access_management value from 2 to 3 in the centreon/config/features.json file.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the `sed` command in `enableResourcesAccessManagementFeature` function updates the configuration correctly.

# Test: Check the `features.json` file before and after running the command. Expect: `resource_access_management` value changes from 2 to 3.
cat /usr/share/centreon/config/features.json

Length of output: 119



Script:

#!/bin/bash
# Description: Search for the `features.json` file in the repository to verify its existence and correct path.

# Search for the `features.json` file
fd features.json

Length of output: 82



Script:

#!/bin/bash
# Description: Verify the `sed` command in `enableResourcesAccessManagementFeature` function updates the configuration correctly.

# Check the contents of `centreon/config/features.json` before running the command
echo "Contents of centreon/config/features.json before running the sed command:"
cat centreon/config/features.json

# Run the sed command to update the configuration
sed -i 's/"resource_access_management": 2,/"resource_access_management": 3,/g' centreon/config/features.json

# Check the contents of `centreon/config/features.json` after running the command
echo "Contents of centreon/config/features.json after running the sed command:"
cat centreon/config/features.json

Length of output: 982

centreon/packages/js-config/cypress/e2e/plugins.ts (1)

31-31: Good addition! Setting the window size for all browsers ensures consistent test environments.

.github/actions/cypress-e2e-testing/action.yml (1)

70-70: Change from Chromium to Electron browser for Cypress tests.

Please ensure that all existing tests pass with Electron, as browser behavior differences might affect test outcomes.

centreon/tests/e2e/features/Api-Token/02-api-token-listing/index.ts (2)

36-40: Added checks for snackbar messages post-login.

Consider adding more specific assertions to verify the content of the snackbar messages, ensuring they match expected success or error notifications.


71-71: Improved navigation to the API tokens page by ensuring the page is refreshed correctly.

Good practice to ensure that stale data isn't shown to the user.

centreon/www/front_src/src/App/useApp.ts (1)

53-53: Added HTTP 403 to the list of status codes that bypass error snackbar notifications.

Consider adding a comment explaining why HTTP 403 errors are handled this way, to maintain clarity for future developers.

.github/actions/rpm-delivery/action.yml (1)

50-58: Added validation checks for required inputs module_name and distrib.

Consider enhancing the error messages to provide more details on how to resolve the configuration issues, such as expected input formats or examples.

centreon/www/front_src/src/Dashboards/SingleInstancePage/Dashboard/AddEditWidget/WidgetProperties/Inputs/Resources/Resources.tsx (1)

55-55: Improved handling of single resource selection in widget properties.

Ensure thorough testing of this change to verify that it interacts correctly with other UI components and does not introduce regressions.

.github/actions/promote-to-stable/action.yml (1)

119-123: Improved the promotion logic for Debian packages from testing to stable.

Consider adding more detailed logging to help troubleshoot issues during the promotion process, especially for cases where no source paths are found.

centreon/tests/e2e/features/Api-Token/06-api-token-filter/index.ts (2)

75-79: Correct handling of the snackbar message post-login.


111-111: Correct navigation to the API tokens page.

.github/actions/release/action.yml (1)

41-41: Correct handling of the RELEASE_CLOUD variable based on the branch name.

Also applies to: 48-48, 51-51

centreon/tools/update_centreon_storage_logs.php (1)

313-317: Variable renaming from $path to $pathDirectory improves clarity.

centreon/tests/e2e/features/Dashboards/06-dashboard-sharing/index.ts (1)

579-671: Commented out test scenarios related to dashboard sharing.

quborg
quborg previously approved these changes May 30, 2024
@callapa callapa changed the base branch from release-24.05-next to develop May 30, 2024 14:52
@callapa callapa dismissed quborg’s stale review May 30, 2024 14:52

The base branch was changed.

@callapa callapa changed the base branch from develop to release-24.05-next May 30, 2024 14:52
@pkippes pkippes merged commit 1ed5494 into release-24.05-next May 30, 2024
292 of 296 checks passed
@pkippes pkippes deleted the MON-95577 branch May 30, 2024 15:38
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.

None yet

3 participants