-
Notifications
You must be signed in to change notification settings - Fork 27
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
1848 add permission rights to async jobs #7262
base: master
Are you sure you want to change the base?
1848 add permission rights to async jobs #7262
Conversation
…low generates latest version
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #7262 +/- ##
==========================================
+ Coverage 86.97% 87.91% +0.94%
==========================================
Files 1686 1176 -510
Lines 65340 50684 -14656
Branches 1115 253 -862
==========================================
- Hits 56829 44560 -12269
+ Misses 8193 6041 -2152
+ Partials 318 83 -235
Continue to review full report in Codecov by Sentry.
|
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.
thx!
|
||
from models_library.users import UserID | ||
from pydantic import BaseModel, model_validator | ||
from typing_extensions import Self | ||
|
||
from ..progress_bar import ProgressReport | ||
|
||
AsyncJobId: TypeAlias = UUID | ||
AsyncJobId: TypeAlias = str |
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.
TIP: I recommend you using IDStr
. It is a constraint string designed for string-based identifiers. In term of strictness it is between str
(weak) and a UUID
(strong)
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.
It's not gonna work. I will unify the identifier with a more properly typed when I do the final integration
|
||
from models_library.users import UserID | ||
from pydantic import BaseModel, model_validator | ||
from typing_extensions import Self | ||
|
||
from ..progress_bar import ProgressReport | ||
|
||
AsyncJobId: TypeAlias = UUID | ||
AsyncJobId: TypeAlias = str |
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.
It's not gonna work. I will unify the identifier with a more properly typed when I do the final integration
for _id in data_export_start.file_and_folder_ids: | ||
_ = await dsm.get_file(user_id=data_export_start.user_id, file_id=_id) |
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.
Q: could you please check if this works with a file within a folder? since the user can select their virtualenv folder (for example) to be exported. I don't recall if the permissions check will work.
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.
looking good! thanks
), | ||
) | ||
assert isinstance(result, AsyncJobGet) | ||
|
||
|
||
async def test_start_data_export_fail( | ||
rpc_client: RabbitMQRPCClient, user_id: UserID, faker: Faker |
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.
I have extensively refactored also the testing. I can show you how to do the testing @GitHK is asking for.
What do these changes do?
storage
before submitting job to workerAsyncJobId
fromuuid.UUID
tostr
in order to support "embedding" metadata into task nameRelated issue/s
How to test
Dev-ops checklist