-
Notifications
You must be signed in to change notification settings - Fork 111
fix: Removing unnecessary user info returned from the backend #4138
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
Conversation
|
@chenlica please review it at your convenience. |
|
@aglinxinyuan Please review this PR. |
|
@aglinxinyuan I reviewed this PR before. Please review it as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR requires major changes. Please don’t introduce features that don’t align with the PR title or with our prior discussion.
Based on our discussion, the agreed plan was “Removing unnecessary user info returned from the backend.” The title accurately reflects that goal. However, this PR significantly modifies the endpoint behavior by making the response dynamic based on the input:
- Change the endpoint /api/workflow/owner_info to accept a new parameter fields to specify the information needed.
- Change the SQL query to accept the new request parameter fields and only return allowed fields (e.g., user name).
Those changes were not part of our plan. We should stick to the agreed design: this endpoint should accept only a workflow ID and always return the owner’s name.
If there are additional changes you’d like to propose, please raise them in a GitHub issue and address them in a separate PR. In general, I don’t think those changes are necessary, as this endpoint is intended to return only the name.
...src/main/scala/org/apache/texera/web/resource/dashboard/user/workflow/WorkflowResource.scala
Show resolved
Hide resolved
...src/main/scala/org/apache/texera/web/resource/dashboard/user/workflow/WorkflowResource.scala
Outdated
Show resolved
Hide resolved
...src/main/scala/org/apache/texera/web/resource/dashboard/user/workflow/WorkflowResource.scala
Outdated
Show resolved
Hide resolved
...src/main/scala/org/apache/texera/web/resource/dashboard/user/workflow/WorkflowResource.scala
Outdated
Show resolved
Hide resolved
frontend/src/app/hub/component/workflow/detail/hub-workflow-detail.component.ts
Outdated
Show resolved
Hide resolved
|
@aglinxinyuan, this content of this PR was suggested by me in a discussion with @carloea2 . I agree with your comments though. We could spllit this PR into two. The first one just removes unnecessary user information, and the second one will include the refactoring in the current PR. What do you think? |
Sure. Introducing a |
|
Got it. Then I will go back to a previous version with only getOwnerName, thank you. |
|
@aglinxinyuan I do prefer a |
We already have several endpoints that return additional user information. This endpoint lives under the workflow sub-URL and is intended to be used only for workflow-related resources. If we decide to unify all user-related endpoints in the future, it may be helpful to first review and align the existing user-related URLs. Introducing a fields parameter here could be interpreted as exposing database-level details to the frontend, which ideally should not need to be aware of individual fields. Additionally, hardcoding field names as strings may increase the risk of the frontend and backend becoming out of sync over time. Would it be reasonable to defer adding this parameter until there is a concrete use case that requires it? |
|
In this case let's ignore this @carloea2 If you agree, let's limit this scope of this PR by just returning the user name. We will NOT do another PR to introduce this |
|
Yes I agree, the changes are available now. Thanks. |
aglinxinyuan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
|
Thanks |
|
@chenlica can you rerun the workflows? |
|
@carloea2 One check failed. Please take a look. |
|
MockTexeraDB is not thread-safe, so that is the reason why my test is failing, is that supposed to be like that...? I can simply move my tests to WorkflowResource, but I think at some time we will need to add new classes that use MockTexeraDB, or is the design to use the same spec for those using DB? I am confused to be honest. This is what is happening if my understanding of the logs is correct: The test fails because the embedded Postgres database it relies on is being shut down while the spec is still running: |
What changes were proposed in this PR?
Currently the endpoint
/api/workflow/owner_user/?wid=Xreturns all the information about the user, including name, email, etc. But the frontend only needs the name. This PR limits the information returned from the backend to the user name only.The main changes are as follow:
/api/workflow/owner_userto/api/workflow/owner_nameWorkflowResourceDashboardUserSpecto test this endpoint and support future testing of related endpoints.Any related issues, documentation, discussions?
No
How was this PR tested?
Tests:

Manually tested:

Was this PR authored or co-authored using generative AI tooling?
No