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

[YUNIKORN-2972] Remove internal object from user and group REST info #993

Closed
wants to merge 1 commit into from

Conversation

wilfred-s
Copy link
Contributor

What is this PR for?

Remove the Resource object from the REST response for the user and group trackers. Removed the usage of the DAO objects in the internal unit tests. The unit tests use new functions which directly expose the same structures without using the DAO.

Cleanup:

  • remove export from internal functions (UserTracker, GroupTracker)
  • renamed functions to match their results (Manager)
  • update handler to call renamed functions in Manager
  • reimplemented test functions to not use DAO objects (Manager, UserTracker, GroupTracker, QueueTracker)
  • assert function changes to use new functions removing DAO usage (scheduler/utilites_test, scheduler/objects/utilites_test)

What type of PR is it?

  • - Bug Fix
  • - Improvement
  • - Refactoring

What is the Jira issue?

How should this be tested?

Existing unit test cover the code

NOTE: this will break e2e test, the user_group_limit_test uses the DAO directly

Questions:

  • - There is breaking changes for older versions.
  • - It needs documentation.

Remove the Resource object from the REST response for the user and group
trackers. Removed the usage of the DAO objects in the internal unit
tests. The unit tests use new functions which directly expose the same
structures without using the DAO.

Cleanup:
- remove export from internal functions (UserTracker, GroupTracker)
- renamed functions to match their results (Manager)
- update handler to call renamed functions in Manager
- reimplemented test functions to not use DAO objects (Manager,
UserTracker, GroupTracker, QueueTracker)
- assert function changes to use new functions removing DAO usage
(scheduler/utilites_test, scheduler/objects/utilites_test)
Copy link

codecov bot commented Nov 13, 2024

Codecov Report

Attention: Patch coverage is 49.61832% with 66 lines in your changes missing coverage. Please review.

Project coverage is 81.31%. Comparing base (6ef347b) to head (7bd48c9).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
pkg/scheduler/ugm/queue_tracker.go 58.49% 21 Missing and 1 partial ⚠️
pkg/scheduler/ugm/group_tracker.go 38.46% 16 Missing ⚠️
pkg/scheduler/ugm/user_tracker.go 38.46% 16 Missing ⚠️
pkg/scheduler/ugm/manager.go 50.00% 8 Missing ⚠️
pkg/webservice/handlers.go 60.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #993      +/-   ##
==========================================
- Coverage   81.50%   81.31%   -0.19%     
==========================================
  Files          97       97              
  Lines       15520    15587      +67     
==========================================
+ Hits        12649    12675      +26     
- Misses       2592     2632      +40     
- Partials      279      280       +1     

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

Copy link
Contributor

@craigcondit craigcondit left a comment

Choose a reason for hiding this comment

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

+1 LGTM.

@wilfred-s wilfred-s deleted the YUNIKORN-2972 branch November 13, 2024 23:17
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