Skip to content

Add support to override session:parameter#490

Open
lievendf wants to merge 2 commits intokenherring:mainfrom
lievendf:lievendf/SupportToOverrideSessionParameter
Open

Add support to override session:parameter#490
lievendf wants to merge 2 commits intokenherring:mainfrom
lievendf:lievendf/SupportToOverrideSessionParameter

Conversation

@lievendf
Copy link
Copy Markdown

@lievendf lievendf commented Mar 2, 2026

This change adds support to override session:parameter that was (hardcoded) used in ABLUnitCore.p and createDatabaseAliases.p.
Changes in ABL code only.
I've rerun all existing tests and all succeed, except for the ones that are supposed to fail 😉.
See #488 for a use case.

Copy link
Copy Markdown
Owner

@kenherring kenherring left a comment

Choose a reason for hiding this comment

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

I'm not opposed to the concept of allowing overrides for session:parameter, but I'm confused as why we needed to essentially rename ABLUnitCore.p to ABLUnitCore_sub.p. Can you explain more about this approach?

My concern is twofold:

  1. This is doing something to fight against using propath functionality as intended.
  2. The diff is difficult to review.

@lievendf
Copy link
Copy Markdown
Author

lievendf commented Mar 23, 2026

Hi Ken,

As detailed in #488 we have our own -p bootstrap procedure + own -param, which includes the name of the .p we want to execute.
This allows us to set up things like propath and dbconnections in a uniform way through code instead of config files that differ per environment (e.g. VSCode, PDSOE, etc.).

When specifying startup parameters for OpenEdge processes, you can specify the same parameter multiple times, which results in the last occurrence to be used effectively.
By appending our -p / -param at the end of the command line we are able to:

  • start our .p instead of the intended .p
  • in our .p we scan session:startup-parameters and extract the first -p / -param occurrences, as those are the intended ones
  • we run the intended .p (or a sub(stitute) if needed) after setting up propath and dbconnections, like this: run value(intendeProc)(intendedParam).

There are 2 is a problems with this approach when applied to ABLUnitTest runner:
- The command line that the extension executes looks like this: -p ABLUnitCore.p <-p / -param from "extraParameters" from openedge-project.json> -param <ABLUnit test runner parameters>. This means our -p / -param are inserted in between the -p and -param of ABLUnitRunner, causing our -p to "win" from yours, and your -param to win from ours...
=> proposed change: move extraParameters to the end of the command line. I don't believe this will interfere with anything else. I will create a separate PR for this.

Looks like the above is incorrect. Only -cpstream is added after the extraParameters...

  • ABLUnitCore.p uses session:parameter directly. If we want to call it from our bootstrapper we would need to pass in the parameter instead. This PR provides the needed changes for this by providing a sub(stitute) .p that has an input parameter instead of the direct use of session:parameter.

In order to no longer directly depend on session:parameter, the value needs to get passed in through a parameter.
To stay backwards compatible I can't simply add the extra parameter to ABLUnitCore.p as that would break running tests from the extension, since that runs ABLUnitCore.p without parameters (using -p and -param).
That's why I moved all code from ABLUnitCore.p to a new ABLUnitCore_sub.p with an extra sessionParameter input parameter, and have ABLUnitCore.p call that new .p with session:parameter as input.

Why the rename? Because that's the only way for Git to track the code changes back to the original file. If I had done this in 1 commit instead of 2, Git would see the new ABLUnitCore_sub.p as a new file with no "connection" to the original code in ABLUnitCore.p, while in fact it is the same file with some minor changes.

The actual code changes in this PR and the proposed change above are minimal and stay backwards compatible with existing functionality, while providing a huge benefit in our workflow.

@kenherring kenherring force-pushed the lievendf/SupportToOverrideSessionParameter branch from d47e6f1 to ba2ec1c Compare April 2, 2026 10:36
Renamed ABLUnitCore.p to ABLUnitCore_sub.p and added an input sessionParameter
Call renamed ABLUnitCore_sub.p from stub ABLUnitCore.p passing in session:parameter.
@kenherring kenherring force-pushed the lievendf/SupportToOverrideSessionParameter branch from ba2ec1c to 94f03db Compare April 4, 2026 06:01
@kenherring kenherring linked an issue Apr 4, 2026 that may be closed by this pull request
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.

🌲 [Request] Make abstraction of session:parameter

3 participants