Skip to content

Conversation

@bobbai00
Copy link
Contributor

@bobbai00 bobbai00 commented Jul 6, 2024

This PR removes the concept Environment. The latest ER-diagram of our system should be:
Screenshot 2024-07-06 at 2 40 33 PM

Here are graphs to show the before-after, also the delta:
Texera-ER-before-after

texera-architecture-compare-delta

In order to incorporate this ER diagram, several designs are implemented.

0. DDL Changes

Tables and columns related to environment are now removed

use `texera_db`;

ALTER TABLE `environment_of_workflow`
    DROP FOREIGN KEY `environment_of_workflow_ibfk_2`;

ALTER TABLE `dataset_of_environment`
    DROP FOREIGN KEY `dataset_of_environment_ibfk_1`;

ALTER TABLE `dataset_of_environment`
    DROP FOREIGN KEY `dataset_of_environment_ibfk_2`;

ALTER TABLE `workflow_executions`
    DROP FOREIGN KEY `workflow_executions_ibfk_3`;
-- Dropping the dependent tables
DROP TABLE IF EXISTS `environment_of_workflow`;
DROP TABLE IF EXISTS `dataset_of_environment`;

-- Dropping the environment table
DROP TABLE IF EXISTS `environment`;

ALTER TABLE `workflow_executions`
    DROP COLUMN `environment_eid`;

1. File URI

To uniquely identify a file globally, the URI is now in the format of:

/${ownerEmail}/${datasetName}/${versionName}/${fileRelativePath}

For example, for user texera@uci.edu, a file tweets/california.csv in dataset Twitter, version v3. The URI is:

/texera@uci.edu/Twitter/v3/tweets/california.csv

2. Workflow Sharing

When sharing a workflow to another user, only the files scanned by this workflow are visible to the users. The dataset access will NOT be propagated through this sharing

Demo

First of all, the environment tab is removed:
Screenshot 2024-07-06 at 2 45 19 PM

To scan a source file, users no need to add datasets explicitly to somewhere, user can select files from all accessible datasets and versions.
Screenshot 2024-07-06 at 3 00 24 PM

2024-07-06 14 46 49

Future Work

Currently, datasets are loaded fully and frequently. This can result in the GUI not responsive and fluent enough. An ongoing effort led by one of our team member is to improve the file selection interaction logic. This PR can make the loading lazily happen, and make the search of datasets & file much more easier

@bobbai00 bobbai00 requested a review from aglinxinyuan July 6, 2024 22:01
@bobbai00 bobbai00 self-assigned this Jul 6, 2024
@bobbai00 bobbai00 added the ddl-change Changes to the TexeraDB DDL label Jul 6, 2024
@bobbai00 bobbai00 force-pushed the jiadong-remove-environment branch from d1cfeaf to 086bcee Compare July 8, 2024 04:22
Copy link
Contributor

@aglinxinyuan aglinxinyuan left a comment

Choose a reason for hiding this comment

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

LGTM!

@bobbai00 bobbai00 force-pushed the jiadong-remove-environment branch from 2a5961c to 4f1d5d2 Compare July 21, 2024 23:52
@bobbai00 bobbai00 force-pushed the jiadong-remove-environment branch from 36ac819 to b574527 Compare July 23, 2024 15:55
@bobbai00 bobbai00 merged commit 1fa249a into master Jul 23, 2024
@bobbai00 bobbai00 deleted the jiadong-remove-environment branch July 23, 2024 21:24
@chenlica
Copy link
Contributor

@bobbai00 : the diagrams are very nice. Per our discussion, please add comments about how to improve the interface to allow a user to select a file (as a future PR).

chenlica pushed a commit that referenced this pull request Dec 28, 2025
<!--
Thanks for sending a pull request (PR)! Here are some tips for you:
1. If this is your first time, please read our contributor guidelines:
[Contributing to
Texera](https://github.com/apache/texera/blob/main/CONTRIBUTING.md)
  2. Ensure you have added or run the appropriate tests for your PR
  3. If the PR is work in progress, mark it a draft on GitHub.
  4. Please write your PR title to summarize what this PR proposes, we 
    are following Conventional Commits style for PR titles as well.
  5. Be sure to keep the PR description updated to reflect all changes.
-->

### What changes were proposed in this PR?
<!--
Please clarify what changes you are proposing. The purpose of this
section
is to outline the changes. Here are some tips for you:
  1. If you propose a new API, clarify the use case for a new API.
  2. If you fix a bug, you can clarify why it is a bug.
  3. If it is a refactoring, clarify what has been changed.
  3. It would be helpful to include a before-and-after comparison using 
     screenshots or GIFs.
  4. Please consider writing useful notes for better and faster reviews.
-->
This PR proposes to remove the unused `retrieveDatasetSingleFile()`
endpoint (GET /api/dataset/file) which was allowing unauthenticated
downloads of non-downloadable datasets.

### Any related issues, documentation, discussions?
<!--
Please use this section to link other resources if not mentioned
already.
1. If this PR fixes an issue, please include `Fixes #1234`, `Resolves
#1234`
or `Closes #1234`. If it is only related, simply mention the issue
number.
  2. If there is design documentation, please add the link.
  3. If there is a discussion in the mailing list, please add the link.
-->

The endpoint is introduced in the PR #2391 which adds dataset APIs to
the webserver. Then it is modified in the PR #2719 which aims to remove
the concept of `Environment`.

### How was this PR tested?
<!--
If tests were added, say they were added here. Or simply mention that if
the PR
is tested with existing test cases. Make sure to include/update test
cases that
check the changes thoroughly including negative and positive cases if
possible.
If it was tested in a way different from regular unit tests, please
clarify how
you tested step by step, ideally copy and paste-able, so that other
reviewers can
test and check, and descendants can verify in the future. If tests were
not added,
please describe why they were not added and/or why it was difficult to
add.
-->
Manually tested:
<img width="690" height="404" alt="Screenshot 2025-12-27 at 1 15 21 AM"
src="https://github.com/user-attachments/assets/91bea787-d447-4abe-ad39-74eb581fa657"
/>

### Was this PR authored or co-authored using generative AI tooling?
<!--
If generative AI tooling has been used in the process of authoring this
PR,
please include the phrase: 'Generated-by: ' followed by the name of the
tool
and its version. If no, write 'No'. 
Please refer to the [ASF Generative Tooling
Guidance](https://www.apache.org/legal/generative-tooling.html) for
details.
-->
No.
carloea2 pushed a commit to carloea2/texera that referenced this pull request Jan 6, 2026
<!--
Thanks for sending a pull request (PR)! Here are some tips for you:
1. If this is your first time, please read our contributor guidelines:
[Contributing to
Texera](https://github.com/apache/texera/blob/main/CONTRIBUTING.md)
  2. Ensure you have added or run the appropriate tests for your PR
  3. If the PR is work in progress, mark it a draft on GitHub.
  4. Please write your PR title to summarize what this PR proposes, we 
    are following Conventional Commits style for PR titles as well.
  5. Be sure to keep the PR description updated to reflect all changes.
-->

### What changes were proposed in this PR?
<!--
Please clarify what changes you are proposing. The purpose of this
section
is to outline the changes. Here are some tips for you:
  1. If you propose a new API, clarify the use case for a new API.
  2. If you fix a bug, you can clarify why it is a bug.
  3. If it is a refactoring, clarify what has been changed.
  3. It would be helpful to include a before-and-after comparison using 
     screenshots or GIFs.
  4. Please consider writing useful notes for better and faster reviews.
-->
This PR proposes to remove the unused `retrieveDatasetSingleFile()`
endpoint (GET /api/dataset/file) which was allowing unauthenticated
downloads of non-downloadable datasets.

### Any related issues, documentation, discussions?
<!--
Please use this section to link other resources if not mentioned
already.
1. If this PR fixes an issue, please include `Fixes apache#1234`, `Resolves
apache#1234`
or `Closes apache#1234`. If it is only related, simply mention the issue
number.
  2. If there is design documentation, please add the link.
  3. If there is a discussion in the mailing list, please add the link.
-->

The endpoint is introduced in the PR apache#2391 which adds dataset APIs to
the webserver. Then it is modified in the PR apache#2719 which aims to remove
the concept of `Environment`.

### How was this PR tested?
<!--
If tests were added, say they were added here. Or simply mention that if
the PR
is tested with existing test cases. Make sure to include/update test
cases that
check the changes thoroughly including negative and positive cases if
possible.
If it was tested in a way different from regular unit tests, please
clarify how
you tested step by step, ideally copy and paste-able, so that other
reviewers can
test and check, and descendants can verify in the future. If tests were
not added,
please describe why they were not added and/or why it was difficult to
add.
-->
Manually tested:
<img width="690" height="404" alt="Screenshot 2025-12-27 at 1 15 21 AM"
src="https://github.com/user-attachments/assets/91bea787-d447-4abe-ad39-74eb581fa657"
/>

### Was this PR authored or co-authored using generative AI tooling?
<!--
If generative AI tooling has been used in the process of authoring this
PR,
please include the phrase: 'Generated-by: ' followed by the name of the
tool
and its version. If no, write 'No'. 
Please refer to the [ASF Generative Tooling
Guidance](https://www.apache.org/legal/generative-tooling.html) for
details.
-->
No.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ddl-change Changes to the TexeraDB DDL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants