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

Backport permission control to pr integr #314

Conversation

wanglam
Copy link
Collaborator

@wanglam wanglam commented Apr 3, 2024

Description

  1. Manual backport OSD permission control PR
  2. Fix workspace list page always rendering

Issues Resolved

Screenshot

Testing the changes

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

…ject#6052)

* Add permission control for workspace

Signed-off-by: Lin Wang <[email protected]>

* Add changelog for permission control in workspace

Signed-off-by: Lin Wang <[email protected]>

* Fix integration tests and remove no need type

Signed-off-by: Lin Wang <[email protected]>

* Update permission enabled for workspace CRUD integration tests

Signed-off-by: Lin Wang <[email protected]>

* Change back to config schema

Signed-off-by: Lin Wang <[email protected]>

* feat: do not append workspaces field when no workspaces present (#6)

* feat: do not append workspaces field when no workspaces present

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: do not append workspaces field when no workspaces present

Signed-off-by: SuZhou-Joe <[email protected]>

---------

Signed-off-by: SuZhou-Joe <[email protected]>

* fix: authInfo destructure (#7)

* fix: authInfo destructure

Signed-off-by: SuZhou-Joe <[email protected]>

* fix: unit test error

Signed-off-by: SuZhou-Joe <[email protected]>

---------

Signed-off-by: SuZhou-Joe <[email protected]>

* Fix permissions assign in attributes

Signed-off-by: Lin Wang <[email protected]>

* Remove deleteByWorkspace since not exists

Signed-off-by: Lin Wang <[email protected]>

* refactor: remove formatWorkspacePermissionModeToStringArray

Signed-off-by: Lin Wang <[email protected]>

* Remove current not used code

Signed-off-by: Lin Wang <[email protected]>

* Add missing unit tests for permission control

Signed-off-by: Lin Wang <[email protected]>

* Update workspaces API test describe

Signed-off-by: Lin Wang <[email protected]>

* Fix workspace CRUD API integration tests failed

Signed-off-by: Lin Wang <[email protected]>

* Address PR comments

Signed-off-by: Lin Wang <[email protected]>

* Store permissions when savedObjects.permissions.enabled

Signed-off-by: Lin Wang <[email protected]>

* Add permission control for deleteByWorkspace

Signed-off-by: Lin Wang <[email protected]>

* Update src/plugins/workspace/server/permission_control/client.ts

Signed-off-by: SuZhou-Joe <[email protected]>

* Update src/plugins/workspace/server/permission_control/client.ts

Signed-off-by: SuZhou-Joe <[email protected]>

* Refactor permissions field in workspace create and update API

Signed-off-by: Lin Wang <[email protected]>

* Fix workspace CRUD API integration tests

Signed-off-by: Lin Wang <[email protected]>

---------

Signed-off-by: Lin Wang <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Co-authored-by: SuZhou-Joe <[email protected]>
Signed-off-by: Lin Wang <[email protected]>
@wanglam wanglam force-pushed the backport-permission-control-to-pr-integr branch from 9b6e6c8 to 79b7271 Compare April 3, 2024 15:26
@codecov-commenter
Copy link

Codecov Report

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

Project coverage is 67.07%. Comparing base (55d9b82) to head (79b7271).

Files Patch % Lines
...orkspace/public/components/workspace_form/utils.ts 29.72% 24 Missing and 2 partials ⚠️
src/plugins/workspace/server/routes/index.ts 13.33% 13 Missing ⚠️
src/plugins/workspace/server/workspace_client.ts 0.00% 2 Missing ⚠️
...ic/components/workspace_form/use_workspace_form.ts 80.00% 0 Missing and 1 partial ⚠️
...components/workspace_updater/workspace_updater.tsx 85.71% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@                   Coverage Diff                    @@
##           workspace-pr-integr     #314       +/-   ##
========================================================
+ Coverage                55.94%   67.07%   +11.13%     
========================================================
  Files                     2254     3346     +1092     
  Lines                    42167    65065    +22898     
  Branches                  7483    10506     +3023     
========================================================
+ Hits                     23589    43642    +20053     
- Misses                   17152    18894     +1742     
- Partials                  1426     2529     +1103     
Flag Coverage Δ
Linux_ 66.41% <46.91%> (?)
_1 32.68% <44.44%> (?)
_2 ?
_3 43.48% <0.00%> (?)
_4 35.16% <0.00%> (ø)

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.

@wanglam wanglam marked this pull request as ready for review April 7, 2024 02:15
@wanglam wanglam requested a review from SuZhou-Joe as a code owner April 7, 2024 02:15
@raintygao raintygao merged commit b2ab2bd into ruanyl:workspace-pr-integr Apr 7, 2024
41 of 45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants