Skip to content

Add provision to recipe parameters while enrolling applicaiton #1934

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

TimothyAsirJeyasing
Copy link
Contributor

Copy link
Contributor

openshift-ci bot commented Apr 3, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

Needs approval from an approver in each of these files:

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

@TimothyAsirJeyasing
Copy link
Contributor Author

Screenshot from 2025-04-02 17-43-27
Screenshot from 2025-04-02 13-47-44

@GowthamShanmugam
Copy link
Contributor

Screenshot from 2025-04-02 17-43-27 Screenshot from 2025-04-02 13-47-44

Is this design discussed with DR team? And how the user will know how to input string[] as a value?

@TimothyAsirJeyasing TimothyAsirJeyasing force-pushed the add-config-param-to-recipe branch 2 times, most recently from 7de232b to ea6b330 Compare April 22, 2025 08:27
@TimothyAsirJeyasing
Copy link
Contributor Author

image

@TimothyAsirJeyasing TimothyAsirJeyasing force-pushed the add-config-param-to-recipe branch 2 times, most recently from f7f2655 to 149bd07 Compare April 28, 2025 15:59
@GowthamShanmugam
Copy link
Contributor

Screenshot from 2025-04-02 17-43-27 Screenshot from 2025-04-02 13-47-44

@raghavendra-talur, as per this implementation, UI passes one value per key, is that ok, or will it create any problem?

@raghavendra-talur
Copy link

raghavendra-talur commented Apr 29, 2025

@raghavendra-talur, as per this implementation, UI passes one value per key, is that ok, or will it create any problem?

The params type is RecipeParameters map[string][]string
https://github.com/RamenDR/ramen/blob/734cba31cf6001cd4dd614b38b8ab0bdef0d9dd1/api/v1alpha1/volumereplicationgroup_types.go#L138

It needs to match this. We can ask the users to provide the list in comma separated way and put the values in the [].

@TimothyAsirJeyasing TimothyAsirJeyasing force-pushed the add-config-param-to-recipe branch from 149bd07 to 1f1025c Compare May 6, 2025 09:30
@TimothyAsirJeyasing
Copy link
Contributor Author

TimothyAsirJeyasing commented May 6, 2025

image
image

Copy link
Contributor

openshift-ci bot commented May 6, 2025

@TimothyAsirJeyasing: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/odf-console-e2e-aws 1f1025c link true /test odf-console-e2e-aws

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Comment on lines +39 to +45
export const formatRecipeParametersForDisplay = (
params: Record<string, string[]>
): string => {
return Object.entries(params || {})
.map(([key, values]) => `${key}: ${values.join(', ')}`)
.join('; ');
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
export const formatRecipeParametersForDisplay = (
params: Record<string, string[]>
): string => {
return Object.entries(params || {})
.map(([key, values]) => `${key}: ${values.join(', ')}`)
.join('; ');
};

Copy link
Contributor

Choose a reason for hiding this comment

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

It is for display only, let's keep it inside the review-step.tsx file.

@@ -37,6 +42,9 @@ export const Review: React.FC<ReviewProps> = ({ state }) => {
drPolicy.spec.schedulingInterval === '0m'
? REPLICATION_DISPLAY_TEXT(t).sync
: REPLICATION_DISPLAY_TEXT(t).async;
const displayRecipeParameters = formatRecipeParametersForDisplay(
convertToRecipeParameters(recipeParameters)
Copy link
Contributor

Choose a reason for hiding this comment

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

Here,
The parameters are already comma-separated strings,
convertToRecipeParameters is converting the parameter into a list, and formatRecipeParametersForDisplay is again converting it back to comma comma-separated string.

This looks redundant, I think only the whitespace trimming logic has to be common between these two functions.

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.

4 participants