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

DNM: In progress : Fixed chrome version #36972

Closed
wants to merge 2 commits into from

Conversation

sagar-qa007
Copy link
Contributor

@sagar-qa007 sagar-qa007 commented Oct 18, 2024

Description

Anvil Snapshot testing required to fix version.

Fixes #36971

Automation

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

🔍 Cypress test results

Warning

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/11475746651
Commit: 50611d6
Cypress dashboard.
Tags: @tag.IDE
Spec:
It seems like no tests ran 😔. We are not able to recognize it, please check workflow here.


Wed, 23 Oct 2024 08:52:26 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • New Features

    • Added new input parameters for specifying test configurations, including ted_tag and run_count.
    • Enhanced CI workflows to support scheduled triggers and manual dispatch with improved error handling and logging.
  • Improvements

    • Updated Chrome version to 129 across multiple workflows.
    • Introduced logic for rerunning tests based on previous outcomes, improving test management.
    • Enhanced Cypress test setup to better manage dependencies and environment variables.
  • Bug Fixes

    • Improved error handling and notifications for test results, ensuring better feedback on failures.

@sagar-qa007 sagar-qa007 requested a review from sharat87 as a code owner October 18, 2024 12:24
@sagar-qa007 sagar-qa007 added the ok-to-test Required label for CI label Oct 18, 2024
@sagar-qa007 sagar-qa007 changed the title chore: Fixing chrom version chore: Fixing chrome version Oct 18, 2024
Copy link
Contributor

coderabbitai bot commented Oct 18, 2024

Walkthrough

The pull request introduces significant updates to multiple GitHub Actions workflow files for the Appsmith CI system. Key enhancements include the addition of new input parameters like ted_tag and run_count, refined job conditions based on event types, and improved error handling and logging mechanisms. The workflows now utilize specific versions of Chrome and include service containers for MongoDB and Redis. The overall structure has been reorganized to enhance clarity and maintainability, ensuring robust management of test executions and reruns.

Changes

File Path Change Summary
.github/workflows/ci-test-custom-script.yml - Added input parameter ted_tag.
- Refined job conditions and enhanced error handling.
- Added MongoDB service container and reorganized job steps.
.github/workflows/ci-test-hosted.yml - Updated to trigger on a schedule and manual dispatch.
- Added input for pull request number.
- Enhanced job steps for cache management and notifications.
.github/workflows/ci-test-limited-with-count.yml - Added input parameter run_count for specifying test repetitions.
- Adjusted test execution logic to utilize run_count.
app/client/cypress/Dockerfile - Updated CHROME_VERSION from 126.0.6478.114-1 to 129.0.6668.100-1.
- Specified platform for base image and reformatted ENTRYPOINT.
app/client/package.json - Updated Cypress scripts to change browser option to chrome and added --platform linux/amd64.

Possibly related PRs

Suggested reviewers

  • sharat87
  • ApekshaBhosale
  • mohanarpit

🌟 In the land of CI, where workflows thrive,
New inputs and conditions make testing come alive!
With Mongo and Redis, our tests now run fast,
Error logs and caching, improvements amassed.
So here's to the changes, both big and small,
In the world of Appsmith, we’ll conquer them all! 🎉


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between dc8259a and 50611d6.

📒 Files selected for processing (2)
  • app/client/cypress/Dockerfile (1 hunks)
  • app/client/package.json (1 hunks)
🧰 Additional context used
🔇 Additional comments (4)
app/client/cypress/Dockerfile (2)

5-5: LGTM! Platform specification is a good practice

Explicitly setting --platform=linux/amd64 ensures consistent builds across different environments.


1-1: Verify Chrome version compatibility with Cypress

The Chrome version update from 126 to 129 is significant. Ensure this version is compatible with Cypress 13.13.0 and your snapshot tests.

app/client/package.json (2)

46-46: LGTM: Browser change for snapshot testing.

The switch from chromium to chrome aligns with the PR objective and provides a more stable environment for snapshot testing.


47-48: Improved Docker configuration for snapshot testing.

Good improvements:

  • Added DEBUG flag for better troubleshooting
  • Platform specification ensures consistent behavior across different environments
  • Environment variable renamed for better clarity

Let's verify the platform compatibility:

✅ Verification successful

The previous search might have been too specific. Let's broaden our search to understand the Docker setup and platform configurations better.


Platform specification in Docker commands is correctly implemented

The platform specification linux/amd64 in the Cypress Docker commands aligns with the project's Docker configuration:

  • The Cypress Dockerfile explicitly uses --platform=linux/amd64 in its base image
  • This ensures consistent behavior across different development environments
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify Docker platform compatibility in CI workflows
# Test: Search for platform specifications in workflow files
rg -g '*.yml' 'platform.*linux/amd64'

Length of output: 39


Script:

#!/bin/bash
# Let's check for any Docker-related configurations in workflow files and CI configs
rg -g '*.{yml,yaml}' -i 'docker'

# Also check the Dockerfile mentioned in the command
fd Dockerfile -x cat {}

Length of output: 12761


🪧 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.

@sagar-qa007 sagar-qa007 changed the title chore: Fixing chrome version chore: Fixed chrome version Oct 18, 2024
@github-actions github-actions bot added the skip-changelog Adding this label to a PR prevents it from being listed in the changelog label Oct 18, 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: 2

🧹 Outside diff range and nitpick comments (8)
.github/workflows/ci-test-hosted.yml (4)

142-142: Consider using a more flexible Chrome version range.

While specifying a exact version ensures consistency, it may require frequent updates. Consider using a version range (e.g., ^129.0.0) to balance stability with easier maintenance.


Line range hint 228-234: Use GitHub Secrets for sensitive information.

Exposing database credentials and access keys in the workflow file poses a security risk. Consider moving these sensitive values to GitHub Secrets and referencing them using the secrets context.

Example usage:

env:
  CYPRESS_DB_USER: ${{ secrets.CYPRESS_DB_USER }}
  CYPRESS_DB_HOST: ${{ secrets.CYPRESS_DB_HOST }}
  # ... other sensitive variables
🧰 Tools
🪛 actionlint

143-143: shellcheck reported issue in this script: SC2086:info:1:40: Double quote to prevent globbing and word splitting

(shellcheck)


Line range hint 283-301: LGTM. Consider adding a summary of test results.

The enhanced Slack notifications with conditional messaging and Cypress Dashboard links are excellent. To further improve, consider including a brief summary of test results (e.g., number of passed/failed tests) in the notification message.

🧰 Tools
🪛 actionlint

143-143: shellcheck reported issue in this script: SC2086:info:1:40: Double quote to prevent globbing and word splitting

(shellcheck)


Line range hint 314-317: LGTM. Consider using GitHub's built-in status.

Saving the run status is a good practice. However, GitHub Actions already provides built-in status for workflow runs. Consider leveraging this feature instead of manually setting the status, unless there's a specific reason for the custom implementation.

🧰 Tools
🪛 actionlint

143-143: shellcheck reported issue in this script: SC2086:info:1:40: Double quote to prevent globbing and word splitting

(shellcheck)

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

Line range hint 18-21: Approved: Addition of run_count input enhances test flexibility.

The new run_count parameter allows for configurable test repetitions, which is useful for identifying flaky tests or ensuring consistency. Consider adding a maximum limit to prevent excessive resource usage.

run_count:
  description: 'Number of times to repeat the test run (max 10)'
  required: false
type: number
default: 1
maximum: 10

Also applies to: 30-33

🧰 Tools
🪛 actionlint

238-238: shellcheck reported issue in this script: SC2086:info:1:40: Double quote to prevent globbing and word splitting

(shellcheck)


237-237: Approved: Fixed Chrome version enhances test consistency.

Specifying Chrome version 129 ensures consistent browser behavior across test runs. However, consider using an environment variable for easier updates:

chrome-version: ${{ env.CHROME_VERSION }}

Then set CHROME_VERSION: 129 in your repository secrets or workflow environment.


Line range hint 334-352: Approved: Cypress test execution now supports configurable repetitions.

The implementation of cypress-repeat-pro with the run_count input enhances test reliability. The addition of failure detection is a good practice. Consider adding a step to output a summary of all test runs:

- name: Output test summary
  if: always()
  run: |
    echo "Test Summary:"
    cat app/client/cy-repeat-summary.txt
🧰 Tools
🪛 actionlint

238-238: shellcheck reported issue in this script: SC2086:info:1:40: Double quote to prevent globbing and word splitting

(shellcheck)

.github/workflows/ci-test-custom-script.yml (1)

Line range hint 1-30: Consider moving matrix default value to a separate file.

The matrix input parameter has a long default value, which may become difficult to maintain. Consider moving this to a separate JSON file for better readability and easier updates.

🧰 Tools
🪛 actionlint

261-261: shellcheck reported issue in this script: SC2086:info:1:40: Double quote to prevent globbing and word splitting

(shellcheck)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 5d5d9f4 and dc8259a.

📒 Files selected for processing (4)
  • .github/workflows/ci-test-custom-script.yml (1 hunks)
  • .github/workflows/ci-test-hosted.yml (1 hunks)
  • .github/workflows/ci-test-limited-with-count.yml (1 hunks)
  • .github/workflows/ci-test-limited.yml (1 hunks)
🧰 Additional context used
🔇 Additional comments (5)
.github/workflows/ci-test-hosted.yml (1)

Line range hint 235-238: LGTM. Please clarify the purpose of CYPRESS_STATIC_ALLOCATION.

Using a specific Cypress configuration for CI is a good practice. However, could you provide more information about the purpose and impact of the CYPRESS_STATIC_ALLOCATION flag?

🧰 Tools
🪛 actionlint

143-143: shellcheck reported issue in this script: SC2086:info:1:40: Double quote to prevent globbing and word splitting

(shellcheck)

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

Line range hint 1-478: Overall: Workflow improvements enhance test flexibility and reliability.

The changes to this workflow file significantly improve its functionality:

  1. The addition of the run_count parameter allows for more flexible test execution.
  2. Specifying a fixed Chrome version ensures consistent test environments.
  3. The implementation of test repetition with failure detection enhances the reliability of the CI process.

These modifications collectively contribute to a more robust and configurable CI workflow.

🧰 Tools
🪛 actionlint

238-238: shellcheck reported issue in this script: SC2086:info:1:40: Double quote to prevent globbing and word splitting

(shellcheck)

.github/workflows/ci-test-custom-script.yml (3)

Line range hint 32-48: LGTM: Job conditions and strategy are well-defined.

The refined job conditions and matrix strategy with fail-fast set to false provide good flexibility and ensure comprehensive testing across all matrix jobs.

🧰 Tools
🪛 actionlint

261-261: shellcheck reported issue in this script: SC2086:info:1:40: Double quote to prevent globbing and word splitting

(shellcheck)


Line range hint 262-385: LGTM: Cypress test setup and execution are well-configured.

The extensive list of environment variables and the use of a custom Cypress configuration file provide good test coverage and CI-specific settings.

🧰 Tools
🪛 actionlint

261-261: shellcheck reported issue in this script: SC2086:info:1:40: Double quote to prevent globbing and word splitting

(shellcheck)


Line range hint 386-486: LGTM: Comprehensive error handling and artifact uploading.

The extensive error handling and artifact uploading steps greatly improve debugging capabilities and allow for better management of test reruns.

🧰 Tools
🪛 actionlint

261-261: shellcheck reported issue in this script: SC2086:info:1:40: Double quote to prevent globbing and word splitting

(shellcheck)

@@ -224,7 +224,7 @@ jobs:

- uses: browser-actions/setup-chrome@latest
with:
chrome-version: stable
chrome-version: 129
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Update Chrome version to latest stable

The specified Chrome version (129) is outdated. Update to the latest stable version (130) or use "stable" for automatic updates.

chrome-version: stable

This change ensures compatibility with the current test suite and reduces manual version updates.

🔗 Analysis chain

Verify Chrome version compatibility

The Chrome version has been updated from 'stable' to a specific version '129'. Ensure this version is compatible with our current test suite and CI environment.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if Chrome 129 is the latest stable version
latest_stable=$(curl -s https://omahaproxy.appspot.com/all.json | jq -r '.[] | select(.os=="linux") | .versions[] | select(.channel=="stable") | .version' | head -n1)
if [[ "$latest_stable" == "129."* ]]; then
  echo "Chrome 129 is the latest stable version."
else
  echo "Warning: Chrome 129 is not the latest stable version. Latest stable is $latest_stable"
fi

Length of output: 405


Script:

#!/bin/bash
# Fetch and display the JSON structure from Omaha Proxy
curl -s https://omahaproxy.appspot.com/all.json | jq .

Length of output: 113


Script:

#!/bin/bash
# Fetch and display the raw JSON structure from Omaha Proxy
curl -s https://omahaproxy.appspot.com/all.json

Length of output: 173


Script:

#!/bin/bash
# Fetch and display the latest stable Chrome version from Chromium Dash
latest_stable=$(curl -s https://chromiumdash.appspot.com/fetch_releases?channel=Stable&platform=Linux | jq -r '.[0].version')
if [[ "$latest_stable" == "129."* ]]; then
  echo "Chrome 129 is the latest stable version."
else
  echo "Warning: Chrome 129 is not the latest stable version. Latest stable is $latest_stable"
fi

Length of output: 217191

Comment on lines 259 to 261
with:
chrome-version: stable
chrome-version: 129
- run: |
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Consider using a more flexible Chrome version specification.

Explicitly setting Chrome version to 129 might lead to version conflicts in the future. Consider using a more flexible version specification or regularly updating this value to match the latest stable version.

🧰 Tools
🪛 actionlint

261-261: shellcheck reported issue in this script: SC2086:info:1:40: Double quote to prevent globbing and word splitting

(shellcheck)

ARG YARN_VERSION='1.22.22'
ARG NODE_VERSION='20.13.1'
ARG CYPRESS_VERSION='13.13.0'
FROM cypress/factory:4.0.2
FROM --platform=linux/amd64 cypress/factory:4.0.2
Copy link
Collaborator

Choose a reason for hiding this comment

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

I've tried this configuration, but it doesn't work that way. The docker process starts taking up the entire CPU resource and the tests just hang. I tried it on two different machines(M2 and M3).
Снимок экрана 2024-10-23 в 12 19 32

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@KelvinOm Yes there is open bug for it apart from this CPU usage. I will spend sometime later once this become priority. cypress-io/cypress#29095

Copy link
Collaborator

Choose a reason for hiding this comment

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

@sagar-qa007 The issue is that we cannot consider this as a solution. Because we just won't be able to use it. How do you run this locally?You work on a mac like the rest of us, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. I am reiterating this, kindly wait for the fix. I am marking this PR as do not merge as it is in progress.

Copy link
Collaborator

Choose a reason for hiding this comment

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

As it turns out, the fix of this situation can be waited for a very long time. Can we consider using chromium instead of chrome for testing?

@sagar-qa007 @yatinappsmith

"cypress:snapshot:docker": "docker run --network='host' -it --rm -e CYPRESS_$1 -v $PWD:/cypress -w /cypress cypress-snapshot $0",
"cypress:snapshot:docker:build": "docker build . -f cypress/Dockerfile -t cypress-snapshot"
"cypress:snapshot": "npx cypress run -b chrome -s",
"cypress:snapshot:docker": "DEBUG=cypress:* docker run --platform linux/amd64 --network='host' -it --rm -e CYPRESS_UPDATE_SNAPSHOTS=$1 -v $PWD:/cypress -w /cypress cypress-snapshot $0",
Copy link
Collaborator

Choose a reason for hiding this comment

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

I can't run this script because of error No matches found: "cypress:*".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will check this.

@sagar-qa007 sagar-qa007 changed the title chore: Fixed chrome version DNM: Fixed chrome version Oct 25, 2024
@github-actions github-actions bot removed the skip-changelog Adding this label to a PR prevents it from being listed in the changelog label Oct 25, 2024
@sagar-qa007 sagar-qa007 changed the title DNM: Fixed chrome version DNM: In progress : Fixed chrome version Oct 25, 2024
Copy link

github-actions bot commented Nov 7, 2024

This PR has not seen activitiy for a while. It will be closed in 7 days unless further activity is detected.

@github-actions github-actions bot added the Stale label Nov 7, 2024
Copy link

This PR has been closed because of inactivity.

@github-actions github-actions bot closed this Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok-to-test Required label for CI Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants