intersystems / git-source-control

Server-side source control hooks for InterSystems' platforms to facilitate use of git, especially in shared and/or remote development environments and for interoperability graphical editors
12 stars 8 forks source link

Issues with Git Pull #467

Closed michael-rust closed 1 month ago

michael-rust commented 1 month ago

We consistently see an issue where we start a git pull from the IRIS for Health homepage and there is no indication if the pull finished successfully or with errors.

When we look at the classes that were pulled in they are in an uncompiled state.

See screenshots attached.

IRIS version: IRIS for UNIX (Red Hat Enterprise Linux 9 for ARM64) 2024.1 (Build 263U) Wed Mar 13 2024 15:32:09 EDT [Health:7.2.0] Git package version: 2.4.1 GitPullIssues.docx


@isc-tleavitt notes on aspects of this:

isc-tleavitt commented 1 month ago

@michael-rust thanks for filing this, helpful to have as a reminder.

isc-tleavitt commented 1 month ago

Can you see if the git pull records anything in the application error log?

This may be related in part to #457 (re: the uncompiled state).

michael-rust commented 1 month ago

Yes, there was this error: " 127 Pull+1^SourceControl.Git.API.1". The full application log is attached. Applog.docx

isc-tleavitt commented 1 month ago

Ahh - this is highly relevant.

Can you try reinstalling git-source-control via standard zpm "install git-source-control"? I think you have a snapshot of 2.4.1 prior to actual release.

michael-rust commented 1 month ago

Is there a way to confirm the install? When I go to the git settings it says package version: 2.4.1

isc-tleavitt commented 1 month ago

@michael-rust good question - ultimately it's a matter of our practices in this git repo; we haven't generally put a -SNAPSHOT designation on the main branch between releases so there isn't any delineation between something-that-could-be 2.4.1 (installed via zpm "load https://github.com/intersystems/git-source-control") and 2.4.1 itself.

If you zpm "install git-source-control" you'll definitely get the real 2.4.1. Better answers are coming eventually in IPM itself.

michael-rust commented 1 month ago

Okay sounds good. I'll report back the next time we do a pull. Thanks for the quick responses.

isc-tleavitt commented 1 month ago

I'll keep an eye out - thank you for nudging on this publicly!

michael-rust commented 1 month ago

Hi Tim,

After installing the latest package we're still seeing the following issues with the git pull:

  1. No preview is shown before the pull
  2. No indication if the pull was successful or not
  3. Imported classes are uncompiled.

The issues listed above only happen sometimes, other times it all works perfectly, which I know is a troubleshooting nightmare.

isc-tleavitt commented 1 month ago

Root cause: /isc/studio/usertemplates is tied to %SYS. %SYS (via IRISSYS) had an old version of %zpkg.isc.sc.git.Socket The user namespace in question had a newer/updated version of %zpkg.isc.sc.git.Socket mapped to a nondefault database, as was the SourceControl package. %zpkg.isc.sc.git.Socket from IRISSYS (which was stale) was calling the wrong version. Solution: package-map %zpkg.isc.sc.git in %SYS to the user code database.

isc-tleavitt commented 1 month ago

This mapping issues most likely explain the problems with indication of pull success as well, but it would be worth double checking the error handling to make sure we're not just relegating useful output in the application error log in event of a serious failure.

There appears to be a secondary issue with preview output being displayed (from testing in my own HCC environment) - need to investigate this, and specifically to make sure that there's always some output. The issue in that environment could also be similar depending on the mapping techniques being used there. (This still needs triage.)

There is another cause for files not being loaded (!) or compiled independent of #457: with a large set of files changed, some in subfolders common among changes, if output has .../ it isn't processed properly. We need to update this to properly interpret as a relative folder.

isc-tleavitt commented 1 month ago

With improved logging (from work in progress) the .../ issue could end up looking like:

Updating a13f05a..03bd16a
Fast-forward
 .../Something/WithA/Really/Long/Name/Apparently/Even/Longer/Hmm.cls    | 3 +++
 src/HCC/Something/WithA/Really/Long/Name/Bar.cls                       | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

.../Something/WithA/Really/Long/Name/Apparently/Even/Longer/Hmm.cls was not imported into the database and will not be compiled. 
HCC.Something.WithA.Really.Long.Name.Bar.CLS has been imported from /data/db/mgr/repo/TLEAVITT/src/HCC/Something/WithA/Really/Long/Name/Bar.cls
Compilation started on 09/12/2024 13:59:44 with qualifiers 'ck'
Compiling class HCC.Something.WithA.Really.Long.Name.Bar
Compiling routine HCC.Something.WithA.Really.Long.Name.Bar.1
Compilation finished successfully in 0.009s.