[AAP-99276] XLAB Make time-estimating fields configurable across all job templates #500
All Vouch review confidence checks passed
Residual risk 0.30 = Change Risk (0.75) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.75 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.075
Real PR Conversation Timeline
1 comments
"Review active on #500"
general
weight: 0.35
kcagran
[AAP-99276] Make time-estimating fields configurable across all job templates
Description
<!-- Mandatory: Provide a clear, concise description of the changes and their purpose -->
- Added an additional PATCH endpoint to TemplateMetadata viewset that does a partial update across all template metadata objects. So if "Time taken to manually execute" and/or "Time taken to create automation" is updated through this endpoint, the change will be applied to all, not just one.
- Added an additional GET endpoint to list all the TemplateMetadata objects (I used this mostly for e2e testing of the PATCH endpoint feature)
- Users want to be able to set the time estimates across all job templates instead of just individual job templates
- See description above
Type of Change
<!-- Mandatory: Check one or more boxes that apply -->
Self-Review Checklist
<!-- These items help ensure quality - they complement our automated CI checks -->
Testing Instructions
<!-- Optional for test-only changes. Mandatory for all other changes -->
<!-- Must be detailed enough for reviewers to reproduce -->
Prerequisites
<!-- List any specific setup required -->
Follow README.md to set up a local environment. Make sure metrics_service is running on localhost:8000 .
1. Run local AWX and Metrics Service databases with all recent migrations.
2. Create the Django superuser superuser (admin or system auditor):
3. Create a normal user normal :
4. Create 5 AWX job templates and a matching TemplateMetadata row for each. The command prints each row's
metadata_id, which is the <ID> used in the steps below:Steps to Test
1. Check the current values of one metadata row. Both fields can be null for rows created in the prerequisites:
2. Set one field on ALL template metadata records. Expect HTTP 200 and {"updated": N} :
3. Repeat step 1 for several of the 5 <ID> s.
time_taken_manually_execute_minutesshould be 30 for each, andtime_taken_create_automation_minutesshould be unchanged.4. Set both fields on all records:
5. Repeat step 1 for several of the 5 <ID> s. Both fields should be 45 and 120 .
6. Validation: a negative value should return HTTP 400:
7. An empty body should return HTTP 400 with a message asking for at least one field:
8. Unsupported methods: PUT and GET on the collection URL should return HTTP 405:
9. Permissions: as the normal user, repeat step 2. Expect HTTP 403 and no values changed:
10. Regression: the single-record endpoint still works. Expect HTTP 200 and only that record changed:
Expected Results
<!-- Describe what should happen after following the steps -->
PATCH template_metadata/updates only the fields you send, on every existingTemplateMetadatarecord, and returns{"updated": <count>}. This includes records that were already in your database before the test.PATCH template_metadata/{id}/still changes just that one record.