Add #{job_id} as a substitutable parameter in the Execute Service#427
Add #{job_id} as a substitutable parameter in the Execute Service#427
Conversation
|
Hi @Copilot |
Co-authored-by: smarquard <5888197+smarquard@users.noreply.github.com> Agent-Logs-Url: https://github.com/cilt-uct/opencast/sessions/b38c8b23-d709-4b03-98a4-4fdad85ecf31
| // Substitute the job ID placeholder in the params argument (index 1). | ||
| // At this point arguments contains: [exec, params, serialized_mp_or_element], so index 1 is always the params. | ||
| arguments.set(1, arguments.get(1).replace(JOB_ID_PATTERN, String.valueOf(job.getId()))); | ||
|
|
There was a problem hiding this comment.
@copilot For consistency with how the other parameters are handled, move this code to inside doProcess() and pass the job as a parameter to doProcess() so that the job id is available there.
There was a problem hiding this comment.
Done in 007088b. Moved the #{job_id} substitution into both doProcess() methods with Job as a new parameter:
- In
doProcess(MediaPackage): added as a regex matcher case alongsideid,org_id, etc. - In
doProcess(MediaPackageElement): added as a pattern-replacement check alongside#{in},#{out},#{id},#{org_id}
Co-authored-by: smarquard <5888197+smarquard@users.noreply.github.com> Agent-Logs-Url: https://github.com/cilt-uct/opencast/sessions/31f97a38-d8df-4a5d-93ac-09d03e9853da
|
@npmali Please checkout and test this branch on devubuopc003 / mediadev with a test workflow to confirm that the #{job_id} parameter substitution works in the execute service. |
The Execute Service's parameter substitution had no way to reference the current job ID in command arguments. This adds
#{job_id}as a built-in placeholder available in both Execute Once and Execute Many operations.Changes
ExecuteServiceAPI — addsJOB_ID_PATTERN = "#{job_id}"constant alongside the existing pattern constantsExecuteServiceImpl.doProcess(MediaPackage)— adds#{job_id}as a case in the regex-based matcher loop, alongside the existingid,org_id,out,flavor, andtagscases.Jobis passed as a new parameter.ExecuteServiceImpl.doProcess(MediaPackageElement)— adds#{job_id}as a pattern-replacement check in the per-argument loop, alongside the existing#{in},#{out},#{id}, and#{org_id}replacements.Jobis passed as a new parameter.execute.md— documents#{job_id}in the parameter substitution table as available in both Execute Once and Execute ManyExecuteServiceImplTest— addstestWithJobIdParamexercising the substitution throughdoProcess()directly with a mockedJobUsage
Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.