Skip to content

fr-config-pull skips GROOVY scripts during script export #374

Description

@brandon-barnes

fr-config-pull currently appears to skip AM/AIC scripts where language is GROOVY.
AM supports both JavaScript and Groovy scripts, but the current script export logic only persists scripts where:

script.language === "JAVASCRIPT"

This means Groovy scripts that are visible and active in the AIC admin UI are omitted from the exported config repository.

Observed impact:

  • Groovy scripts are not written under scripts-content.

  • Their corresponding JSON config is not written under scripts-config.

  • A Git-backed config export can appear complete while missing valid tenant scripts.

  • This affects at least SOCIAL_IDP_PROFILE_TRANSFORMATION scripts, but may affect any Groovy-backed script context.

Expected behavior:

  • JAVASCRIPT scripts export as .js.

  • GROOVY scripts export as .groovy.

  • Both script types should have corresponding config JSON files in scripts-config.

Potential implementation approach:

const SCRIPT_EXTENSIONS = {
  JAVASCRIPT: "js",
  GROOVY: "groovy",
};

Then use the script language to choose the exported file extension instead of filtering out non-JavaScript scripts.
Related observation:

  • In packages/fr-config-pull/src/scripts/journeys.js, script dependency exports appear to call exportScriptById(...) without await. If dependency export is asynchronous, referenced scripts may race process completion and fail to land reliably during journey export.

Suggested changes:

  • Remove the JavaScript-only export filter.

  • Add supported-language-to-extension handling for JAVASCRIPT and GROOVY.

  • Await exportScriptById(...) calls in journey dependency export.

  • Add tests for JavaScript, Groovy, and unsupported script language handling.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions