Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Panel

Table of Contents
maxLevel2

...

Your use of this download is governed by Stonebranch’s Terms of Use, which are available at  Stonebranch Integration Hub - Terms of Use.

Overview

Jobs-as-code is an approach to automating software delivery pipelines in which the job configuration is managed as code. This approach allows developers to manage job configurations like their application code complete with version control, testing, and continuous integration.

...

Template Name

Extension Name

Version

Status

Jobs As Code

ue-jobs-as-code

2 (Current 2.0.12)

Fixes and new features are introduced. Compatibility starts from UAC/UAG 7.4.0.0 onwards.

Jobs As Codeue-jobs-as-code1Hot Fixes Only (Until UAC 7.3's End of Support).

...

Query UAC definitions prior to running an actual export to Git, to validate the selection criteria, without any write operations in the target repository. This feature should provide a list of UC 
definitions that can later be exported to a Git repository.

Configuration examples


User Scenario:

Query all UAC Definitions are stored in UAC except Scripts and Custom Days, without a proxy connection.

User Scenario:

Query all UAC Definitions that are part of a workflow with the name 'test-workflow', with a proxy connection.

...

Export selected UAC Definitions to the selected Git Repository. By using this feature, the UAC user can export the selected UAC Definitions to an external Git repository. After the export, this repository can be used as a backup or as a basis for developer collaboration on top of a source control versioning system.

Configuration examples


Image Modified


Image Modified

User Scenario:

Export to Gitlab UAC Definitions contained in Bundle with name uc_bundle except for Email and Peoplesoft Connections. The selected definitions will be stored under the "/export folder" under the "export/7.3" branch in .yaml format.

User Scenario:

Export to Azure DevOps UAC Definitions. Organization and repository names must be included in the Git Service Provider 
URL.

...

Output Type

Description

Example

EXTENSION

The extension output follows the standard Extension output format, providing:

    • “exit_code“, “status“, “status_description“: General info regarding the task execution.

    • “invocation” > “fields”: The task configuration used for this task execution.

    • “result”>“definitions_selected”: The UAC definitions that match the filter provided.

    • “result”>“definitions_exported”: The UAC definitions that actually exported to the Git provider.

    • “result”>“errors”: The list of errors occurred during execution.


Expand
titleSuccessful Execution


Code Block
{

    "exit_code": 0,
    "status_description": "SUCCESS: Task executed successfully.",
    "status": "SUCCESS",
    "invocation": {
        "extension": "ue-jobs-as-code",
        "version": "2.0.12",
        "fields": { ... }
    },
    "result": {
        "definitions_selected": {
            "agentcluster": 0,
            "businessservice": 1,
            "bundle": 0,
            "calendar": 0,
            "databaseconnection": 0,
            "emailconnection": 0,
            "peoplesoftconnection": 0,
            "sapconnection": 0,
            "snmpmanager": 0,
            "customday": 0,
            "emailtemplate": 0,
            "script": 0,
            "task": 1,
            "trigger": 0,
            "variable": 0,
            "virtualresource": 0
        },
        "definitions_exported": {
            "agentcluster": 0,
            "businessservice": 1,
            "bundle": 0,
            "calendar": 0,
            "databaseconnection": 0,
            "emailconnection": 0,
            "peoplesoftconnection": 0,
            "sapconnection": 0,
            "snmpmanager": 0,
            "customday": 0,
            "emailtemplate": 0,
            "script": 0,
            "task": 1,
            "trigger": 0,
            "variable": 0,
            "virtualresource": 0
        },
        "errors": [],
    }



Expand
titleFailed Execution


Code Block
{

    "exit_code": 21,
    "status": "FAIL",
    "status_description": "Export to Git Repository failed with error(s).",
    "invocation": {
        "extension": "ue-jobs-as-code",
        "version": "2.0.12",
        "fields": { ... }
    },
    "result": {
        "definitions_selected": {
            "agentcluster": 0,
            "bundle": 0,
            "businessservice": 0,
            "calendar": 1,
            "databaseconnection": 0,
            "emailconnection": 0,
            "peoplesoftconnection": 0,
            "sapconnection": 1,
            "snmpmanager": 0,
            "customday": 0,
            "emailtemplate": 0,
            "script": 1,
            "task": 2,
            "trigger": 1,
            "variable": 1,
            "virtual": 0
        },
        "definitions_exported": {
            "agentcluster": 0,
            "bundle": 0,
            "businessservice": 0,
            "calendar": 1,
            "databaseconnection": 0,
            "emailconnection": 0,
            "peoplesoftconnection": 0,
            "sapconnection": 1,
            "snmpmanager": 0,
            "customday": 0,
            "emailtemplate": 0,
            "script": 0,
            "task": 2,
            "trigger": 1,
            "variable": 1,
            "virtual": 0
        },
        errors: [
            "Failed to create git object for definition 'TestScript' (Git path: /path/script/TestScript.yml)."
        ]
    }
}





STDOUT

All definitions matched the selection criteria, in table format.



Expand
titleSTDOUT Example


Code Block
=================  =========  =========================================  ===========================================================  ========
Type               Subtype    Name                                       Git Path                                                     Status
=================  =========  =========================================  ===========================================================  ========
Business Services  -          jobs-as-code-win                           Business Services/jobs-as-code-win.yaml                      exported
Tasks              Manual     jobs-as-code-manual-task-win               Tasks/Manual/jobs-as-code-manual-task-win.yaml               exported 
Scripts            Data       TestScript                                 Scripts/Data/TestScript.yaml                                 failed
=================  =========  =========================================  ===========================================================  ========



...

Import UC definitions manually

User Scenario

Import the specified files stored in the corresponding paths of Add, Modify, and Remove Definitions Lists from GitHub to UAC. Files under the Add list will be added to UAC, and files under the Modify list will modify existing definitions. Definitions of their paths under the Remove list will be deleted from UAC.

User Scenario: 

Import from GitHub all the files that are stored under the "export/7.3" branch and modify the existing corresponding UAC Definitions.

...

  • In the 'Actions' section of the task, three variables need to be set, one for each import list. The name of the variable should be put also in the corresponding field of the template. The value of the variable should be a UC function that uses a JSON path to extract the added, modified, and removed files from the Git Webhook payload. 

  • The Universal Task that will be triggered by the webhook should have the name of the Action Variables inside Add, Modify, and Remove UC Definitions Lists, with the prefix var: enclosed in a list, as demonstrated in the example below:


Image Modified

Image Modified

Parse UAC variable holding the webhook payload, using UAC built-in JSON Path function:

${_varJsonPath('ops_trigger_<universal_monitor_task_name>_payload','$.commits[*].added[*]','',',')}

Import from GitLab/GitHub via Webhook

...

Output Type

Description

Example

EXTENSION

The extension output provides the following information:

  • “exit_code“, “status“, “status_description“: General info regarding the task execution.

  • “invocation” > “fields”: The task configuration used for this task execution.

  • “result”>“definitions_selected”: The UAC definitions that match the filter provided.

  • “result”>“definitions_exported”: The UAC definitions are actually exported to the Git provider.

  • “result”>“errors”: The list of errors occurred during execution.


Expand
titleSuccessful Execution


Code Block
"exit_code": 1,
    "status": "SUCCESS",
    "status_description": "import from Git Repository executed successfully.",
    "invocation": {
        "extension": "ue-jobs-as-code",
        "version": "2.0.12",
        "fields": { ... }
    },
	"result": {
		"definitions_selected": {
            "agentcluster": 0,
			"bundle": 0,
			"businessservice": 0,
			"calendar": 1,
			"databaseconnection": 0,
			"emailconnection": 0,
			"peoplesoftconnection": 0,
			"sapconnection": 1,
			"snmpmanager": 0,
			"customday": 0,
			"emailtemplate": 0,
			"script": 0,
			"task": 2,
			"trigger": 1,
			"variable": 1,
			"virtual": 0
		},
        "definitions_added": {
			"agentcluster": 0,
			"bundle": 0,
			"businessservice": 0,
			"calendar": 1,
			"databaseconnection": 0,
			"emailconnection": 0,
			"peoplesoftconnection": 0,
			"sapconnection": 1,
			"snmpmanager": 0,
			"customday": 0,
			"emailtemplate": 0,
			"script": 0,
			"task": 2,
			"trigger": 1,
			"variable": 1,
			"virtual": 0
		},
        "definitions_removed": {
			"agentcluster": 0,
			"bundle": 0,
			"businessservice": 0,
			"calendar": 1,
			"databaseconnection": 0,
			"emailconnection": 0,
			"peoplesoftconnection": 0,
			"sapconnection": 1,
			"snmpmanager": 0,
			"customday": 0,
			"emailtemplate": 0,
			"script": 0,
			"task": 2,
			"trigger": 1,
			"variable": 1,
			"virtual": 0
		},		
        "definitions_modified": {
			"agentcluster": 0,
			"bundle": 0,
			"businessservice": 0,
			"calendar": 1,
			"databaseconnection": 0,
			"emailconnection": 0,
			"peoplesoftconnection": 0,
			"sapconnection": 1,
			"snmpmanager": 0,
			"customday": 0,
			"emailtemplate": 0,
			"script": 0,
			"task": 2,
			"trigger": 1,
			"variable": 1,
			"virtual": 0
		},		
		errors: []
	}
}




Expand
titleFailed Execution


Code Block
{
    "exit_code": 21,
    "status_description": "Some errors where produced during data synchronization process:
Task completed with failures.See Extension Output for more details.",
    "status": "FAILED",
    "invocation": {
        "extension": "ue-jobs-as-code",
        "version": "2.0.12",
        "fields": {...}
    },
    "result": {
        "definitions_selected": {
            "agentcluster": 0,
            "businessservice": 0,
            "bundle": 0,
            "calendar": 0,
            "databaseconnection": 0,
            "emailconnection": 0,
            "peoplesoftconnection": 0,
            "sapconnection": 0,
            "snmpmanager": 0,
            "customday": 0,
            "emailtemplate": 0,
            "script": 0,
            "task": 1,
            "trigger": 0,
            "variable": 0,
            "virtualresource": 0
        },
        "definitions_added": {
            "agentcluster": 0,
            "businessservice": 0,
            "bundle": 0,
            "calendar": 0,
            "databaseconnection": 0,
            "emailconnection": 0,
            "peoplesoftconnection": 0,
            "sapconnection": 0,
            "snmpmanager": 0,
            "customday": 0,
            "emailtemplate": 0,
            "script": 0,
            "task": 0,
            "trigger": 0,
            "variable": 0,
            "virtualresource": 0
        },
        "definitions_modified": {
            "agentcluster": 0,
            "businessservice": 0,
            "bundle": 0,
            "calendar": 0,
            "databaseconnection": 0,
            "emailconnection": 0,
            "peoplesoftconnection": 0,
            "sapconnection": 0,
            "snmpmanager": 0,
            "customday": 0,
            "emailtemplate": 0,
            "script": 0,
            "task": 0,
            "trigger": 0,
            "variable": 0,
            "virtualresource": 0
        },
        "definitions_removed": {
            "agentcluster": 0,
            "businessservice": 0,
            "bundle": 0,
            "calendar": 0,
            "databaseconnection": 0,
            "emailconnection": 0,
            "peoplesoftconnection": 0,
            "sapconnection": 0,
            "snmpmanager": 0,
            "customday": 0,
            "emailtemplate": 0,
            "script": 0,
            "task": 0,
            "trigger": 0,
            "variable": 0,
            "virtualresource": 0
        },
        "errors": [
            "Failed to add UAC definition TestScript: Create script failed.
A duplicate value has been detected. Name must be unique."
        ]
    }
}




STDOUT

All definitions matched the selection criteria, in table format.


Expand
titleSTDOUT Example


Code Block
=================  =========  =========================================  ===========================================================  ========
Type               Subtype    Name                                       Git Path                                                     Status
=================  =========  =========================================  ===========================================================  ========
Business Services  -          jobs-as-code-win                           Business Services/jobs-as-code-win.yaml                      imported
Tasks              Manual     jobs-as-code-manual-task-win               Tasks/Manual/jobs-as-code-manual-task-win.yaml               imported
Scripts            Data       TestScript                                 Scripts/Data/TestScript.yaml                                 failed
=================  =========  =========================================  ===========================================================  ========



...

Modifications of this integration, applied by users or customers, before or after import, might affect the supportability of this integration. For more information refer to 98795535Integration Modifications.

Dependencies Manual Installation

...

  • PyGithub: For exporting and importing UAC Definitions from GitHub

  • ruamelruamel.yaml : The installation of the package is recommended but not mandatory for the "Export to Git Repository" action in YAML format. This package ensures that the exported UAC definitions are well-structured with optimal layout and indentation.

...

Document LinkDescription
Universal TemplatesUser documentation for creating, working with and understanding Universal Templates and Integrations.
Universal Event Template Use documentation for creating Universal Event Templates
Universal TasksUser documentation for creating Universal Tasks in the Universal Controller user interface.
CredentialsUser documentation for creating and working with credentials.
Resolvable Credentials Permitted PropertyUser documentation for Resolvable Credentials Permitted Property.


Changelog

ue-jobs-as-code-2.0.2 (2024-05-16)

Fixes

  • Fixed: Resolved issue where duplicate entries in UC definitions were not filtered out. (#36551).

ue-jobs-as-code-2.0.1 (2024-04-25)

Fixes

  • Fixed: Resolved compatibility issues with Linux systems utilizing glibc version 2.17 (#36552).

...

ue-jobs-as-code-1.2.1 (2023-01-23)

Fixes

  • Fixed: Http Code 404 when validating git file paths for Azure DevOps in action `Import from Git Repository` (#35567).

  • Fixed: Wrongly picking up from `Webhook Payload`, committed files that include keywords `yaml` or `json` in their file path, for Azure DevOps in action `Import from Git Repository` (#35570).

...

  • AddedSupport for Azure DevOps Services (Cloud Version) for Git Repos hosted on Azure DevOps Platform (#34932). 

Fixes

  • Fixed: Error when executing an Import action specifying "*" in the added, modified or deleted uc definition list(#35167).

...

  • Added: Support Bit Bucket Git Service Provider (#32243).

  • Added: Update output only field “Extension Status” with execution information (#32153).

Fixes

  • Fixed: Connect to GitLab client over Proxy with “Git SSL Verification” set to True (#32138).

  • Fixed: Connect to GitHub Enterprise Server edition (#34507).

  • Fixed: Handle exception HTTPError 500, raised when listing UC definitions with unresolved items (for instance: unresolved Credentials) (#32982).

...