[AAP-63314] P4.4: Controller - Pass Workload TTL to Gateway#16303
Draft
arrestle wants to merge 2 commits intoansible:develfrom
Draft
[AAP-63314] P4.4: Controller - Pass Workload TTL to Gateway#16303arrestle wants to merge 2 commits intoansible:develfrom
arrestle wants to merge 2 commits intoansible:develfrom
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[AAP-63314] P4.4: Controller - Pass Workload TTL to Gateway
SUMMARY
Passes
job.timeoutasworkload_ttl_secondswhen Controller requests a workload identity JWT from Gateway, enabling the Gateway to issue JWTs with TTLs matched to the job's expected runtime.This is the final link in the P4 TTL chain:
Design decisions:
instance.timeoutdirectly — this reflects the effective job timeout (from job template, or 0 if not set)job.timeout = 0sendsworkload_ttl_seconds=0, signaling Gateway to use platform default (jwt_default_ttl_seconds)Related:
workload_ttl_secondstorequest_workload_jwt()— seedjango-ansible-base/AAP-63314.pr.md_request_workload_identity_token)ISSUE TYPE
COMPONENT NAME
TESTING INSTRUCTIONS
Unit Tests
make test_unit PYTEST_ARGS="-k workload_ttl_seconds or workload_identity_token"Expected: New parametrized test covers both cases:
test_request_workload_identity_token_workload_ttl_seconds[job-timeout-passed-as-ttl]—job.timeout=3600→workload_ttl_seconds=3600test_request_workload_identity_token_workload_ttl_seconds[no-timeout-sends-zero-for-gateway-fallback]—job.timeout=0→workload_ttl_seconds=0Integration (aap-dev)
ADDITIONAL INFORMATION
Modified files:
awx/main/tasks/jobs.py— one-line addition to_request_workload_identity_token()awx/main/tests/unit/tasks/test_jobs.py— one parametrized test replacing two near-identical testsAssisted-by: Claude