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 nested-dynamic-groups-as-video bug #4548

Merged
merged 6 commits into from
Jul 8, 2024

Conversation

sashankaryal
Copy link
Contributor

@sashankaryal sashankaryal commented Jul 2, 2024

What changes are proposed in this pull request?

When expanding a sample in a nested dynamic group when imavid is active, the first sample is always displayed. This PR fixes that.

Before

bad-dynamic-groups-small

After

good-dynamic-groups-small

Release Notes

Is this a user-facing change that should be mentioned in the release notes?

  • No. You can skip the rest of this section.
  • Yes. Give a description of this change to be included in the release
    notes for FiftyOne users.

What areas of FiftyOne does this PR affect?

  • App: FiftyOne application changes
  • Build: Build and test infrastructure changes
  • Core: Core fiftyone Python library changes
  • Documentation: FiftyOne documentation changes
  • Other

Summary by CodeRabbit

  • New Features

    • Added the ability to check if a specific tag value exists for a sample at a given index within the grid.
    • Introduced new test cases for dynamic groups, including grids, modals, and sidebars.
    • Added a method to wait for sidebar entry text to match a specified value.
  • Enhancements

    • Updated selection count verification in modals to improve reliability.
    • Improved visibility checks in operator prompts.
    • Adjusted slider variable names for clarity in sidebars.
    • Modified timeout settings based on environment variable.
  • Bug Fixes

    • Corrected parameter values for date and time field filtering in sidebar tests.
  • Chores

    • Simplified control flow in the video processing module.

@sashankaryal sashankaryal requested a review from a team July 2, 2024 23:37
@sashankaryal sashankaryal self-assigned this Jul 2, 2024
Copy link
Contributor

coderabbitai bot commented Jul 2, 2024

Walkthrough

The updates modify various e2e testing components, including adding new methods for better validation and changing existing methods to improve consistency and functionality. Changes encompass timer configuration based on an environment variable, new and updated methods in asserters, and test scenario enhancements. Additionally, a new test for nested dynamic groups is introduced.

Changes

File Change Summary
e2e-pw/.../grid/index.ts Added method nthSampleHasTagValue to GridAsserter to check tag value at a specific index.
e2e-pw/.../modal/index.ts Updated verifySelectionCount method to use toHaveText instead of textContent.
e2e-pw/.../operators/operators-prompt.ts Modified isClosed method to use toBeHidden instead of not.toBeVisible.
e2e-pw/.../media-factory/video.ts Removed the assignment of the spawned process to a variable proc in spawnSync.
e2e-pw/playwright.config.ts Changed timeout setting based on USE_DEV_BUILD environment variable.
e2e-pw/.../modal/modal-sidebar.ts Added waitUntilSidebarEntryTextEquals method to SidebarAsserter.
e2e-pw/.../specs/groups/nested-dynamic-groups.spec.ts Introduced test cases for dynamic groups, including setups and validations.
e2e-pw/.../poms/sidebar.ts Renamed variables and altered logic in changeSliderStartValue method.
e2e-pw/.../specs/regression-tests/sidebar/sidebar-datetime.spec.ts Updated parameters in changeSliderStartValue function for date and time field filtering test.

🐰
In the land of code, we tweak and grow,
With every test and method bestowed.
Grids and modals, ever so tight,
Await the tags and counts to be right.
A sidebar whisper, a timeout long,
Embracing change, our tests grow strong.
🌟


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.

@sashankaryal sashankaryal changed the title Fix dynamic groups of groups as video bug Fix nested-dynamic-groups-as-video bug Jul 2, 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.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 4a3691a and 03ee885.

Files selected for processing (1)
  • app/packages/state/src/recoil/dynamicGroups.ts (2 hunks)
Additional context used
Path-based instructions (1)
app/packages/state/src/recoil/dynamicGroups.ts (1)

Pattern **/*.{ts,tsx}: Review the Typescript and React code for conformity with best practices in React, Recoil, Graphql, and Typescript. Highlight any deviations.

Additional comments not posted (3)
app/packages/state/src/recoil/dynamicGroups.ts (3)

78-78: Update filter type definition to support multiple slices.

The filter object now supports both single slice and multiple slices which enhances flexibility.


87-88: Use slice directly in filter.

The filter now directly uses slice which simplifies the code.


95-97: Add conditional check for group slices.

The code now conditionally sets params.filter.group.slices to an array containing slice if hasGroupSlices is true. This ensures that the filter criteria are correctly applied.

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.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 03ee885 and d9ff080.

Files ignored due to path filters (2)
  • e2e-pw/package.json is excluded by !**/*.json
  • e2e-pw/yarn.lock is excluded by !**/yarn.lock, !**/*.lock, !**/*.lock
Files selected for processing (5)
  • app/packages/looker/src/lookers/imavid/controller.ts (1 hunks)
  • e2e-pw/playwright.config.ts (1 hunks)
  • e2e-pw/src/oss/poms/grid/index.ts (1 hunks)
  • e2e-pw/src/oss/poms/modal/modal-sidebar.ts (1 hunks)
  • e2e-pw/src/oss/specs/groups/nested-dynamic-groups.spec.ts (1 hunks)
Additional context used
Path-based instructions (5)
e2e-pw/playwright.config.ts (1)

Pattern **/*.{ts,tsx}: Review the Typescript and React code for conformity with best practices in React, Recoil, Graphql, and Typescript. Highlight any deviations.

e2e-pw/src/oss/poms/modal/modal-sidebar.ts (1)

Pattern **/*.{ts,tsx}: Review the Typescript and React code for conformity with best practices in React, Recoil, Graphql, and Typescript. Highlight any deviations.

e2e-pw/src/oss/poms/grid/index.ts (1)

Pattern **/*.{ts,tsx}: Review the Typescript and React code for conformity with best practices in React, Recoil, Graphql, and Typescript. Highlight any deviations.

e2e-pw/src/oss/specs/groups/nested-dynamic-groups.spec.ts (1)

Pattern **/*.{ts,tsx}: Review the Typescript and React code for conformity with best practices in React, Recoil, Graphql, and Typescript. Highlight any deviations.

app/packages/looker/src/lookers/imavid/controller.ts (1)

Pattern **/*.{ts,tsx}: Review the Typescript and React code for conformity with best practices in React, Recoil, Graphql, and Typescript. Highlight any deviations.

Additional comments not posted (5)
e2e-pw/playwright.config.ts (1)

12-12: Ensure timeout configuration is appropriate.

The timeout configuration has been modified to extend the timeout to 10 minutes if USE_DEV_BUILD is set. This change seems appropriate for development builds, but ensure that the longer timeout is necessary and won't mask potential issues during development.

e2e-pw/src/oss/poms/modal/modal-sidebar.ts (1)

64-64: New method waitUntilSidebarEntryTextEquals looks good.

The new method waitUntilSidebarEntryTextEquals is well-implemented. It uses waitForFunction to wait for a sidebar entry text to match a specified value within a 5000 milliseconds timeout.

e2e-pw/src/oss/poms/grid/index.ts (1)

102-102: New method nthSampleHasTagValue looks good.

The new method nthSampleHasTagValue is well-implemented. It checks if a specific tag value exists for a sample at a given index within a grid.

e2e-pw/src/oss/specs/groups/nested-dynamic-groups.spec.ts (1)

1-1: New test file nested-dynamic-groups.spec.ts looks good.

The new test file nested-dynamic-groups.spec.ts is well-implemented. It includes setups for grids, modals, and sidebars, along with the creation and validation of nested dynamic groups within a dataset. The tests are comprehensive and cover various scenarios.

app/packages/looker/src/lookers/imavid/controller.ts (1)

122-122: Verify the correctness of the argument change in fetchMore.

The change from subtracting 1 to subtracting 2 in the fetchMore method might affect the pagination logic. Ensure that this change is intentional and correctly adjusts the range of frames fetched.

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.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between d9ff080 and a9a9db2.

Files ignored due to path filters (1)
  • e2e-pw/package.json is excluded by !**/*.json
Files selected for processing (4)
  • e2e-pw/src/oss/poms/grid/index.ts (2 hunks)
  • e2e-pw/src/oss/poms/modal/index.ts (1 hunks)
  • e2e-pw/src/oss/poms/operators/operators-prompt.ts (1 hunks)
  • e2e-pw/src/shared/media-factory/video.ts (1 hunks)
Files skipped from review due to trivial changes (1)
  • e2e-pw/src/shared/media-factory/video.ts
Additional context used
Path-based instructions (3)
e2e-pw/src/oss/poms/operators/operators-prompt.ts (1)

Pattern **/*.{ts,tsx}: Review the Typescript and React code for conformity with best practices in React, Recoil, Graphql, and Typescript. Highlight any deviations.

e2e-pw/src/oss/poms/grid/index.ts (1)

Pattern **/*.{ts,tsx}: Review the Typescript and React code for conformity with best practices in React, Recoil, Graphql, and Typescript. Highlight any deviations.

e2e-pw/src/oss/poms/modal/index.ts (1)

Pattern **/*.{ts,tsx}: Review the Typescript and React code for conformity with best practices in React, Recoil, Graphql, and Typescript. Highlight any deviations.

Additional comments not posted (3)
e2e-pw/src/oss/poms/operators/operators-prompt.ts (1)

60-60: Use of toBeHidden is appropriate

The change to use toBeHidden instead of not.toBeVisible is appropriate as it is more explicit and aligns with best practices for checking visibility.

e2e-pw/src/oss/poms/grid/index.ts (1)

101-109: New method nthSampleHasTagValue looks good

The new method nthSampleHasTagValue correctly retrieves the tag element for the nth looker and asserts its text value. This method is well-implemented.

e2e-pw/src/oss/poms/modal/index.ts (1)

246-246: Use of toHaveText in verifySelectionCount is appropriate

The change to use toHaveText for text verification in verifySelectionCount method is appropriate and aligns with best practices for text content assertions.

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.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between a9a9db2 and 38e7314.

Files selected for processing (1)
  • e2e-pw/src/oss/specs/groups/nested-dynamic-groups.spec.ts (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • e2e-pw/src/oss/specs/groups/nested-dynamic-groups.spec.ts

Copy link
Contributor

@benjaminpkane benjaminpkane left a comment

Choose a reason for hiding this comment

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

LGTM but maybe fix e2e before merging 🙏

"nested-dynamic-groups"
);

function* orderGenerator() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Fancy


samples = []

image_paths = ${JSON.stringify(imagePaths)}
Copy link
Contributor

Choose a reason for hiding this comment

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

Very clever 😄

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.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 38e7314 and 8ad2fcd.

Files ignored due to path filters (2)
  • e2e-pw/package.json is excluded by !**/*.json
  • e2e-pw/yarn.lock is excluded by !**/yarn.lock, !**/*.lock, !**/*.lock
Files selected for processing (9)
  • app/packages/looker/src/lookers/imavid/controller.ts (1 hunks)
  • app/packages/state/src/recoil/dynamicGroups.ts (2 hunks)
  • e2e-pw/playwright.config.ts (1 hunks)
  • e2e-pw/src/oss/poms/grid/index.ts (2 hunks)
  • e2e-pw/src/oss/poms/modal/index.ts (1 hunks)
  • e2e-pw/src/oss/poms/modal/modal-sidebar.ts (1 hunks)
  • e2e-pw/src/oss/poms/operators/operators-prompt.ts (1 hunks)
  • e2e-pw/src/oss/specs/groups/nested-dynamic-groups.spec.ts (1 hunks)
  • e2e-pw/src/shared/media-factory/video.ts (1 hunks)
Files skipped from review as they are similar to previous changes (9)
  • app/packages/looker/src/lookers/imavid/controller.ts
  • app/packages/state/src/recoil/dynamicGroups.ts
  • e2e-pw/playwright.config.ts
  • e2e-pw/src/oss/poms/grid/index.ts
  • e2e-pw/src/oss/poms/modal/index.ts
  • e2e-pw/src/oss/poms/modal/modal-sidebar.ts
  • e2e-pw/src/oss/poms/operators/operators-prompt.ts
  • e2e-pw/src/oss/specs/groups/nested-dynamic-groups.spec.ts
  • e2e-pw/src/shared/media-factory/video.ts

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.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 8ad2fcd and 3b3e36a.

Files selected for processing (2)
  • e2e-pw/src/oss/poms/sidebar.ts (1 hunks)
  • e2e-pw/src/oss/specs/regression-tests/sidebar/sidebar-datetime.spec.ts (1 hunks)
Additional context used
Path-based instructions (2)
e2e-pw/src/oss/specs/regression-tests/sidebar/sidebar-datetime.spec.ts (1)

Pattern **/*.{ts,tsx}: Review the Typescript and React code for conformity with best practices in React, Recoil, Graphql, and Typescript. Highlight any deviations.

e2e-pw/src/oss/poms/sidebar.ts (1)

Pattern **/*.{ts,tsx}: Review the Typescript and React code for conformity with best practices in React, Recoil, Graphql, and Typescript. Highlight any deviations.

Additional comments not posted (2)
e2e-pw/src/oss/specs/regression-tests/sidebar/sidebar-datetime.spec.ts (1)

130-130: Verify parameter change for changeSliderStartValue.

The parameters for changeSliderStartValue have been updated to 59.000 and 0.000. Ensure these values are in the correct format and consistent with the expected input for this function.

e2e-pw/src/oss/poms/sidebar.ts (1)

91-93: Verify variable name changes in changeSliderStartValue.

The variables sliderStart and sliderMidPoint have been introduced. Ensure these changes maintain the expected behavior of the function.

@sashankaryal sashankaryal merged commit e9f2fbf into develop Jul 8, 2024
16 of 17 checks passed
@sashankaryal sashankaryal deleted the bugfix/dynamic-groups-slices branch July 8, 2024 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants