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

ci: Added ci option for snapshot #38261

Merged
merged 1 commit into from
Dec 20, 2024
Merged

Conversation

sagar-qa007
Copy link
Contributor

@sagar-qa007 sagar-qa007 commented Dec 19, 2024

Description

Adding workflow for updating snapshot with github CI.

Fixes #36419

Automation

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

🔍 Cypress test results

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/12426577557
Commit: 2660c07
Cypress dashboard.
Tags: @tag.Sanity
Spec:


Fri, 20 Dec 2024 07:02:16 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • New Features

    • Enhanced CI workflow with new input parameters for snapshot updates and spec execution.
    • Added steps for uploading existing and new snapshot data during Cypress tests.
  • Bug Fixes

    • Improved artifact management and error handling in the CI process.
  • Documentation

    • Added comments for better understanding of workflow logic and input parameters.
  • Refactor

    • Streamlined job execution logic and conditional checks for test reruns.

@sagar-qa007 sagar-qa007 added the ok-to-test Required label for CI label Dec 19, 2024
Copy link
Contributor

coderabbitai bot commented Dec 19, 2024

Walkthrough

The pull request modifies GitHub workflow files to enhance CI/CD processes, specifically focusing on adding flexibility to test execution and snapshot management. The changes introduce new input parameters update_snapshot and specs_to_run across multiple workflow files, enabling more dynamic control over Cypress testing and snapshot handling in the continuous integration pipeline.

Changes

File Change Summary
.github/workflows/build-client-server-count.yml Added job outputs update_snapshot and specs_to_run in file-check job
.github/workflows/ci-test-limited-with-count.yml Added new inputs update_snapshot and specs_to_run, updated Cypress test execution logic
.github/workflows/ci-test-limited.yml Added input parameters pr and previous-workflow-run-id, updated artifact upload paths

Assessment against linked issues

Objective Addressed Explanation
Enable snapshot testing
Prepare environment for snapshot testing

Possibly related PRs

Suggested Labels

skip-changelog, CI

Suggested Reviewers

  • sharat87
  • yatinappsmith
  • ApekshaBhosale

Poem

🤖 Workflows dance, parameters sing,
CI pipelines take their wing!
Snapshots tested, specs unfurled,
Automation's magic now swirled!
Code commits with a playful grin 🚀


🪧 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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 using 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.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

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 skip-changelog Adding this label to a PR prevents it from being listed in the changelog CI labels Dec 19, 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

🧹 Nitpick comments (2)
.github/workflows/build-client-server-count.yml (1)

43-57: Consider using explicit string comparison for bash conditions.

When checking empty strings in bash, it's safer to use explicit string comparison.

- if [[ -z "$checkArg" ]]; then
+ if [[ "$checkArg" == "" ]]; then
.github/workflows/ci-test-limited-with-count.yml (1)

22-31: Fix YAML indentation and trailing spaces.

The YAML indentation for input parameters should be 8 spaces, and trailing spaces should be removed.

      update_snapshot:
-          description: 'Give option to update snapshot (true/false)'
+        description: 'Give option to update snapshot (true/false)'
-          required: false
+        required: false
-          type: boolean
+        type: boolean
-          default: false
+        default: false
      specs_to_run:
        description: 'Cypress spec file(s) to run'
        required: false
-        type: string  
+        type: string

Also applies to: 48-56

🧰 Tools
🪛 yamllint (1.35.1)

[warning] 23-23: wrong indentation: expected 8 but found 10

(indentation)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e22dbd1 and 2660c07.

📒 Files selected for processing (3)
  • .github/workflows/build-client-server-count.yml (5 hunks)
  • .github/workflows/ci-test-limited-with-count.yml (5 hunks)
  • .github/workflows/ci-test-limited.yml (1 hunks)
🧰 Additional context used
🪛 yamllint (1.35.1)
.github/workflows/ci-test-limited-with-count.yml

[warning] 23-23: wrong indentation: expected 8 but found 10

(indentation)


[warning] 49-49: wrong indentation: expected 8 but found 10

(indentation)


[error] 56-56: trailing spaces

(trailing-spaces)


[error] 133-133: trailing spaces

(trailing-spaces)


[error] 140-140: trailing spaces

(trailing-spaces)


[error] 144-144: trailing spaces

(trailing-spaces)


[error] 501-501: trailing spaces

(trailing-spaces)

🔇 Additional comments (7)
.github/workflows/ci-test-limited.yml (1)

421-421: LGTM! Good use of workspace variable.

Using ${{ github.workspace }} instead of relative path ensures consistency across different GitHub Actions runners.

.github/workflows/build-client-server-count.yml (3)

20-21: LGTM! Good addition of new outputs.

The new outputs update_snapshot and specs_to_run enhance the workflow's flexibility for snapshot testing.


117-117: LGTM! Enhanced PR comment with spec information.

Adding spec information to the PR comment improves visibility of test execution.


169-170: LGTM! Consistent parameter passing.

The new parameters are correctly passed to both test execution workflows.

Also applies to: 184-185

.github/workflows/ci-test-limited-with-count.yml (3)

133-140: LGTM! Good addition of snapshot artifact upload.

The step to upload existing snapshots is correctly implemented with appropriate conditions.

🧰 Tools
🪛 yamllint (1.35.1)

[error] 133-133: trailing spaces

(trailing-spaces)


[error] 140-140: trailing spaces

(trailing-spaces)


379-391: LGTM! Well-structured conditional Cypress execution.

The implementation correctly handles snapshot updates based on the input parameter.


495-502: LGTM! Good addition of new snapshot comparison.

The step to upload new compared snapshots ensures proper tracking of snapshot changes.

🧰 Tools
🪛 yamllint (1.35.1)

[error] 501-501: trailing spaces

(trailing-spaces)

@sagar-qa007 sagar-qa007 added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Dec 20, 2024
Copy link
Collaborator

@NandanAnantharamu NandanAnantharamu left a comment

Choose a reason for hiding this comment

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

Lgtm

@sagar-qa007 sagar-qa007 merged commit d1cff32 into release Dec 20, 2024
60 of 78 checks passed
@sagar-qa007 sagar-qa007 deleted the ci/runscreenshotwithcmd branch December 20, 2024 07:07
NandanAnantharamu pushed a commit that referenced this pull request Dec 27, 2024
## Description
Adding workflow for updating snapshot with github CI.


Fixes #[`36419`  ](#36419)


## Automation

/ok-to-test tags="@tag.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/12426577557>
> Commit: 2660c07
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=12426577557&attempt=2"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Sanity`
> Spec:
> <hr>Fri, 20 Dec 2024 07:02:16 UTC
<!-- 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

- **New Features**
- Enhanced CI workflow with new input parameters for snapshot updates
and spec execution.
- Added steps for uploading existing and new snapshot data during
Cypress tests.

- **Bug Fixes**
	- Improved artifact management and error handling in the CI process.

- **Documentation**
- Added comments for better understanding of workflow logic and input
parameters.

- **Refactor**
- Streamlined job execution logic and conditional checks for test
reruns.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@coderabbitai coderabbitai bot mentioned this pull request Dec 31, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI ok-to-test Required label for CI skip-changelog Adding this label to a PR prevents it from being listed in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants