Skip to content

token based login for flash scicat #347

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

Merged
merged 10 commits into from
Feb 25, 2024
Merged

token based login for flash scicat #347

merged 10 commits into from
Feb 25, 2024

Conversation

zain-sohail
Copy link
Member

@zain-sohail zain-sohail commented Feb 21, 2024

Suggested by @kutnyakhov in #345 , simple fix that only affects the flashloader so would be nice to merge quickly.

I will try to add tests, but might be tricky considering it's an API call.

@coveralls
Copy link
Collaborator

coveralls commented Feb 21, 2024

Pull Request Test Coverage Report for Build 8031202180

Details

  • 43 of 46 (93.48%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.4%) to 91.525%

Changes Missing Coverage Covered Lines Changed/Added Lines %
sed/loader/flash/loader.py 2 3 66.67%
sed/loader/flash/metadata.py 10 12 83.33%
Totals Coverage Status
Change from base Build 8009411740: 0.4%
Covered Lines: 5983
Relevant Lines: 6537

💛 - Coveralls

@zain-sohail
Copy link
Member Author

I have added tests by mocking the requests from server.

The pytest fixture library for this is requests-mock.
Tests seems to run but on Pypi it said that it's only valid up to python 3.10 so I am not fully certain if it works on 3.11

@rettigl
Copy link
Member

rettigl commented Feb 22, 2024

I added a manual workflow trigger for the multiversion tests, and ran them on this branch, seems to work fine also with 3.11

Copy link
Member

@rettigl rettigl left a comment

Choose a reason for hiding this comment

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

LGTM. Good addition would be, as said, a mechanism to provide the token directly from the example notebook in a prepared fashion, so one does not have to edit config files all the time.

@zain-sohail zain-sohail requested a review from rettigl February 23, 2024 17:18
Copy link
Member

@rettigl rettigl left a comment

Choose a reason for hiding this comment

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

I cannot really test this, as I don't have a scicat token, and don't know which URL to use. None if the FLASH metadata stuff is really documented in examples, I suggest this should be still added, so users understand what to do.
From reading the code, I think it should be fine.

@zain-sohail zain-sohail merged commit 8bdf418 into main Feb 25, 2024
@zain-sohail zain-sohail deleted the flash-metadata branch February 25, 2024 16:19
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.

3 participants