Repository navigation
fix(server): honor the debug parameter in the STP trigger macros - #458
Merged
Merged
Conversation
ms_runstp and ms_triggerstp both take a debug= parameter, documented as the
_debug value to send, and both hardcoded _debug=131 in the request URL - the
parameter was accepted and ignored. ms_testservice forwards debug=&debug to
ms_runstp, so its callers have been silently ignored too.
ms_runstp url now uses &_debug=&debug
ms_triggerstp url now uses &_debug=&debug
ms_testservice signature default 0 -> 131, matching its documented
default and the value the response-log parsing depends on
The server appends the session log to the response only when _debug is 131 or
above, and ms_runstp's outlogds chopping depends on that log separator, so 131
remains the default everywhere and existing callers see no change.
The one caller that passed a non-default value - ms_testservice's own test,
with debug=log - is corrected to rely on the default. The server validates
_debug as a number, so 'log' was relying on being ignored, and its
documentation already stated 131 as the default while the signature said 0.
all.sas is regenerated (build.py). The regeneration also picks up the proc sql
noprint change from #456, which had not been propagated into the embedded
webout blocks of mm_createwebservice and ms_createwebservice.
Verified: sasjs lint exit 0 with 0 errors (warnings unchanged from main).
allanbowe
approved these changes
Oct 5, 2026
|
🎉 This PR is included in version 5.3.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
Fixes the one surviving review finding from #382, and closes it as superseded.
What happened to #382
Its macro,
ms_triggerstp, landed onmainvia #442 in finished form - together with the test file the reviewer asked for. I verified each of the reviewer's 7 findings againstmain's version:&boundarynever defined%let boundary=%mf_getuniquename();&outrefnever defined%let outref=%mf_getuniquefileref();data work.%mf_getuniquename(); ... inputwith norun;)libname &libref JSONparsing&outlogdsundefined@briefsaid/code/trigger, URL used/stp/trigger/SASjsApi/stp/triggeroutdsdeclared but never writtenproc append base=&outdsdebug=accepted but ignored, URL hardcodes_debug=131Finding 5 is what this PR fixes - in both macros that have it.
The fix
ms_runstpandms_triggerstpboth takedebug=, documented as the_debugvalue to send, and both hardcoded_debug=131in the URL.ms_testserviceforwardsdebug=&debugtoms_runstp, so its callers were silently ignored too:Why the default stays 131 and existing callers see no change: the server appends the session log to the response only when
_debugis 131 or above (isDebugOnin sasjs/server), andms_runstp'soutlogdschopping depends on the log separator being present. So 131 is load-bearing for the documentedoutlogdscontract, not an arbitrary constant.The one caller passing a non-default value -
ms_testservice's own test, withdebug=log- is corrected to use the default. The server validates_debugas a number (Joi.number()intriggerProgramValidation), sologwas working only because the parameter was ignored; the macro's own doc header already claimed 131 as the default while its signature said0.Also picked up by the regeneration
all.sasis CI-generated, sobuild.pywas rerun. That surfaced a pre-existing drift: #456 changedproc sqltoproc sql noprintinmp_jsonout.sas, which is embedded intomm_createwebservice.sasandms_createwebservice.sasinside their/* WEBOUT BEGIN */blocks - and the regeneration had not been run for those two files. The diff includes that propagation.Verified
sasjs lintexit 0, 0 errors; warnings identical to main (bisected: same 3mp_abortheader warnings on a clean main checkout)build.pyrerun;all.sascarries the fix at both URL sites