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: git auto generate header issue fixed #33016

Merged
merged 1 commit into from Apr 30, 2024

Conversation

sneha122
Copy link
Contributor

@sneha122 sneha122 commented Apr 29, 2024

Description

The autoGeneratedHeaders property in actionConfiguration is unnecessarily getting introduced as git changes. This PR fixes that issue.

With current implementation, In a git connected application, when we create any action and bind it to table widget, once we successfully commit these changes, after surfing the application without making any changes, we can see new changes to be committed for git and in those changes we can see autoGeneratedHeaders: [] inside actionConfiguration. This issue has been fixed by initialising the field by default when we create action.

gittest

Redux unit tests have been added to assert the fix

Fixes #27941
or
Fixes Issue URL

Warning

If no issue exists, please create an issue first, and check with the maintainers if the issue is valid.

Automation

/ok-to-test tags="@tag.Datasource"

🔍 Cypress test results

Tip

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

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • New Features
    • Enhanced API and GraphQL editors with support for auto-generated headers to streamline configuration processes.
  • Tests
    • Added new tests to ensure the reliability of API configuration functionalities.

Copy link
Contributor

coderabbitai bot commented Apr 29, 2024

Walkthrough

Walkthrough

This update introduces the autoGeneratedHeaders field to the default configurations for both API and GraphQL actions, ensuring that headers are managed consistently across different types of actions. Additionally, new tests have been added to validate the behavior of the createDefaultApiActionPayload function, enhancing the robustness of the feature.

Changes

File Path Change Summary
.../ApiEditorConstants.ts Added autoGeneratedHeaders: [] to DEFAULT_API_ACTION_CONFIG
.../GraphQLEditorConstants.ts Added autoGeneratedHeaders: [] to DEFAULT_GRAPHQL_ACTION_CONFIG
.../__tests__/ApiPaneSagas.test.ts Introduced tests for createDefaultApiActionPayload function

Assessment against linked issues

Objective Addressed Explanation
Address unexpected modification prompts in git connected apps (#27941) The changes do not address the issue of unexpected modification prompts as they focus on adding a new field to API configurations and testing.

Possibly related issues


Recent Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 0d03411 and 769749d.
Files selected for processing (3)
  • app/client/src/constants/ApiEditorConstants/ApiEditorConstants.ts (1 hunks)
  • app/client/src/constants/ApiEditorConstants/GraphQLEditorConstants.ts (1 hunks)
  • app/client/src/sagas/tests/ApiPaneSagas.test.ts (1 hunks)
Files skipped from review due to trivial changes (1)
  • app/client/src/constants/ApiEditorConstants/ApiEditorConstants.ts
Additional comments not posted (3)
app/client/src/constants/ApiEditorConstants/GraphQLEditorConstants.ts (1)

59-59: The addition of autoGeneratedHeaders: [] to DEFAULT_GRAPHQL_ACTION_CONFIG aligns with the PR's objectives to prevent unintended Git changes. This change is implemented correctly and follows the existing configuration structure.

app/client/src/sagas/__tests__/ApiPaneSagas.test.ts (2)

10-29: The unit test correctly checks that autoGeneratedHeaders is initialized to an empty array for GraphQL actions. This test is well-structured and effectively mocks necessary dependencies.


31-51: This unit test ensures that autoGeneratedHeaders is also correctly initialized for REST API actions. The test follows the same structure as the previous one, effectively using mocks and assertions.


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.

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 a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @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 Git Pod Anything related to git sync Git status Issues related to information shown on git status modal or number of changes appearing in a branch Git Version Control Issues related to version control Integrations Pod Issues related to a specific integration Low An issue that is neither critical nor breaks a user flow Low effort Takes 1-2 days Production REST API plugin REST API plugin related issues labels Apr 29, 2024
@sneha122
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/8874900380.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 33016.
recreate: .

@sneha122 sneha122 added the ok-to-test Required label for CI label Apr 29, 2024
Copy link

Deploy-Preview-URL: https://ce-33016.dp.appsmith.com

@rishabhrathod01
Copy link
Contributor

This works as expected on DP. Tested using this repo https://github.com/rishabhrathod01/git-feature-test/commit/f8e49271fcda995c155e0c4091251caa68a9d01b

Copy link
Contributor

@rishabhrathod01 rishabhrathod01 left a comment

Choose a reason for hiding this comment

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

Changes look good to me.

@sneha122 sneha122 merged commit 32cbf2d into release Apr 30, 2024
45 of 46 checks passed
@sneha122 sneha122 deleted the fix/git-autogenerated-headers branch April 30, 2024 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Git Pod Anything related to git sync Git status Issues related to information shown on git status modal or number of changes appearing in a branch Git Version Control Issues related to version control Integrations Pod Issues related to a specific integration Low effort Takes 1-2 days Low An issue that is neither critical nor breaks a user flow ok-to-test Required label for CI Production REST API plugin REST API plugin related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Seeing modifications to be commited, even when no changes have been made on the app
2 participants