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

change type to array of object for view param of set_view #4198

Merged
merged 2 commits into from Apr 3, 2024

Conversation

imanjra
Copy link
Contributor

@imanjra imanjra commented Mar 26, 2024

What changes are proposed in this pull request?

change type to array of object for view param of set_view

How is this patch tested? If it is not, please explain why.

Using a test operator

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.

change type to array of object for view param of set_view

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

    • Enhanced accessibility and testing capabilities by adding data-cy attributes to various components in the app.
    • Introduced new classes and methods for interacting with the operators browser and view bar in a web application.
    • Implemented functionality for testing built-in operators, including setting up test scenarios and verifying functionality.
    • Added serialization and setting of views in an E2E context using fiftyone operators.
  • Chores

    • Declared FIFTYONE_PLUGINS_DIR in the workflow for plugins directory setup.

@imanjra imanjra requested a review from a team March 26, 2024 13:15
Copy link
Contributor

coderabbitai bot commented Mar 26, 2024

Walkthrough

The recent updates focus on enhancing the testing and user interaction aspects of the application. New attributes like data-cy have been added to components for easier testing. Additionally, new classes and methods have been introduced in the end-to-end testing framework to interact with specific elements like the operators browser and view bar, enabling more robust testing scenarios.

Changes

File Summary
.../components/ViewBar/ViewBar.tsx
.../operators/OperatorBrowser.tsx
Added data-cy attributes for testing purposes.
.../operators/OperatorPalette.tsx Enhanced dialogProps for styling in Dialog component.
.../e2e-pw/src/oss/poms/... Introduces classes for interacting with browser elements.
.../e2e-pw/src/oss/specs/operators/built-in-operators.spec.ts Adds testing functionality for built-in operators.
.../shared/assets/plugins/e2e/__init__.py Implements view serialization and setting in E2E context.
.github/workflows/e2e.yml Configures workspace directory for plugins.

🐇✨
Testing elements with care,
Attributes added, changes rare.
Classes new, methods bold,
Testing tales forever told.
Code whispers, tests sing,
In the realm of software, a rabbit's spring.
🌟🐾

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:

Note: Auto-reply has been disabled for this repository by the repository owner. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • 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/coderabbit-overrides.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.

Copy link

codecov bot commented Mar 26, 2024

Codecov Report

Attention: Patch coverage is 43.63636% with 93 lines in your changes are missing coverage. Please review.

❗ No coverage uploaded for pull request base (release/v0.23.8@9936292). Click here to learn what that means.

❗ Current head abbdd1c differs from pull request most recent head 5e98e03. Consider uploading reports for the commit 5e98e03 to get more accurate results

Files Patch % Lines
app/packages/spaces/src/components/Space.tsx 0.00% 54 Missing ⚠️
app/packages/operators/src/OperatorPalette.tsx 0.00% 7 Missing ⚠️
app/packages/spaces/src/SpaceTree.ts 0.00% 6 Missing ⚠️
app/packages/app/src/pages/IndexPage.tsx 0.00% 3 Missing ⚠️
app/packages/plugins/src/externalize.ts 0.00% 3 Missing ⚠️
...pp/packages/looker/src/elements/common/controls.ts 50.00% 2 Missing ⚠️
app/packages/operators/src/OperatorBrowser.tsx 0.00% 2 Missing ⚠️
app/packages/spaces/src/SpaceNode.tsx 0.00% 2 Missing ⚠️
app/packages/state/src/hooks/useSessionSpaces.ts 0.00% 2 Missing ⚠️
...p/packages/core/src/components/ViewBar/ViewBar.tsx 0.00% 1 Missing ⚠️
... and 11 more
Additional details and impacted files
@@                Coverage Diff                 @@
##             release/v0.23.8    #4198   +/-   ##
==================================================
  Coverage                   ?   27.99%           
==================================================
  Files                      ?      814           
  Lines                      ?   101649           
  Branches                   ?     1178           
==================================================
  Hits                       ?    28456           
  Misses                     ?    73193           
  Partials                   ?        0           
Flag Coverage Δ
app 15.56% <43.63%> (?)
python 99.23% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 7bf3485 and c97eaeb.
Files selected for processing (1)
  • app/packages/operators/src/built-in-operators.ts (1 hunks)
Additional comments: 1
app/packages/operators/src/built-in-operators.ts (1)
  • 473-473: The modification to the SetView class's resolveInput method, changing the view parameter to accept an array of objects, aligns with the PR's objective to enhance data view flexibility. This change allows for more complex data view configurations, which can significantly improve user experience by enabling more nuanced data manipulation and visualization within the FiftyOne application.

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 Status

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between c97eaeb and 0d1ed14.
Files ignored due to path filters (2)
  • e2e-pw/package.json is excluded by !**/*.json
  • e2e-pw/src/shared/assets/plugins/e2e/fiftyone.yml is excluded by !**/*.yml
Files selected for processing (8)
  • .github/workflows/e2e.yml (1 hunks)
  • app/packages/core/src/components/ViewBar/ViewBar.tsx (1 hunks)
  • app/packages/operators/src/OperatorBrowser.tsx (2 hunks)
  • app/packages/operators/src/OperatorPalette.tsx (3 hunks)
  • e2e-pw/src/oss/poms/operators/operators-browser.ts (1 hunks)
  • e2e-pw/src/oss/poms/viewbar/viewbar.ts (1 hunks)
  • e2e-pw/src/oss/specs/operators/built-in-operators.spec.ts (1 hunks)
  • e2e-pw/src/shared/assets/plugins/e2e/init.py (1 hunks)
Files skipped from review due to trivial changes (1)
  • app/packages/core/src/components/ViewBar/ViewBar.tsx
Additional Context Used
Additional comments not posted (10)
e2e-pw/src/shared/assets/plugins/e2e/__init__.py (2)

6-7: The serialize_view function serializes a view object to JSON. Ensure that the view object's _serialize method is compatible with the json_util.dumps method for accurate serialization.


18-21: The execute method in E2ESetView sets a limited view and triggers the "set_view" event. Given the PR's objective to handle an array of views, consider updating the logic to support multiple views if applicable.

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

3-26: The ViewBarPom class provides methods for interacting with the view bar component. Ensure that the test IDs used (e.g., "view-bar", "btn-clear-view-bar", "view-stage-container") are correctly assigned in the corresponding HTML elements for these methods to work as expected.

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

3-31: The OperatorsBrowserPom class provides methods for interacting with the operators browser component. Ensure that the test IDs used (e.g., "operators-browser", "action-browse-operations", "operators-browser-search") are correctly assigned in the corresponding HTML elements for these methods to work as expected.

e2e-pw/src/oss/specs/operators/built-in-operators.spec.ts (1)

54-59: The test case "Built-in operators: set view" verifies the "set view" functionality. Ensure that the "E2E: Set view" operator and the "Limit3" view stage are correctly implemented and that this test aligns with the expected behavior after the PR changes.

.github/workflows/e2e.yml (1)

15-15: The addition of the FIFTYONE_PLUGINS_DIR environment variable is a good practice for specifying the directory for plugins. Ensure that the specified path (${{ github.workspace }}/src/shared/assets/plugins) correctly points to the intended directory for plugins.

app/packages/operators/src/OperatorBrowser.tsx (2)

147-147: The addition of the data-cy="operators-browser-search" attribute is a good practice for facilitating testing. Ensure that this attribute is used consistently in tests that interact with the search input field.


176-176: The addition of the data-cy="operators-browser" attribute to the PaperProps of the dialog component is a good practice for testing. Ensure that this attribute is used consistently in tests that interact with the operators browser dialog.

app/packages/operators/src/OperatorPalette.tsx (2)

48-48: The introduction of the dialogProps property in the OperatorPaletteProps interface allows for more flexible configuration of the Dialog component. Ensure that this new property is documented and used consistently across the application.


91-101: The usage of the dialogProps property to merge existing PaperProps with a new style setting (backgroundImage: "none") is a good practice for enhancing component flexibility. Ensure that this approach does not inadvertently override important existing properties.

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 Status

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between c97eaeb and 91c1e38.
Files ignored due to path filters (1)
  • e2e-pw/src/shared/assets/plugins/e2e/fiftyone.yml is excluded by !**/*.yml
Files selected for processing (8)
  • .github/workflows/e2e.yml (1 hunks)
  • app/packages/core/src/components/ViewBar/ViewBar.tsx (1 hunks)
  • app/packages/operators/src/OperatorBrowser.tsx (2 hunks)
  • app/packages/operators/src/OperatorPalette.tsx (3 hunks)
  • e2e-pw/src/oss/poms/operators/operators-browser.ts (1 hunks)
  • e2e-pw/src/oss/poms/viewbar/viewbar.ts (1 hunks)
  • e2e-pw/src/oss/specs/operators/built-in-operators.spec.ts (1 hunks)
  • e2e-pw/src/shared/assets/plugins/e2e/init.py (1 hunks)
Files skipped from review as they are similar to previous changes (8)
  • .github/workflows/e2e.yml
  • app/packages/core/src/components/ViewBar/ViewBar.tsx
  • app/packages/operators/src/OperatorBrowser.tsx
  • app/packages/operators/src/OperatorPalette.tsx
  • e2e-pw/src/oss/poms/operators/operators-browser.ts
  • e2e-pw/src/oss/poms/viewbar/viewbar.ts
  • e2e-pw/src/oss/specs/operators/built-in-operators.spec.ts
  • e2e-pw/src/shared/assets/plugins/e2e/init.py
Additional Context Used

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 Status

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between c97eaeb and abbdd1c.
Files ignored due to path filters (1)
  • e2e-pw/src/shared/assets/plugins/e2e/fiftyone.yml is excluded by !**/*.yml
Files selected for processing (8)
  • .github/workflows/e2e.yml (1 hunks)
  • app/packages/core/src/components/ViewBar/ViewBar.tsx (1 hunks)
  • app/packages/operators/src/OperatorBrowser.tsx (2 hunks)
  • app/packages/operators/src/OperatorPalette.tsx (3 hunks)
  • e2e-pw/src/oss/poms/operators/operators-browser.ts (1 hunks)
  • e2e-pw/src/oss/poms/viewbar/viewbar.ts (1 hunks)
  • e2e-pw/src/oss/specs/operators/built-in-operators.spec.ts (1 hunks)
  • e2e-pw/src/shared/assets/plugins/e2e/init.py (1 hunks)
Files skipped from review as they are similar to previous changes (8)
  • .github/workflows/e2e.yml
  • app/packages/core/src/components/ViewBar/ViewBar.tsx
  • app/packages/operators/src/OperatorBrowser.tsx
  • app/packages/operators/src/OperatorPalette.tsx
  • e2e-pw/src/oss/poms/operators/operators-browser.ts
  • e2e-pw/src/oss/poms/viewbar/viewbar.ts
  • e2e-pw/src/oss/specs/operators/built-in-operators.spec.ts
  • e2e-pw/src/shared/assets/plugins/e2e/init.py
Additional Context Used

@imanjra imanjra changed the base branch from develop to release/v0.23.8 April 2, 2024 18:09
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 Status

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between e53596a and 5e98e03.
Files ignored due to path filters (1)
  • e2e-pw/src/shared/assets/plugins/e2e/fiftyone.yml is excluded by !**/*.yml
Files selected for processing (10)
  • .github/workflows/e2e.yml (1 hunks)
  • app/packages/core/src/components/ViewBar/ViewBar.tsx (1 hunks)
  • app/packages/operators/src/OperatorBrowser.tsx (2 hunks)
  • app/packages/operators/src/OperatorPalette.tsx (3 hunks)
  • app/packages/operators/src/built-in-operators.ts (1 hunks)
  • e2e-pw/src/oss/poms/operators/operators-browser.ts (1 hunks)
  • e2e-pw/src/oss/poms/viewbar/viewbar.ts (1 hunks)
  • e2e-pw/src/oss/specs/operators/built-in-operators.spec.ts (1 hunks)
  • e2e-pw/src/shared/assets/plugins/e2e/init.py (1 hunks)
  • setup.py (1 hunks)
Files skipped from review as they are similar to previous changes (9)
  • .github/workflows/e2e.yml
  • app/packages/core/src/components/ViewBar/ViewBar.tsx
  • app/packages/operators/src/OperatorBrowser.tsx
  • app/packages/operators/src/OperatorPalette.tsx
  • app/packages/operators/src/built-in-operators.ts
  • e2e-pw/src/oss/poms/operators/operators-browser.ts
  • e2e-pw/src/oss/poms/viewbar/viewbar.ts
  • e2e-pw/src/oss/specs/operators/built-in-operators.spec.ts
  • e2e-pw/src/shared/assets/plugins/e2e/init.py
Additional comments not posted (1)
setup.py (1)

19-19: The version update from "0.23.7" to "0.23.8" is noted and appears correct. Ensure that this version change is reflected in all relevant documentation, release notes, and any other dependencies that might be affected by this update.

Copy link
Contributor

@sashankaryal sashankaryal left a comment

Choose a reason for hiding this comment

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

lgtm! new pom looks 🚀

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.

None yet

2 participants