Skip to content

fix(webjob): test coverage for _executionTasks=true requests without file upload#883

Merged
mulahasanovic merged 14 commits into
884-execution-tasks-web-supportfrom
882-webjobexecutor-formdata
May 12, 2026
Merged

fix(webjob): test coverage for _executionTasks=true requests without file upload#883
mulahasanovic merged 14 commits into
884-execution-tasks-web-supportfrom
882-webjobexecutor-formdata

Conversation

@mulahasanovic
Copy link
Copy Markdown
Collaborator

@mulahasanovic mulahasanovic commented May 8, 2026

Issue #882

Viya rejects requests posted to _executionTasks=true jobs with 502 or 403 when the adapter sends Content-Type: multipart/form-data and config set to useComputeApi=null (or undefined).

Intent

Resolve empty form data payloads.

Update: An issue was confirmed on all multipart form data uploads that do not include an actual file upload with executionTasks flag set to true.

Implementation

  • override added when empty form-data is sent, set text/plain content type
  • use url encoded payload when executionTasks flag is set, without a file
  • add test coverage
  • add regression test, and failing test for non-empty form-data payload

Checks

No PR (that involves a non-trivial code change) should be merged, unless all items below are confirmed! If an urgent fix is needed - use a tar file.

  • Unit tests coverage has been increased and a new threshold is set.
  • All sasjs-cli unit tests are passing (npm test).
  • (CI Runs this) All sasjs-tests are passing. If you want to run it manually (instructions available here).
  • Data Controller builds and is functional on both SAS 9 and Viya

Non-empty payloads still throws with useComputeApi=null and _executionTasks=true flags
@github-actions github-actions Bot requested a review from sabhas May 8, 2026 14:41
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

Coverage report

Total coverage

Status Category Percentage Covered / Total
🟡 Statements 66.99% (+2.24% 🔼) 1944/2902
🔴 Branches 48.93% (+1.95% 🔼) 804/1643
🔴 Functions 56.14% (+1.4% 🔼) 320/570
🟡 Lines 72.26% (+3.24% 🔼) 2918/4038

Status of coverage: 🟢 - ok, 🟡 - slightly more than threshold, 🔴 - under the threshold

Report generated by 🧪jest coverage report action from ffb42e8

@mulahasanovic mulahasanovic changed the title fix(webjob): formdata content-type override for empty payloads fix(webjob): urlencode _executionTasks=true requests without file upload May 11, 2026
Comment thread src/job-execution/spec/WebJobExecutor.spec.ts Outdated
Comment thread src/job-execution/spec/WebJobExecutor.spec.ts Outdated
Comment thread src/job-execution/WebJobExecutor.ts Outdated
const parsedUrl = new URL(apiUrl)
const isExecutionTasksEndpoint =
(parsedUrl.searchParams.has('_program') ||
parsedUrl.searchParams.has('__program')) &&
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

__program should only happen when submitting JES API approach, not web

@mulahasanovic mulahasanovic changed the base branch from master to 884-execution-tasks-web-support May 11, 2026 19:34
@mulahasanovic mulahasanovic changed the title fix(webjob): urlencode _executionTasks=true requests without file upload fix(webjob): add dummy file for _executionTasks=true requests without file upload May 12, 2026
@mulahasanovic mulahasanovic changed the title fix(webjob): add dummy file for _executionTasks=true requests without file upload fix(webjob): test coverage for _executionTasks=true requests without file upload May 12, 2026
@mulahasanovic mulahasanovic merged commit 55db8f4 into 884-execution-tasks-web-support May 12, 2026
4 checks passed
@mulahasanovic mulahasanovic deleted the 882-webjobexecutor-formdata branch May 12, 2026 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants