DataFed
DataFed copied to clipboard
[DAPS-1724] - feature python client support task and direct response allocation create
Ticket
#1724
Description
How Has This Been Tested?
Artifacts (if appropriate):
Tasks
- [ ] - A description of the PR has been provided, and a diagram included if it is a new feature.
- [ ] - Formatter has been run
- [ ] - CHANGELOG comment has been added
- [ ] - Labels have been assigned to the pr
- [ ] - A reviwer has been added
- [ ] - A user has been assigned to work on the pr
- [ ] - If new feature a unit test has been added
Summary by Sourcery
Add end-to-end support for authentication and repository creation in the mock core server and Python client, integrate mock core server into the build and CI pipelines, and add Python integration tests.
New Features:
- Implement handlers for AuthenticateByPasswordRequest, AuthenticateByTokenRequest, GetAuthStatusRequest, and RepoCreateRequest in the mock core server
- Expose manualAuthByPassword, manualAuthByToken, getAuthStatus, and repoCreate operations in the Python client
Enhancements:
- Pre-populate session authentication keys and add detailed logging in AuthenticationManager
- Centralize mock constants (credentials, tokens, repository metadata) in MockGlobals
Build:
- Add BUILD_MOCK_CORE_SERVER option and integrate mock core server into CMake build and install targets
- Include Dockerfile and install scripts for building and running the mock core server
CI:
- Add GitLab CI jobs for building, image checking, and retagging the core-mock Docker image
Tests:
- Add Python pytest-based integration tests for MessageLib and CommandLib
- Include CMake support for running Python integration tests and update mock server test fixtures
Chores:
- Rename mock core key files from mock-datafed-core-key to datafed-mock-core-key across scripts and code
Reviewer's Guide
This PR extends the mock core server to handle password/token authentication and repo creation messages, integrates the mock core build into CMake and GitLab CI, adds Docker support, and introduces Python client integration tests for MessageLib and CommandLib.
Class diagram for updated mock core server authentication and repo creation
classDiagram
class MockCoreServer {
+handlePasswordAuth()
+handleTokenAuth()
+handleRepoCreate()
}
class AuthenticationManager {
+verifyPassword()
+verifyToken()
}
class ClientWorker {
+processMessage()
+processRepoCreate()
}
MockCoreServer --> AuthenticationManager : uses
MockCoreServer --> ClientWorker : uses
File-Level Changes
| Change | Details | Files |
|---|---|---|
| Extend mock core server with new message handlers and implementations |
|
tests/mock_core/source/ClientWorker.cpptests/mock_core/source/ClientWorker.hpptests/mock_core/source/AuthenticationManager.cpptests/mock_core/source/AuthenticationManager.hpptests/mock_core/source/MockGlobals.cpptests/mock_core/source/MockGlobals.hpp |
| Update CMake to build and install mock core server |
|
CMakeLists.txttests/CMakeLists.txtpython/datafed_pkg/CMakeLists.txt |
| Add GitLab CI jobs for mock core build and image checks |
|
.gitlab/stage_build.yml.gitlab/stage_image_check.yml.gitlab/build/build_core_mock_image.yml.gitlab/build/force_build_core_mock_image.yml |
| Provide Docker support and install scripts for mock core server |
|
tests/mock_core/docker/Dockerfiletests/mock_core/docker/entrypoint.shscripts/install_mock_core.sh |
| Introduce Python integration tests for the Python client |
|
python/datafed_pkg/tests/integration/test_MessageLib.pypython/datafed_pkg/tests/integration/test_CommandLib.pypython/datafed_pkg/tests/integration/mock_defaults.pypython/datafed_pkg/tests/integration/CMakeLists.txt |
Possibly linked issues
- #1724: PR implements Python client support for task and direct response on allocation creation, adding new client authentication and repo creation integration tests.
- #[Refactor] - Core Mock move to root /tests folder mock core is useful for python client as well: The PR moves the mock core to /tests/mock_core/source and introduces Python client integration tests that utilize the refactored mock core.
Tips and commands
Interacting with Sourcery
-
Trigger a new review: Comment
@sourcery-ai reviewon the pull request. - Continue discussions: Reply directly to Sourcery's review comments.
-
Generate a GitHub issue from a review comment: Ask Sourcery to create an
issue from a review comment by replying to it. You can also reply to a
review comment with
@sourcery-ai issueto create an issue from it. -
Generate a pull request title: Write
@sourcery-aianywhere in the pull request title to generate a title at any time. You can also comment@sourcery-ai titleon the pull request to (re-)generate the title at any time. -
Generate a pull request summary: Write
@sourcery-ai summaryanywhere in the pull request body to generate a PR summary at any time exactly where you want it. You can also comment@sourcery-ai summaryon the pull request to (re-)generate the summary at any time. -
Generate reviewer's guide: Comment
@sourcery-ai guideon the pull request to (re-)generate the reviewer's guide at any time. -
Resolve all Sourcery comments: Comment
@sourcery-ai resolveon the pull request to resolve all Sourcery comments. Useful if you've already addressed all the comments and don't want to see them anymore. -
Dismiss all Sourcery reviews: Comment
@sourcery-ai dismisson the pull request to dismiss all existing Sourcery reviews. Especially useful if you want to start fresh with a new review - don't forget to comment@sourcery-ai reviewto trigger a new review!
Customizing Your Experience
Access your dashboard to:
- Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others.
- Change the review language.
- Add, remove or edit custom review instructions.
- Adjust other review settings.
Getting Help
- Contact our support team for questions or feedback.
- Visit our documentation for detailed guides and information.
- Keep in touch with the Sourcery team by following us on X/Twitter, LinkedIn or GitHub.