Repository navigation
Conversation
There was a problem hiding this comment.
Orca Security Scan Summary
| Status | Check | Issues by priority | |
|---|---|---|---|
| Infrastructure as Code | View in Orca | ||
| SAST | View in Orca | ||
| Secrets | View in Orca | ||
| Vulnerabilities | View in Orca |
|
To avoid any confusion in the future about your contribution to Weaviate, we work with a Contributor License Agreement. If you agree, you can simply add a comment to this PR that you agree with the CLA so that we can merge. |
chrikrah
left a comment
There was a problem hiding this comment.
@shadowmodder nothing here blocks a merge from my side. With base.py from 7266681 both zero-time tests fail, and at the head an env user's created_at reads None while a real timestamp still parses.
$ python -m pytest -q -o addopts='' test/test_users.py # head 65a2379, Python 3.12
6 passed, 1 warning in 1.35s
$ python -m pytest -q -o addopts='' test/ # head 65a2379
570 passed, 1 skipped, 39 warnings in 14.70s
# weaviate/users/base.py from 7266681, test/test_users.py kept
$ python -m pytest -q -o addopts='' test/test_users.py
5 failed, 1 passed, 1 warning in 1.09s # 2 zero-time created_at tests, 3 ImportError on the renamed helper
# not run: mock_tests/, integration/, a live server at head
Both createdAt reads now share the helper, and no other client path parses that field.
On my question in the issue: I'd land this without waiting for #2216. Its fixes normalise an already parsed datetime in a pydantic validator, which a string helper does not fit.
|
no CLA signed so we cannot merge this PR |
|
I agree to the CLA |
|
@dirkkul Apologies for the delay — I've now posted the CLA agreement above ("I agree to the CLA"). This was approved by chrikrah and the branch is unchanged. Could you reopen and merge when you get a chance? Thanks! |
Signed-off-by: shadowmodder <sudhirvissa@gmail.com>
…ion coverage Signed-off-by: shadowmodder <sudhirvissa@gmail.com>
Fixes #2243
Summary
users.db.get()andlist_all()passed the server's Go zero time (0001-01-01T00:00:00.000Z) through ascreated_at, so env-defined users came back withdatetime(1, 1, 1)instead ofNone— even thoughUserDB.created_atisOptional[datetime]and the same response'slastUsedAtwas already mapped toNone.What changed
createdAtthrough the zero-time helper in bothget()andlist_all()inweaviate/users/base.py._parse_last_used_atto_parse_optional_timestamp, since it now serves both fields.integration/test_users.pynow asserts the env-defined admin-user'screated_atisNoneintest_get_static_db_user(coversget()) and on its entry intest_list_all_users(coverslist_all()), where the real server sends a zero-timecreatedAt. The earlier_FakeConnectionmock tests intest/test_users.pyare removed.Test report
pytest test/).ruff check,ruff format --check,flake8clean (pinned ruff 0.14.7).