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: set eval version for workflows artefact #34197

Merged
merged 5 commits into from
Jun 12, 2024

Conversation

ayushpahwa
Copy link
Contributor

@ayushpahwa ayushpahwa commented Jun 12, 2024

Description

Eval version 2 is used to properly handle the escape characters like \n etc in the eval flow. If not set, it is defaulting to behaviour for eval version 1. This PR introduces the type fixes to allow for eval version to be set via the API. The main change is in the EE PR and this PR is to update the type.

Fixes #34171

Automation

/test sanity

🔍 Cypress test results

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/9478023950
Commit: c5edfb3
Cypress dashboard url: Click here!

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

Summary by CodeRabbit

  • Refactor
    • Consolidated EvaluationVersion type imports to a single source for improved maintainability.
    • Promoted DEFAULT_EVALUATION_VERSION to be exportable for broader use across the application.

Copy link
Contributor

coderabbitai bot commented Jun 12, 2024

Walkthrough

The changes primarily involve consolidating the EvaluationVersion type definition into a single source (constants/EvalConstants). This ensures consistency across various files where EvaluationVersion is used. Additionally, the DEFAULT_EVALUATION_VERSION is now exported for broader accessibility.

Changes

File Path Change Summary
app/client/src/ce/constants/WorkflowConstants.ts Added evaluationVersion field to Workflow interface and imported EvaluationVersion from constants/EvalConstants.
app/client/src/ce/api/ApplicationApi.tsx Updated EvaluationVersion type import to constants/EvalConstants instead of declaring it directly.
app/client/src/ce/constants/ReduxActionConstants.tsx Changed EvaluationVersion import source from @appsmith/api/ApplicationApi to constants/EvalConstants.
app/client/src/ce/selectors/applicationSelectors.tsx Promoted DEFAULT_EVALUATION_VERSION to be exported.
app/client/src/ce/workers/Evaluation/Actions.ts Updated EvaluationVersion import from @appsmith/api/ApplicationApi to constants/EvalConstants.
app/client/src/constants/EvalConstants.ts Introduced EvaluationVersion type and set DEFAULT_EVALUATION_VERSION to 2.
app/client/src/ee/configs/index.ts Updated EvaluationVersion import from @appsmith/api/ApplicationApi to constants/EvalConstants.
app/client/src/sagas/EvaluationsSaga.ts Changed EvaluationVersion import path from @appsmith/api/ApplicationApi to constants/EvalConstants.

Assessment against linked issues

Objective Addressed Explanation
Ensure consistent definition and usage of EvaluationVersion type across the codebase (#34171)
Address the evaluation failure when adding \n to workflow code (#34171) The changes focus on type consistency, not directly addressing the evaluation failure issue.

Poem

In the code where constants lie,
A version unified, oh my!
From EvalConstants they all derive,
Ensuring workflows smoothly thrive.
Bugs and errors, we bid goodbye,
With changes neat, our code will fly! 🚀

Warning

Review ran into problems

Problems (1)
  • Git: Failed to clone repository. Please contact CodeRabbit support.

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.

@github-actions github-actions bot added Bug Something isn't working Critical This issue needs immediate attention. Drop everything else Needs Triaging Needs attention from maintainers to triage Production Release Blocker This issue must be resolved before the release Workflows Workflows Pod For all issues related to the Workflows feature labels Jun 12, 2024
@ayushpahwa ayushpahwa added the ok-to-test Required label for CI label Jun 12, 2024
@github-actions github-actions bot added Bug Something isn't working and removed Bug Something isn't working labels Jun 12, 2024
@ayushpahwa ayushpahwa changed the title update: set eval version for workflows artefact fix: set eval version for workflows artefact Jun 12, 2024
@github-actions github-actions bot added Bug Something isn't working and removed Bug Something isn't working labels Jun 12, 2024
Copy link

⚠️ Cyclic Dependency Check:

This PR has increased the number of cyclic dependencies by 1, when compared with the release branch.

Refer this document to identify the cyclic dependencies introduced by this PR.

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: 0

Outside diff range and nitpick comments (3)
app/client/src/ce/constants/WorkflowConstants.ts (1)

1-1: The addition of evaluationVersion to the Workflow interface is well-implemented and aligns with the PR's objectives to handle different evaluation versions.

Consider adding a comment above the evaluationVersion field to explain its purpose and usage, enhancing maintainability.

Also applies to: 19-19

app/client/src/ce/selectors/applicationSelectors.tsx (2)

Line range hint 79-84: Consider removing the unnecessary else clause to simplify the code.

-    } else if (
+    if (

Line range hint 165-167: Consider removing the unnecessary else clause to simplify the code.

-    } else {
+    {
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between f19530d and 8e56cef.

Files selected for processing (2)
  • app/client/src/ce/constants/WorkflowConstants.ts (2 hunks)
  • app/client/src/ce/selectors/applicationSelectors.tsx (1 hunks)
Additional context used
Biome
app/client/src/ce/selectors/applicationSelectors.tsx

[error] 79-84: This else clause can be omitted because previous branches break early. (lint/style/noUselessElse)

Unsafe fix: Omit the else clause.


[error] 165-167: This else clause can be omitted because previous branches break early. (lint/style/noUselessElse)

Unsafe fix: Omit the else clause.

Additional comments not posted (2)
app/client/src/ce/selectors/applicationSelectors.tsx (2)

181-181: Exporting DEFAULT_EVALUATION_VERSION is a good practice as it ensures consistency across the application when referencing the default evaluation version.


181-181: The selectEvaluationVersion selector is well-implemented, providing a sensible default if the evaluationVersion is not set. This enhances robustness by preventing potential runtime errors.

Copy link

⚠️ Cyclic Dependency Check:

This PR has increased the number of cyclic dependencies by 1, when compared with the release branch.

Refer this document to identify the cyclic dependencies introduced by this PR.

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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 8e56cef and 791b045.

Files selected for processing (1)
  • app/client/src/ce/constants/WorkflowConstants.ts (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • app/client/src/ce/constants/WorkflowConstants.ts

rajatagrawal
rajatagrawal previously approved these changes Jun 12, 2024
@ayushpahwa ayushpahwa added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Jun 12, 2024
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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 791b045 and c5edfb3.

Files selected for processing (8)
  • app/client/src/ce/api/ApplicationApi.tsx (1 hunks)
  • app/client/src/ce/constants/ReduxActionConstants.tsx (2 hunks)
  • app/client/src/ce/constants/WorkflowConstants.ts (2 hunks)
  • app/client/src/ce/selectors/applicationSelectors.tsx (2 hunks)
  • app/client/src/ce/workers/Evaluation/Actions.ts (1 hunks)
  • app/client/src/constants/EvalConstants.ts (1 hunks)
  • app/client/src/ee/configs/index.ts (1 hunks)
  • app/client/src/sagas/EvaluationsSaga.ts (1 hunks)
Files skipped from review due to trivial changes (1)
  • app/client/src/constants/EvalConstants.ts
Files skipped from review as they are similar to previous changes (2)
  • app/client/src/ce/constants/WorkflowConstants.ts
  • app/client/src/ce/selectors/applicationSelectors.tsx
Additional comments not posted (5)
app/client/src/ee/configs/index.ts (1)

2-2: Centralizing the EvaluationVersion type import enhances maintainability and consistency across the codebase.

app/client/src/ce/workers/Evaluation/Actions.ts (1)

11-11: Importing EvaluationVersion from constants/EvalConstants standardizes its usage across different modules, aligning with best practices for type management.

app/client/src/ce/api/ApplicationApi.tsx (1)

17-17: The update to import EvaluationVersion from constants/EvalConstants ensures consistency and reduces redundancy in type definitions across the application.

app/client/src/sagas/EvaluationsSaga.ts (1)

73-73: Importing EvaluationVersion from constants/EvalConstants in the saga file aligns with the centralized management of type definitions, facilitating easier updates and maintenance.

app/client/src/ce/constants/ReduxActionConstants.tsx (1)

19-19: The import change for EvaluationVersion centralizes its definition, which is a good practice for maintainability.

@ayushpahwa ayushpahwa added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Jun 12, 2024
@ayushpahwa ayushpahwa merged commit 69b63fa into release Jun 12, 2024
45 checks passed
@ayushpahwa ayushpahwa deleted the fix/eval-version-for-workflows branch June 12, 2024 07:37
ayushpahwa added a commit that referenced this pull request Jun 12, 2024
## Description
Eval version 2 is used to properly handle the escape characters like
`\n` etc in the eval flow. If not set, it is defaulting to behaviour for
eval version 1. This PR introduces the type fixes to allow for eval
version to be set via the API. The main change is in the EE PR and this
PR is to update the type.


Fixes #34171 

## Automation

/test sanity

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/9478023950>
> Commit: c5edfb3
> Cypress dashboard url: <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=9478023950&attempt=1"
target="_blank">Click here!</a>

<!-- end of auto-generated comment: Cypress test results  -->








## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [x] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Refactor**
- Consolidated `EvaluationVersion` type imports to a single source for
improved maintainability.
- Promoted `DEFAULT_EVALUATION_VERSION` to be exportable for broader use
across the application.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
trishaanand added a commit that referenced this pull request Jun 12, 2024
…release-blocker

fix: set eval version for workflows artefact  (#34197)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Critical This issue needs immediate attention. Drop everything else Needs Triaging Needs attention from maintainers to triage ok-to-test Required label for CI Production Release Blocker This issue must be resolved before the release Workflows Pod For all issues related to the Workflows feature Workflows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: adding "\n" to the workflow code causes the evaluation to fail
2 participants