-
Notifications
You must be signed in to change notification settings - Fork 3
feat: refactor project join tracking into generic tracking framework #702
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
base: upgrade/rocky8-python3.13-develop
Are you sure you want to change the base?
feat: refactor project join tracking into generic tracking framework #702
Conversation
matthew-li
left a comment
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.
Thanks! Took an initial glance and did some light testing in the UI, which looked good.
I made a few changes in a different branch (see one of the comments) to get pytest running within Docker, at least.
We should discuss/align on the testing approach + integrate with what I'd set up previously.
pytest.ini
Outdated
| @@ -0,0 +1,25 @@ | |||
| [tool:pytest] | |||
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.
For the tests I'd introduced (for hardware procurements), I configured pytest in pyproject.toml. Can these options be incorporated there, or does it make sense to configure it in a standalone file?
(Also, I don't think this file exists: DJANGO_SETTINGS_MODULE = coldfront.config.settings.test.)
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've branched off of this in issue_668_progress_tracker_tests_protocol_tmp to address this so that I could get pytest to run (the new tests are error/failing).
Feel free to merge that here if it makes sense, and add any pytest config to pyproject.toml.
| @@ -0,0 +1,23 @@ | |||
| {% extends "common/base.html" %} | |||
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.
Looks to be a stale file from a previous PR.
coldfront/tests/utils/conftest.py
Outdated
| # Test Markers | ||
| # ============================================================================ | ||
|
|
||
| def pytest_configure(config): |
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.
A lot of the contents of this file are duplicated in tests/conftest.py.
|
@helbashandy Summarizing our conversation yesterday:
|
c8699fd to
fc292f8
Compare
- Create reusable tracking framework under coldfront/core/utils/tracking/ - Refactor JoinRequestTracker to inherit from new ModelBasedTracker base class - Maintain complete backward compatibility with existing API and templates - Add comprehensive test suite with 65 test methods covering unit, whitebox, and blackbox scenarios - Establish testing protocol with proper directory structure and configuration - Enable tracking functionality for future use cases beyond project join requests The generic framework provides BaseTracker and ModelBasedTracker abstract classes that can be extended for various request/process tracking needs while ensuring consistent behavior, error handling, and progress visualization across the application.
fc292f8 to
473ea6e
Compare
PR Description
Description
This PR refactors the project-specific join request tracker into a generic, reusable tracking framework while maintaining complete backward compatibility. The motivation is to enable tracking functionality across different areas of ColdFront (allocation renewals, hardware procurements, secure directory requests, etc.) without duplicating tracking logic.
Key Changes:
Generic Tracking Framework (
coldfront/core/utils/tracking/):BaseTracker- Abstract base class for all tracking implementationsModelBasedTracker- Extended base for Django model-based trackingTrackingStepandTrackingResult- Standardized data structuresRefactored Implementation:
JoinRequestTrackerto inherit fromModelBasedTrackerComprehensive Test Suite:
Documentation and Tooling:
No issues fixed - this is a proactive refactoring to improve code reusability and maintainability.
Type of change
How Has This Been Tested?
Test Commands to use - I had an issue with my local env (python version incompatibility that prevented me from installing all the dependencies. @matthew-li - Would you be able to run it on your end? If not, lmk so that I downgrade my version
PR Self Evaluation
Additional Notes: