feat: add aap_job_template_id support to Hook class#2759
Conversation
|
Report bugs in Issues Welcome! 🎉This pull request will be automatically processed with the following features: 🔄 Automatic Actions
📋 Available CommandsPR Status Management
Review & Approval
Testing & Validation
Cherry-pick Operations
Branch Management
Label Management
✅ Merge RequirementsThis PR will be automatically approved when the following conditions are met:
📊 Review ProcessApprovers and ReviewersApprovers:
Reviewers:
Available Labels
AI Features
Security Checks
💡 Tips
For more information, please refer to the project documentation or contact the maintainers. |
|
Warning Review limit reached
Next review available in: 25 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughHook now accepts an optional ChangesHook AAP job template support
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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 |
PR Summary by QodoAdd AAP/AWX job template support to MTV Hook resource
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo
1. Positional args API break
|
a19aa01 to
3f9a036
Compare
3f9a036 to
517e05f
Compare
|
/verified |
|
AmenB is not allowed to run commands.
|
|
/add-allowed-user @AmenB |
|
@AmenB is now allowed to run commands |
|
/verified |
517e05f to
9fe6f7c
Compare
Add support for AAP (Ansible Automation Platform) hooks. When aap_job_template_id is set, to_dict() produces spec.aap.jobTemplateId instead of spec.image + spec.playbook. The two hook types are mutually exclusive. Also adds type annotations to all __init__ parameters.
9fe6f7c to
0510388
Compare
|
/lgtm |
| self.res["spec"] = {} | ||
| _spec = self.res["spec"] | ||
| if self.aap_job_template_id is not None: | ||
| _spec["aap"] = {"jobTemplateId": self.aap_job_template_id} |
There was a problem hiding this comment.
@myakove I think that we should get here app (as we do now with new generated resources). wdyt?
| }, | ||
| }) | ||
| self.res["spec"] = {} | ||
| _spec = self.res["spec"] |
There was a problem hiding this comment.
can app and playbook \ image co-exist? iiuc, they cannot. while we do not validate that (the api should); we have opinionated ordering here - i.e if a user passes both, we give app presedence. @myakove wdyt?
Summary
Add
aap_job_template_idparameter to theHookclass, enabling MTV AAP hook integration — Hook CRs that trigger AWX/AAP job templates during migration instead of running playbooks in containers.What changed
aap_job_template_id=NoneonHook.__init__().to_dict():aap_job_template_idis set → producesspec.aap.jobTemplateId.spec.image+spec.playbook(existing behavior, unchanged).No regression — existing callers that don't pass
aap_job_template_idhit the original code path.Why
The
mtv-api-testsproject (branchfeat/aap-hook-integration) has a new AAP hook integration test that creates a Hook CR viaHook(aap_job_template_id=9). Without this wrapper change, it fails with:Confirmed by running the test against the current PyPI release (11.0.134).
Related Jira tickets
Polarion: MTV-781
Summary by CodeRabbit
spec.aap.jobTemplateIdwhen a job template ID is provided.spec.image/playbook structure.