Skip to content

ImportAll should check for custom pull handler #1000

Description

@cambot

Our project has a custom pull event handler that extends SourceControl.Git.PullEventHandler.IncrementalLoad and has no other compile dependencies. (After ##super() has run it does some additional work based on what was loaded)

I recently had to rebuild my local development instance. Once I was through the setup phase, I ran a forced import to load the code base and received this error:

==import start==
embedded-git-config.GSC has been imported from {{install dir}}\USER\embedded-git-config.json
==import done==
ERROR #5002: ObjectScript error: <CLASS DOES NOT EXIST>ForModifications+8^SourceControl.Git.PullEventHandler.1 *USER.Deployment.GitPullHandler

This is ForModifications+8:

set event = $classmethod(
    $select(
        $data(pullEventClass)#2: pullEventClass,
        1: ##class(SourceControl.Git.Utils).PullEventClass())
    ,"%New")

ImportRoutines() only loads all the artifacts without compiling anything. Compilation is deferred until OnPull() is run on the event handler class... which for fresh installs, is not compiled yet at this point.


I was able to modify ImportRoutines() to import and compile the pull handler class in my local with this (once the config json is loaded):

Set tPullEventClass = ##class(SourceControl.Git.Utils).PullEventClass()_".cls"
If $Data(itemList(tPullEventClass)) {
    Write !,"Importing pull handler: ",tPullEventClass
    Set ec = $$$ADDSC(ec, ..ImportItem(tPullEventClass, force, 1, 1))
}

This worked for me because I only have a single class to contend with. I suspect the better solution is fixing ForModifications() because any compilation dependencies should have been loaded by this point and only need to be compiled:

Set tPullEventClass = $Select(
        $Data(pullEventClass)#2: pullEventClass,
        1: ##class(SourceControl.Git.Utils).PullEventClass())
#; if the pull event class is in the list of modified files (meaning not provided by Embedded Git),
#;  then compile it and its dependencies with adequate error checks
Set event = $ClassMethod(tPullEventClass, "%New")

Embedded Git Version: 2.17.1
$zv: IRIS for Windows (x86-64) 2025.1.2 (Build 374U)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    customerBased on customer feedback (as opposed to something identified by developers)

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions