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: Minor update for edge case #38295

Merged
merged 1 commit into from
Dec 20, 2024
Merged

ci: Minor update for edge case #38295

merged 1 commit into from
Dec 20, 2024

Conversation

sagar-qa007
Copy link
Contributor

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

Description

Handle one minor edge case.

Fixes #Issue Number
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.Sanity"

🔍 Cypress test results

Tip

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


Fri, 20 Dec 2024 14:00:30 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • New Features

    • Introduced a run_count parameter for enhanced control over Cypress test execution.
  • Bug Fixes

    • Improved robustness in checking for null or empty values in the specs_to_run input.
  • Chores

    • Refined logic for rerunning tests based on previous run results and clarified handling of snapshot updates.

Copy link
Contributor

coderabbitai bot commented Dec 20, 2024

Walkthrough

The pull request modifies the GitHub Actions workflow configuration for Appsmith's CI process. The primary changes involve adding a new run_count input parameter to control test repetition and enhancing the logic for handling test specifications and snapshot updates. The workflow now provides more flexibility in test execution, allowing users to specify the number of test runs and handle various input scenarios more robustly.

Changes

File Change Summary
.github/workflows/ci-test-limited-with-count.yml - Added run_count input parameter to workflow_dispatch and workflow_call sections
- Improved condition for checking specs_to_run
- Updated test execution logic to support multiple test runs
- Enhanced handling of snapshot updates

Sequence Diagram

sequenceDiagram
    participant User
    participant Workflow
    participant CISystem
    participant CypressTests

    User->>Workflow: Trigger with run_count
    Workflow->>CISystem: Configure test parameters
    CISystem->>CypressTests: Run tests (repeat run_count times)
    CypressTests-->>CISystem: Return test results
    CISystem-->>User: Provide test execution summary
Loading

Possibly related PRs

Suggested labels

skip-changelog, CI, ok-to-test

Suggested reviewers

  • sharat87
  • ApekshaBhosale
  • yatinappsmith

Poem

🤖 Workflow dancing, tests in flight,
Counting runs with algorithmic might
Cypress spins its magic wheel
Repeating tests with digital zeal
CI's rhythm, precise and bright! 🚀


🪧 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 generate docstrings to generate docstrings for this PR. (Beta)
  • @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.

@sagar-qa007 sagar-qa007 added the ok-to-test Required label for CI label Dec 20, 2024
@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 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

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 (4)
.github/workflows/ci-test-limited-with-count.yml (4)

Line range hint 12-14: Consider adding maximum limit validation for run_count

The run_count parameter should have an upper limit to prevent resource exhaustion from excessive test repetitions.

       run_count:
         description: 'Number of times to repeat the test run'
         required: false
         type: number
-        default: 1
+        default: 1
+        max: 5  # Prevent excessive resource usage

Also applies to: 34-36

🧰 Tools
🪛 actionlint (1.7.4)

145-145: shellcheck reported issue in this script: SC2086:info:11:38: Double quote to prevent globbing and word splitting

(shellcheck)


Line range hint 289-290: Consider using version matrix for Chrome installation

Hardcoding Chrome version makes maintenance difficult. Consider using a version matrix or environment variable.

-      - name: Install Google Chrome 129.0.6668.100
+      - name: Install Google Chrome
         run: |
           sudo apt-get remove google-chrome-stable
-          wget -q https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_129.0.6668.100-1_amd64.deb
+          wget -q https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${{ env.CHROME_VERSION }}-1_amd64.deb

Also applies to: 291-292

🧰 Tools
🪛 actionlint (1.7.4)

145-145: shellcheck reported issue in this script: SC2086:info:11:38: Double quote to prevent globbing and word splitting

(shellcheck)


Line range hint 471-476: Consolidate artifact upload steps

Multiple similar artifact upload steps could be consolidated into a single step with a matrix of configurations.

Consider using a matrix approach:

- name: Upload artifacts
  if: always()
  uses: actions/upload-artifact@v4
  strategy:
    matrix:
      include:
        - name: cypress-repeat-logs
          path: ${{ github.workspace }}/app/client/cy-repeat-summary.txt
        - name: ci_test_status
          path: ${{ github.workspace }}/app/client/ci_test_status.txt
        - name: cypress-console-logs
          path: ${{ github.workspace }}/app/client/cypress/cypress-logs
  with:
    name: ${{ matrix.name }}
    path: ${{ matrix.path }}
    overwrite: true

Also applies to: 478-483, 485-490

🧰 Tools
🪛 actionlint (1.7.4)

145-145: shellcheck reported issue in this script: SC2086:info:11:38: Double quote to prevent globbing and word splitting

(shellcheck)


Line range hint 315-358: Consider moving sensitive environment variables to GitHub Secrets

While these variables are masked, consider moving their declarations to repository secrets and referencing them using a centralized configuration.

Create a separate configuration file (e.g., .github/config/test-env.yml) and reference it:

env:
  CYPRESS_CREDENTIALS: ${{ secrets.CYPRESS_CREDENTIALS_JSON }}
🧰 Tools
🪛 actionlint (1.7.4)

145-145: shellcheck reported issue in this script: SC2086:info:11:38: Double quote to prevent globbing and word splitting

(shellcheck)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 3ff89d7 and 2095f54.

📒 Files selected for processing (1)
  • .github/workflows/ci-test-limited-with-count.yml (1 hunks)
🔇 Additional comments (1)
.github/workflows/ci-test-limited-with-count.yml (1)

144-144: 🛠️ Refactor suggestion

Simplify the specs validation condition

The current condition is complex and hard to maintain. Consider extracting it into a reusable condition.

-        if: ${{ (inputs.specs_to_run == '' || inputs.specs_to_run == null || !inputs.specs_to_run) && steps.run_result.outputs.run_result != 'success' && steps.run_result.outputs.run_result != 'failedtest' }}
+        if: ${{ !inputs.specs_to_run && steps.run_result.outputs.run_result != 'success' && steps.run_result.outputs.run_result != 'failedtest' }}

Likely invalid or redundant comment.

@sagar-qa007 sagar-qa007 merged commit 79ff105 into release Dec 20, 2024
46 checks passed
@sagar-qa007 sagar-qa007 deleted the ci/limitedrunminorfix branch December 20, 2024 14:01
NandanAnantharamu pushed a commit that referenced this pull request Dec 27, 2024
## Description
Handle one minor edge case.


Fixes #`Issue Number`  
_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.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/12431317027>
> Commit: 2095f54
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=12431317027&attempt=2"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Sanity`
> Spec:
> <hr>Fri, 20 Dec 2024 14:00:30 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**
- Introduced a `run_count` parameter for enhanced control over Cypress
test execution.
  
- **Bug Fixes**
- Improved robustness in checking for null or empty values in the
`specs_to_run` input.

- **Chores**
- Refined logic for rerunning tests based on previous run results and
clarified handling of snapshot updates.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
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