-
Notifications
You must be signed in to change notification settings - Fork 124
Listen for EVFEVENT signals from server #2926
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Listen for EVFEVENT signals from server #2926
Conversation
|
A friendly bump for a friendly review... 🙏 |
On it! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chrjorgensen see my comments about the code (nothing serious, just some hints).
However, I couldn't get it to retrieve the diagnostic, because the filtering ont the job log fails: line.slice(7, 19).toUpperCase() === : EVFEVENT:``
The process seems very specific. Is it designed for a very specific way of specifying the EVFEVENT location or should it be more generic?
|
In other words: what's the benefit of it over having a new field in the action definition to define an EVFEVENT file location? (Thinking out loud here) |
|
@sebjulliand Your suggestions have been implemented - much simpler code, as you said. Thanks. 👍 I found a special case: when the first line in the joblog (stderr) is an impromptu message (no message id), the line is left-justified. If the same line comes second, it has blanks instead if message id. I guess it's our code for stderr doing the trimming? The code for extracting EVFEVENT from the joblog has been changed to use regex instead if
The whole idea of this PR is to allow the server building the objects (i.e. compiling) to tell C4i where the EVFEVENT is stored. C4i can only guess from the command in the action, but the command can change the target library when run on the server, in which case the EVFEVENT file is not in the library guessed by C4i and can't be fetched to show the errrors. The command can also issue multiple CRT-commands and produce more than one EVFEVENT file member, and this PR allows fetching all these members. The mechanism used is to write a message (impromptu or defined message) to the joblog starting with the text 'EVFEVENT:' followed by the library and object names separated by either comma, space or forward slash. The code in the PR will pick this info up and use that instead of the guessed values - or if not found, use the code from before this PR. |
Changes
This PR will make C4i check the joblog after an action command has run for information about EVFEVENT file.
The joblog is checked for messages starting with
EVFEVENT:, and if found, will extract the library and object from the message text.This allows the server to tell C4i where the object was created and thus where the EVFEVENT file is located.
This change comes from a discussion in issue #2910 about building using a build tool on the IBM i, where the build tool may determine the target library. The change allows for better locating the EVFEVENT files generated and thus better diagnostics handling.
How to test this PR
Test setup:
testcl.cllecontaining a deliberate error, e.g.dcl &var *charX 1TEST1with the following command:CRTBNDCL QRPLOBJ/&NAME SRCSTMF('&FULLPATH') OPTION(*EVENTF) DBGVIEW(*SOURCE)(This action will prohibit C4i from extracting the library and object since
PGM()is missing, simulating a user build command.)TEST1intoTEST2and insert the following command before the line containingCRTBNDCL...:runsql 'call SYSTOOLS.LPRINTF( ''EVFEVENT: QRPLOBJ ,testcl'' )' commit(*none)(This action will add a message to the joblog, indicating the location of the EVFEVENT file.)
QGPLTest on branch
master:rmvm qgpl/evfevent testclTEST1on sourcetestcl.clle. The action will fail and no diagnostics are shown. This error will appear:rmvm qgpl/evfevent testclTEST2on sourcetestcl.clle. Same result as in step 2.Test on this branch/PR:
rmvm qgpl/evfevent testclTEST1on sourcetestcl.clle. The action will still fail and diagnostics are still not shown.rmvm qgpl/evfevent testclTEST2on sourcetestcl.clle. The action will still fail, but diagnostics are now shown!Checklist
console.logs I added