-
Notifications
You must be signed in to change notification settings - Fork 36
feat(workflow-triggers): add pause and resume functionality #2413
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: master
Are you sure you want to change the base?
Conversation
- Add entry for version 7.90.0 with today's date (2025-11-26) - Document new pause/resume functionality and is_paused field - Follow conventional changelog format
- Add pause and resume methods to workflow triggers documentation section - Follow existing documentation patterns and module paths - Generated from docstrings for pause() and resume() methods
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. |
- Change expected error message from 'Workflow trigger not found' to 'Trigger not found' - Match actual API response for non-existent trigger operations - Fix failing integration test test_pause_resume_nonexistent_trigger
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2413 +/- ##
==========================================
- Coverage 91.28% 91.27% -0.01%
==========================================
Files 192 192
Lines 26184 26190 +6
==========================================
+ Hits 23903 23906 +3
- Misses 2281 2284 +3
🚀 New features to boost your workflow:
|
- Remove invalid Returns sections from void methods (pause/resume) - Fix test to expect isPaused field even when None - Remove unused WorkflowTaskExecution import - Address custom repo check failures
- Fix line spacing and remove trailing whitespace - Collapse multiline dictionaries to single lines - Standardize code formatting across test files - Fix test assertion for is_paused field when None - Ensure consistency with project style guidelines
…g permanent one - Create temporary trigger for testing pause/resume functionality - Test pause and resume operations on the new trigger - Clean up trigger after test completes - Remove unnecessary additional tests as requested
…d field - Add test for loading with parent_task_external_id present - Add test for loading without parent_task_external_id (None case) - Covers both workflow test files as requested
Only needed pause/resume tests, not parent_task_external_id tests
- Add pause() and resume() API methods for workflow triggers - Add read-only is_paused field to track trigger state - Include integration tests for pause/resume functionality - Remove self-explanatory comments from code and tests
- Create dedicated trigger for testing instead of using permanent one - Add proper cleanup in finally block to delete test trigger - Use time-based external ID to ensure uniqueness
- Verify trigger remains paused after second pause call - Verify trigger remains resumed after second resume call - Ensures idempotent operations maintain correct state
- Remove unused WorkflowScheduledTriggerRule import - Remove unused WorkflowTrigger import - Remove unnecessary blank lines
Address PR review feedback from @haakonvt: - Remove json={} from pause() POST request - Remove json={} from resume() POST request - POST requests without body content don't need empty json parameter
- Add missing try/except block in finally clause for trigger cleanup - Fix IndentationError that was preventing test from running
- Remove duplicate finally: line that was causing syntax error - Keep only one finally block with proper cleanup code
- Consolidated test coverage into parameterized test_dump_is_paused which handles all cases including None values - Improved test suite cleanliness and maintainability
- Changed is_paused from optional (bool | None) to required (bool) parameter - Moved is_paused before optional parameters to fix syntax - Simplified dump() method to always include is_paused field - Updated _load() method to require isPaused from API response (fail fast) - Updated class docstring to reflect mandatory parameter - Added test case to verify is_paused is always included in dump output
- Per code review feedback, this test was unnecessary - The existing parameterized test already covers is_paused field behavior adequately
- Fixed extra empty line before assert statement - Clean up formatting to have no unnecessary whitespace
- Fixed ruff check failure due to missing newline at end of file - Files must end with a newline character per Python standards
Description
Please describe the change you have made.
Checklist:
If a new method has been added it should be referenced in cognite.rst in order to generate docs based on its docstring.