* feat(UN-2679): Add support for external usage tracking plugins
- Pass request metadata through workflow execution chain
- Add execution context passing for plugin systems
- Support caching of request metadata during async execution
This enables the workflow execution system to pass context data
to optional plugins. All changes are backward compatible.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* refactor(UN-2679): Update API usage tracking with review feedback
- Pass request object to plugin instead of exposing headers in OSS
- Improve error handling and logging for resilience
- Remove internal implementation comments
- Make header caching non-fatal with proper error messages
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* UN-2679 Pass request.META instead of full request to plugin
Improve security by passing only request.META dictionary to the plugin
instead of the entire request object. This limits what the plugin can access
and provides a cleaner interface.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* UN-2679 Optimize to pass only request.META instead of full request
Since the request parameter was introduced in this PR for API hub usage tracking,
optimize it to only pass request.META which is all that's needed. This provides:
- Better interface clarity (parameter name shows what's needed)
- Improved security (no full request object passed around)
- Cleaner separation of concerns
Changes:
- api_deployment_views.py: Pass request.META instead of full request
- deployment_helper.py: Accept request_meta parameter instead of request
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* UN-2679 Clean up API hub usage tracking and switch to request.headers
Major improvements to API hub usage tracking:
- Switch from request.META to request.headers following doc-splitter pattern
- Simplify Celery task to call store_usage() directly with no header conversion
- Eliminate double header format conversion for better performance
Changes:
- api_deployment_views.py: Pass dict(request.headers) instead of request.META
- deployment_helper.py: Accept request_headers parameter
- file_execution_tasks.py: Direct store_usage() call, no double conversion
Performance: Eliminates unnecessary header format conversion
Security: Only passes required headers, not full request object
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Refactoring
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* improvements
* Updated usage_metrics to get page_count aloen
* Updated usage_metrics to page_count
* updated logic for fiel based usage tracking
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Refactoring as per git comments
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Removign unwanted code
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* python version updated from 3.9 into 3.12
* x2text-service updated with uv and python version 3.12
* x2text-service docker file updated
* Unstract packages updated with uv
* Runner updated with uv
* Promptservice updated with uv
* Platform service updated with uv
* backend service updated with uv
* root pyproject.toml file updated
* sdk version updated in services
* unstract package modules updated based on sdk version:
* docker file update
* pdm lock workflow modified to support uv
* Docs updated based on uv support
* lock automation updated
* snowflake module version updated into 3.14.0
* tox updated to support UV
* tox updated to support UV
* tox updated with pytest
* tox updated with pytest-md-report
* tox updated with module requirements
* python migration from 3.9 to 3.12
* tox updated with module requirements
* runner updated
* Commit uv.lock changes
* runner updated
* Commit uv.lock changes
* pytest.ini added
* x2text-service docker file updated
* pytest.ini removed
* environment updated to test
* docformatter commented on pre-commit
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* some pre-commit issues ignored
* some pre-commit issues ignored
* some pre-commit issues ignored
* some pre-commit issues ignored
* some pre-commit issues ignored
* pre-commit updates
* un used import removed from platfrom service controller
* tox issue fixed
* tox issue fixed
* docker files updated
* backend dockerfile updated
* open installation issue fixed
* Tools docker file updated with base python version 3.12
* python version updated into min 3.12 in pyproject.toml
* linting issue fixed
* uv version upgraded into 0.6.14
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* migrations excluded from ruff
* added PoethePoet task runner
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* feat: Added poe tasks for services (#1248)
* Added poe tasks for services
* reverted FE change made by mistake
* updated tool-sidecar to uv and python to 3.12.9
* minor updates in pyproject descreption
* feat: platform-service logging improvements (#1255)
feat: Used flask util from core to improve logging in platform-service, added core as a dependency to platform-service:
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix: Platform-service build issue and numpy issue with Python 3.12 (#1258)
* fix: Platform-service build and numpy issue with Py 3.12
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix: Removed backend dockerfile install statements for numpy
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* minor: Handled scenario when cost is not calculated due to no usage
* minor: Corrected content shown for workflow input
* fix: Minor fixes, used gthread for prompt-service, runner
* Commit uv.lock changes
* Removed unused line in tool dockerfile
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Chandrasekharan M <chandrasekharan@zipstack.com>
Co-authored-by: Chandrasekharan M <117059509+chandrasekharan-zipstack@users.noreply.github.com>
Co-authored-by: ali-zipstack <muhammad.ali@zipstack.com>