@itentialopensource/adapter-git 0.3.10 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +1 -0
- package/AUTH.md +4 -4
- package/ENHANCE.md +3 -3
- package/PROPERTIES.md +30 -10
- package/README.md +138 -74
- package/SUMMARY.md +2 -2
- package/SYSTEMINFO.md +1 -1
- package/TAB1.md +2 -2
- package/TAB2.md +5 -5
- package/TROUBLESHOOT.md +1 -1
- package/package.json +18 -20
- package/test/integration/adapterTestIntegration.js +1 -38
- package/test/unit/adapterTestUnit.js +1 -38
- package/utils/adapterInfo.js +114 -164
- package/utils/argParser.js +44 -0
- package/utils/logger.js +26 -0
- package/utils/artifactize.js +0 -146
- package/utils/packModificationScript.js +0 -35
package/.eslintrc.js
CHANGED
package/AUTH.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
## Authenticating Git Adapter
|
|
2
2
|
|
|
3
|
-
This document will go through the steps for authenticating the Git adapter with User and Password. Properly configuring the properties for an adapter in
|
|
3
|
+
This document will go through the steps for authenticating the Git adapter with User and Password. Properly configuring the properties for an adapter in Itential Platform is critical for getting the adapter online. You can read more about adapter authentication <a href="https://www.itential.com/automation-platform/integrations/adapters-resources/authentication/" target="_blank">HERE</a>.
|
|
4
4
|
|
|
5
5
|
### User and Password Authentication
|
|
6
6
|
The Git adapter requires user and password for authentiaction.
|
|
7
7
|
|
|
8
8
|
STEPS
|
|
9
9
|
1. Ensure you have access to a Git server and that it is running
|
|
10
|
-
2. Follow the steps in the README.md to import the adapter into
|
|
10
|
+
2. Follow the steps in the README.md to import the adapter into Itential Platform if you have not already done so
|
|
11
11
|
3. Use the properties below for the ```properties.auth``` field
|
|
12
12
|
```json
|
|
13
13
|
"authentication": {
|
|
@@ -19,8 +19,8 @@ STEPS
|
|
|
19
19
|
|
|
20
20
|
### Troubleshooting
|
|
21
21
|
- Make sure you copied over the correct username and password.
|
|
22
|
-
- Turn on debug level logs for the adapter in
|
|
23
|
-
- Turn on auth_logging for the adapter in
|
|
22
|
+
- Turn on debug level logs for the adapter in Itential Platform Admin Essentials.
|
|
23
|
+
- Turn on auth_logging for the adapter in Itential Platform Admin Essentials (adapter properties).
|
|
24
24
|
- Investigate the logs - in particular:
|
|
25
25
|
- The FULL REQUEST log to make sure the proper headers are being sent with the request.
|
|
26
26
|
- The FULL BODY log to make sure the payload is accurate.
|
package/ENHANCE.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
### Adding a Second Instance of an Adapter
|
|
4
4
|
|
|
5
|
-
You can add a second instance of this adapter without adding new code on the file system. To do this go into the
|
|
5
|
+
You can add a second instance of this adapter without adding new code on the file system. To do this go into the Itential Platform Admin Essentials and add a new service config for this adapter. The two instances of the adapter should have unique ids. In addition, they should point to different instances (unique host and port) of the other system.
|
|
6
6
|
|
|
7
7
|
### Adding Adapter Calls
|
|
8
8
|
|
|
@@ -18,7 +18,7 @@ npm run adapter:update
|
|
|
18
18
|
|
|
19
19
|
If you do not have a Swagger or OpenAPI document, you can use a Postman Collection and convert that to an OpenAPI document using APIMatic and then follow the first process.
|
|
20
20
|
|
|
21
|
-
If you want to manually update the adapter that can also be done the key thing is to make sure you update all of the right files. Within the entities directory you will find 1 or more entities. You can create a new entity or add to an existing entity. Each entity has an action.json file, any new call will need to be put in the action.json file. It will also need to be added to the enum for the ph_request_type in the appropriate schema files. Once this configuration is complete you will need to add the call to the adapter.js file and, in order to make it available as a workflow task in
|
|
21
|
+
If you want to manually update the adapter that can also be done the key thing is to make sure you update all of the right files. Within the entities directory you will find 1 or more entities. You can create a new entity or add to an existing entity. Each entity has an action.json file, any new call will need to be put in the action.json file. It will also need to be added to the enum for the ph_request_type in the appropriate schema files. Once this configuration is complete you will need to add the call to the adapter.js file and, in order to make it available as a workflow task in Itential Platform, it should also be added to the pronghorn.json file. You can optionally add it to the unit and integration test files. There is more information on how to work on each of these files in the <a href="https://docs.itential.com/opensource/docs/adapters" target="_blank">Adapter Technical Resources</a> on our Documentation Site.
|
|
22
22
|
|
|
23
23
|
```text
|
|
24
24
|
Files to update
|
|
@@ -32,7 +32,7 @@ Files to update
|
|
|
32
32
|
|
|
33
33
|
### Adding Adapter Properties
|
|
34
34
|
|
|
35
|
-
While changing adapter properties is done in the service instance configuration section of
|
|
35
|
+
While changing adapter properties is done in the service instance configuration section of Itential Platform, adding properties has to be done in the adapter. To add a property you should edit the propertiesSchema.json with the proper information for the property. In addition, you should modify the sampleProperties to have the new property in it.
|
|
36
36
|
|
|
37
37
|
```text
|
|
38
38
|
Files to update
|
package/PROPERTIES.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
## Configuration
|
|
2
2
|
|
|
3
|
-
This section defines **all** the properties that are available for the adapter, including detailed information on what each property is for. If you are not using certain capabilities with this adapter, you do not need to define all of the properties. An example of how the properties for this adapter can be used with tests or
|
|
3
|
+
This section defines **all** the properties that are available for the adapter, including detailed information on what each property is for. If you are not using certain capabilities with this adapter, you do not need to define all of the properties. An example of how the properties for this adapter can be used with tests or Itential Platform are provided in the sampleProperties.
|
|
4
4
|
|
|
5
5
|
```json
|
|
6
6
|
{
|
|
@@ -82,12 +82,15 @@ This section defines **all** the properties that are available for the adapter,
|
|
|
82
82
|
"password": "",
|
|
83
83
|
},
|
|
84
84
|
"mongo": {
|
|
85
|
+
"url": "",
|
|
85
86
|
"host": "",
|
|
86
87
|
"port": 0,
|
|
87
88
|
"database": "",
|
|
89
|
+
"dbAuth": false,
|
|
88
90
|
"username": "",
|
|
89
91
|
"password": "",
|
|
90
92
|
"replSet": "",
|
|
93
|
+
"addSrv": false,
|
|
91
94
|
"db_ssl": {
|
|
92
95
|
"enabled": false,
|
|
93
96
|
"accept_invalid_cert": false,
|
|
@@ -97,6 +100,7 @@ This section defines **all** the properties that are available for the adapter,
|
|
|
97
100
|
}
|
|
98
101
|
},
|
|
99
102
|
"devicebroker": {
|
|
103
|
+
"enabled": false,
|
|
100
104
|
"getDevice": [
|
|
101
105
|
{
|
|
102
106
|
"path": "/call/to/get/device/details",
|
|
@@ -214,7 +218,7 @@ These base properties are used to connect to Git upon the adapter initially comi
|
|
|
214
218
|
</table>
|
|
215
219
|
<br>
|
|
216
220
|
|
|
217
|
-
A connectivity check tells
|
|
221
|
+
A connectivity check tells Itential Platform the adapter has loaded successfully.
|
|
218
222
|
|
|
219
223
|
### Authentication Properties
|
|
220
224
|
|
|
@@ -342,7 +346,7 @@ The request section defines properties to help handle requests.
|
|
|
342
346
|
</tr>
|
|
343
347
|
<tr>
|
|
344
348
|
<td style="padding:15px">failover_codes</td>
|
|
345
|
-
<td style="padding:15px">An array of error codes for which the adapter will send back a failover flag to
|
|
349
|
+
<td style="padding:15px">An array of error codes for which the adapter will send back a failover flag to Itential Platform so that the Platform can attempt the action in another adapter.</td>
|
|
346
350
|
</tr>
|
|
347
351
|
<tr>
|
|
348
352
|
<td style="padding:15px">attempt_timeout</td>
|
|
@@ -374,7 +378,7 @@ The request section defines properties to help handle requests.
|
|
|
374
378
|
</tr>
|
|
375
379
|
<tr>
|
|
376
380
|
<td style="padding:15px">return_raw</td>
|
|
377
|
-
<td style="padding:15px">Optional. Tells the adapter whether the raw response should be returned as well as the
|
|
381
|
+
<td style="padding:15px">Optional. Tells the adapter whether the raw response should be returned as well as the Itential Platform response. This is helpful when running integration tests to save mock data. It does add overhead to the response object so it is not ideal from production.</td>
|
|
378
382
|
</tr>
|
|
379
383
|
<tr>
|
|
380
384
|
<td style="padding:15px">archiving</td>
|
|
@@ -520,29 +524,41 @@ The mongo section defines the properties used to connect to a Mongo database. Mo
|
|
|
520
524
|
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Property</span></th>
|
|
521
525
|
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Description</span></th>
|
|
522
526
|
</tr>
|
|
527
|
+
<tr>
|
|
528
|
+
<td style="padding:15px">url</td>
|
|
529
|
+
<td style="padding:15px">Optional. Mongo's complete connection URL. This property overrides host, port, database, username, password and replSet settings.</td>
|
|
530
|
+
</tr>
|
|
523
531
|
<tr>
|
|
524
532
|
<td style="padding:15px">host</td>
|
|
525
|
-
<td style="padding:15px">Optional. Host information for the
|
|
533
|
+
<td style="padding:15px">Optional. Host information for the Mongo server.</td>
|
|
526
534
|
</tr>
|
|
527
535
|
<tr>
|
|
528
536
|
<td style="padding:15px">port</td>
|
|
529
|
-
<td style="padding:15px">Optional. Port information for the
|
|
537
|
+
<td style="padding:15px">Optional. Port information for the Mongo server.</td>
|
|
530
538
|
</tr>
|
|
531
539
|
<tr>
|
|
532
540
|
<td style="padding:15px">database</td>
|
|
533
541
|
<td style="padding:15px">Optional. The database for the adapter to use for its data.</td>
|
|
534
542
|
</tr>
|
|
543
|
+
<tr>
|
|
544
|
+
<td style="padding:15px">dbAuth</td>
|
|
545
|
+
<td style="padding:15px">Optional. Whether to use authentication for MongoDB connection. Default is false.</td>
|
|
546
|
+
</tr>
|
|
535
547
|
<tr>
|
|
536
548
|
<td style="padding:15px">username</td>
|
|
537
|
-
<td style="padding:15px">Optional. If credentials are required to access
|
|
549
|
+
<td style="padding:15px">Optional. If credentials are required to access Mongo, this is the user to login as.</td>
|
|
538
550
|
</tr>
|
|
539
551
|
<tr>
|
|
540
552
|
<td style="padding:15px">password</td>
|
|
541
|
-
<td style="padding:15px">Optional. If credentials are required to access
|
|
553
|
+
<td style="padding:15px">Optional. If credentials are required to access Mongo, this is the password to login with.</td>
|
|
542
554
|
</tr>
|
|
543
555
|
<tr>
|
|
544
556
|
<td style="padding:15px">replSet</td>
|
|
545
|
-
<td style="padding:15px">Optional. If the database is set up to use replica sets, define it here so it can be added to the database connection
|
|
557
|
+
<td style="padding:15px">Optional. If the database is set up to use replica sets, define it here so it can be added to the database connection. Not used when using mongodb+srv:// protocol</td>
|
|
558
|
+
</tr>
|
|
559
|
+
<tr>
|
|
560
|
+
<td style="padding:15px">addSrv</td>
|
|
561
|
+
<td style="padding:15px">Optional. Whether the connection requires the mongodb+srv:// protocol. If true, uses mongodb+srv:// protocol. Note: mongodb+srv:// can also be used for non-Atlas deployments that support DNS SRV records</td>
|
|
546
562
|
</tr>
|
|
547
563
|
<tr>
|
|
548
564
|
<td style="padding:15px">db_ssl</td>
|
|
@@ -580,6 +596,10 @@ The device broker section defines the properties used integrate Git to the devic
|
|
|
580
596
|
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Property</span></th>
|
|
581
597
|
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Description</span></th>
|
|
582
598
|
</tr>
|
|
599
|
+
<tr>
|
|
600
|
+
<td style="padding:15px">enabled</td>
|
|
601
|
+
<td style="padding:15px">Whether or not the device broker calls have been mapped.</td>
|
|
602
|
+
</tr>
|
|
583
603
|
<tr>
|
|
584
604
|
<td style="padding:15px">getDevice</td>
|
|
585
605
|
<td style="padding:15px">The array of calls used to get device details for the broker</td>
|
|
@@ -637,4 +657,4 @@ The device broker section defines the properties used integrate Git to the devic
|
|
|
637
657
|
<td style="padding:15px">Object containing fields the adapter should set to send back to iap and where the value should come from in the response or request data.</td>
|
|
638
658
|
</tr>
|
|
639
659
|
</table>
|
|
640
|
-
<br>
|
|
660
|
+
<br>
|
package/README.md
CHANGED
|
@@ -1,50 +1,93 @@
|
|
|
1
|
-
# Git
|
|
1
|
+
# Adapter for Git
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Table of Contents
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Some of the page links in this document and links to other GitLab files do not work in Confluence however, the information is available in other sections of the Confluence material.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
- [Specific to this Adapter](#specific-to-this-adapter)
|
|
8
|
+
- [Authentication](./AUTH.md)
|
|
9
|
+
- [Sample Properties](./sampleProperties.json)
|
|
10
|
+
- [Available Calls](./CALLS.md)
|
|
11
|
+
- [Swagger](./report/adapter-openapi.json)
|
|
12
|
+
- [Generic Adapter Information](#generic-adapter-information)
|
|
13
|
+
- [Overview](./SUMMARY.md)
|
|
14
|
+
- [Versioning](#versioning)
|
|
15
|
+
- [Supported Platform Versions](#supported-platform-versions)
|
|
16
|
+
- [Getting Started](#getting-started)
|
|
17
|
+
- [Helpful Background Information](#helpful-background-information)
|
|
18
|
+
- [Prerequisites](#prerequisites)
|
|
19
|
+
- [How to Install](#how-to-install)
|
|
20
|
+
- [Testing](#testing)
|
|
21
|
+
- [Configuration](./PROPERTIES.md)
|
|
22
|
+
- [Utilities](./UTILITIES.md)
|
|
23
|
+
- [Additional Information](#additional-information)
|
|
24
|
+
- [Enhancements](./ENHANCE.md)
|
|
25
|
+
- [Contributing](./CONTRIBUTING.md)
|
|
26
|
+
- [Helpful Links](#helpful-links)
|
|
27
|
+
- [Troubleshoot](./TROUBLESHOOT.md)
|
|
28
|
+
- [License and Maintainers](#license-and-maintainers)
|
|
29
|
+
- [Product License](#product-license)
|
|
8
30
|
|
|
9
|
-
## Versioning
|
|
10
31
|
|
|
11
|
-
|
|
32
|
+
## Specific to this Adapter
|
|
12
33
|
|
|
13
|
-
|
|
34
|
+
### [Authentication](./AUTH.md)
|
|
14
35
|
|
|
15
|
-
|
|
36
|
+
### [Sample Properties](./sampleProperties.json)
|
|
16
37
|
|
|
17
|
-
|
|
38
|
+
<a href="./sampleProperties.json" target="_blank">Sample Properties</a> can be used to help you configure the adapter in the Itential Automation Platform. You will need to update connectivity information such as the host, port, protocol and credentials.
|
|
18
39
|
|
|
19
|
-
|
|
40
|
+
### [Available Calls](./CALLS.md)
|
|
20
41
|
|
|
21
|
-
|
|
42
|
+
### [Swagger](./report/adapter-openapi.json)
|
|
22
43
|
|
|
23
|
-
Many of the scripts that come with all adapters built using the Itential Adapter Builder do have some dependencies on IAP or the IAP database schema and so it is possible these scripts could stop working in different versions of IAP. If you notify Itential of any issues, the Adapter Team will attempt to fix the scripts for newer releases of IAP.
|
|
24
44
|
|
|
25
|
-
##
|
|
45
|
+
## Generic Adapter Information
|
|
46
|
+
|
|
47
|
+
### [Overview](./SUMMARY.md)
|
|
48
|
+
|
|
49
|
+
### Versioning
|
|
50
|
+
|
|
51
|
+
Itential Product and opensource adapters utilize SemVer for versioning. The current version of the adapter can be found in the `package.json` file or viewed in the Platform GUI on the System page. All Itential opensource adapters can be found in the <a href="https://gitlab.com/itentialopensource/adapters" target="_blank">Itential OpenSource Repository</a>.
|
|
52
|
+
|
|
53
|
+
Any release prior to 1.0.0 is a pre-release. Initial builds of adapters are generally set up as pre-releases as there is often work that needs to be done to configure the adapter and make sure the authentication process to Git works appropriately.
|
|
54
|
+
|
|
55
|
+
Release notes can be viewed in CHANGELOG.md.
|
|
56
|
+
|
|
57
|
+
### Supported Platform Versions
|
|
58
|
+
|
|
59
|
+
Itential Product adapters are built for particular versions of Platform and packaged with the versions they work with.
|
|
60
|
+
|
|
61
|
+
Itential opensource adapter as well as custom adapters built with the Itential Adapter Builder work acoss many releases of Platform. As a result, it is not often necessary to modify an adapter when upgrading Platform. If Platform has changes that impact the pronghorn.json, like adding a new required section, this will most likely require changes to all adapters when upgrading Platform.
|
|
62
|
+
|
|
63
|
+
Many of the scripts that come with all adapters built using the Itential Adapter Builder do have some dependencies on Platform or the Platform database schema and so it is possible these scripts could stop working in different versions of Platform. If you notify Itential of any issues, the Adapter Team will attempt to fix the scripts for newer releases of Platform.
|
|
64
|
+
|
|
65
|
+
### Getting Started
|
|
26
66
|
|
|
27
67
|
These instructions will help you get a copy of the project on your local machine for development and testing. Reading this section is also helpful for deployments as it provides you with pertinent information on prerequisites and properties.
|
|
28
68
|
|
|
29
|
-
|
|
69
|
+
#### Helpful Background Information
|
|
30
70
|
|
|
31
|
-
There is
|
|
71
|
+
There is <a href="https://docs.itential.com/opensource/docs/adapters" target="_blank">Adapter documentation available on the Itential Documentation Site</a>. This documentation includes information and examples that are helpful for:
|
|
32
72
|
|
|
33
73
|
```text
|
|
34
74
|
Authentication
|
|
35
|
-
|
|
75
|
+
Platform Service Instance Configuration
|
|
36
76
|
Code Files
|
|
37
|
-
Action
|
|
38
|
-
|
|
39
|
-
|
|
77
|
+
Endpoint Configuration (Action & Schema)
|
|
78
|
+
Mock Data
|
|
79
|
+
Adapter Generic Methods
|
|
80
|
+
Headers
|
|
81
|
+
Security
|
|
40
82
|
Linting and Testing
|
|
41
|
-
|
|
83
|
+
Build an Adapter
|
|
84
|
+
Troubleshooting an Adapter
|
|
42
85
|
```
|
|
43
86
|
|
|
44
87
|
Others will be added over time.
|
|
45
88
|
Want to build a new adapter? Use the <a href="https://adapters.itential.io" target="_blank">Itential Adapter Builder</a>
|
|
46
89
|
|
|
47
|
-
|
|
90
|
+
#### Prerequisites
|
|
48
91
|
|
|
49
92
|
The following is a list of required packages for installation on the system the adapter will run on:
|
|
50
93
|
|
|
@@ -65,6 +108,18 @@ The following list of packages are required for Itential opensource adapters or
|
|
|
65
108
|
<td style="padding:15px">@itentialopensource/adapter-utils</td>
|
|
66
109
|
<td style="padding:15px">Runtime library classes for all adapters; includes request handling, connection, authentication throttling, and translation.</td>
|
|
67
110
|
</tr>
|
|
111
|
+
<tr>
|
|
112
|
+
<td style="padding:15px">ajv</td>
|
|
113
|
+
<td style="padding:15px">Required for validation of adapter properties to integrate with Git.</td>
|
|
114
|
+
</tr>
|
|
115
|
+
<tr>
|
|
116
|
+
<td style="padding:15px">axios</td>
|
|
117
|
+
<td style="padding:15px">Utilized by the node scripts that are included with the adapter; helps to build and extend the functionality.</td>
|
|
118
|
+
</tr>
|
|
119
|
+
<tr>
|
|
120
|
+
<td style="padding:15px">commander</td>
|
|
121
|
+
<td style="padding:15px">Utilized by the node scripts that are included with the adapter; helps to build and extend the functionality.</td>
|
|
122
|
+
</tr>
|
|
68
123
|
<tr>
|
|
69
124
|
<td style="padding:15px">fs-extra</td>
|
|
70
125
|
<td style="padding:15px">Utilized by the node scripts that are included with the adapter; helps to build and extend the functionality.</td>
|
|
@@ -77,10 +132,30 @@ The following list of packages are required for Itential opensource adapters or
|
|
|
77
132
|
<td style="padding:15px">mocha-param</td>
|
|
78
133
|
<td style="padding:15px">Testing library that is utilized by some of the node scripts that are included with the adapter.</td>
|
|
79
134
|
</tr>
|
|
135
|
+
<tr>
|
|
136
|
+
<td style="padding:15px">mongodb</td>
|
|
137
|
+
<td style="padding:15px">Utilized by the node scripts that are included with the adapter; helps to build and extend the functionality.</td>
|
|
138
|
+
</tr>
|
|
139
|
+
<tr>
|
|
140
|
+
<td style="padding:15px">nyc</td>
|
|
141
|
+
<td style="padding:15px">Testing coverage library that is utilized by some of the node scripts that are included with the adapter.</td>
|
|
142
|
+
</tr>
|
|
143
|
+
<tr>
|
|
144
|
+
<td style="padding:15px">ping</td>
|
|
145
|
+
<td style="padding:15px">Utilized by the node scripts that are included with the adapter; helps to build and extend the functionality.</td>
|
|
146
|
+
</tr>
|
|
80
147
|
<tr>
|
|
81
148
|
<td style="padding:15px">readline-sync</td>
|
|
82
149
|
<td style="padding:15px">Utilized by the node script that comes with the adapter; helps to test unit and integration functionality.</td>
|
|
83
150
|
</tr>
|
|
151
|
+
<tr>
|
|
152
|
+
<td style="padding:15px">semver</td>
|
|
153
|
+
<td style="padding:15px">Utilized by the node scripts that are included with the adapter; helps to build and extend the functionality.</td>
|
|
154
|
+
</tr>
|
|
155
|
+
<tr>
|
|
156
|
+
<td style="padding:15px">winston</td>
|
|
157
|
+
<td style="padding:15px">Utilized by the node scripts that are included with the adapter; helps to build and extend the functionality.</td>
|
|
158
|
+
</tr>
|
|
84
159
|
</table>
|
|
85
160
|
<br>
|
|
86
161
|
|
|
@@ -92,86 +167,62 @@ eslint
|
|
|
92
167
|
eslint-config-airbnb-base
|
|
93
168
|
eslint-plugin-import
|
|
94
169
|
eslint-plugin-json
|
|
95
|
-
package-json-validator
|
|
96
170
|
testdouble
|
|
97
171
|
```
|
|
98
172
|
|
|
99
|
-
|
|
173
|
+
#### How to Install
|
|
100
174
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
<table border="1" class="bordered-table">
|
|
104
|
-
<tr>
|
|
105
|
-
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Package</span></th>
|
|
106
|
-
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Description</span></th>
|
|
107
|
-
</tr>
|
|
108
|
-
<tr>
|
|
109
|
-
<td style="padding:15px">isomorphic-git</td>
|
|
110
|
-
<td style="padding:15px">Javascript implementation of Git</td>
|
|
111
|
-
</tr>
|
|
112
|
-
</table>
|
|
113
|
-
<br>
|
|
114
|
-
|
|
115
|
-
### How to Install
|
|
116
|
-
|
|
117
|
-
1. Set up the name space location in your IAP node_modules.
|
|
175
|
+
1a. If you are working on Itential Platform 2023.2 or earlier versions, set up the name space location in your Itential Platform node_modules.
|
|
118
176
|
|
|
119
177
|
```bash
|
|
120
178
|
cd /opt/pronghorn/current/node_modules (* could be in a different place)
|
|
121
179
|
if the @itentialopensource directory does not exist, create it:
|
|
122
180
|
mkdir @itentialopensource
|
|
181
|
+
cd @itentialopensource
|
|
123
182
|
```
|
|
124
183
|
|
|
125
|
-
|
|
184
|
+
1b. If you are working on Platform 6, you need to install the adapter in the services directory.
|
|
126
185
|
|
|
127
186
|
```bash
|
|
128
|
-
cd
|
|
129
|
-
git clone git@gitlab.com:\@itentialopensource/adapters/adapter-git
|
|
130
|
-
or
|
|
131
|
-
unzip adapter-gitr.zip
|
|
132
|
-
or
|
|
133
|
-
tar -xvf adapter-git.tar
|
|
187
|
+
cd /opt/itential/platform/services (* you may have configured it to be in a different place)
|
|
134
188
|
```
|
|
135
189
|
|
|
136
|
-
|
|
190
|
+
2. Clone/unzip/tar the adapter into your Platform environment.
|
|
137
191
|
|
|
138
192
|
```bash
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
```bash
|
|
146
|
-
systemctl restart pronghorn
|
|
193
|
+
git clone git@gitlab.com:@itentialopensource/adapters/adapter-git
|
|
194
|
+
or
|
|
195
|
+
unzip adapter-git.zip
|
|
196
|
+
or
|
|
197
|
+
tar -xvf adapter-git.tar
|
|
147
198
|
```
|
|
148
199
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
npm run adapter:install can be dependent on where the adapter is installed and on the version of IAP so it is subject to fail. If this happens you can replace step 3-5 above with these:
|
|
152
|
-
|
|
153
|
-
3. Install adapter dependencies and check the adapter.
|
|
200
|
+
3. install the adapter dependencies.
|
|
154
201
|
|
|
155
202
|
```bash
|
|
156
203
|
cd adapter-git
|
|
157
|
-
npm
|
|
204
|
+
npm install
|
|
158
205
|
npm run lint:errors
|
|
159
206
|
npm run test
|
|
160
207
|
```
|
|
161
208
|
|
|
162
|
-
4. Restart
|
|
209
|
+
4. Restart Platform
|
|
163
210
|
|
|
164
211
|
```bash
|
|
165
212
|
systemctl restart pronghorn
|
|
166
213
|
```
|
|
167
214
|
|
|
168
|
-
5. Create an adapter service instance configuration in
|
|
215
|
+
5. Create an adapter service instance configuration in Platform Admin Essentials GUI
|
|
169
216
|
|
|
170
217
|
6. Copy the properties from the sampleProperties.json and paste them into the service instance configuration in the inner/second properties field.
|
|
171
218
|
|
|
172
|
-
7. Change the adapter service instance configuration (host, port, credentials, etc) in
|
|
219
|
+
7. Change the adapter service instance configuration (host, port, credentials, etc) in Platform Admin Essentials GUI
|
|
220
|
+
|
|
221
|
+
#### Testing
|
|
173
222
|
|
|
174
|
-
|
|
223
|
+
Mocha is generally used to test all Itential Opensource Adapters. There are unit tests as well as integration tests performed. Integration tests can generally be run as standalone using mock data and running the adapter in stub mode, or as integrated. When running integrated, every effort is made to prevent environmental failures, however there is still a possibility.
|
|
224
|
+
|
|
225
|
+
##### Unit Testing
|
|
175
226
|
|
|
176
227
|
Unit Testing includes testing basic adapter functionality as well as error conditions that are triggered in the adapter prior to any integration. There are two ways to run unit tests. The prefered method is to use the testRunner script; however, both methods are provided here.
|
|
177
228
|
|
|
@@ -179,17 +230,18 @@ Unit Testing includes testing basic adapter functionality as well as error condi
|
|
|
179
230
|
node utils/testRunner --unit
|
|
180
231
|
|
|
181
232
|
npm run test:unit
|
|
233
|
+
npm run test:baseunit
|
|
182
234
|
```
|
|
183
235
|
|
|
184
236
|
To add new unit tests, edit the `test/unit/adapterTestUnit.js` file. The tests that are already in this file should provide guidance for adding additional tests.
|
|
185
237
|
|
|
186
|
-
|
|
238
|
+
##### Integration Testing - Standalone
|
|
187
239
|
|
|
188
240
|
Standalone Integration Testing requires mock data to be provided with the entities. If this data is not provided, standalone integration testing will fail. When the adapter is set to run in stub mode (setting the stub property to true), the adapter will run through its code up to the point of making the request. It will then retrieve the mock data and return that as if it had received that data as the response from Git. It will then translate the data so that the adapter can return the expected response to the rest of the Itential software. Standalone is the default integration test.
|
|
189
241
|
|
|
190
242
|
Similar to unit testing, there are two ways to run integration tests. Using the testRunner script is better because it prevents you from having to edit the test script; it will also resets information after testing is complete so that credentials are not saved in the file.
|
|
191
243
|
|
|
192
|
-
```
|
|
244
|
+
```bash
|
|
193
245
|
node utils/testRunner
|
|
194
246
|
answer no at the first prompt
|
|
195
247
|
|
|
@@ -198,9 +250,9 @@ npm run test:integration
|
|
|
198
250
|
|
|
199
251
|
To add new integration tests, edit the `test/integration/adapterTestIntegration.js` file. The tests that are already in this file should provide guidance for adding additional tests.
|
|
200
252
|
|
|
201
|
-
|
|
253
|
+
##### Integration Testing
|
|
202
254
|
|
|
203
|
-
Integration Testing requires connectivity to
|
|
255
|
+
Integration Testing requires connectivity to Git. By using the testRunner script it prevents you from having to edit the integration test. It also resets the integration test after the test is complete so that credentials are not saved in the file.
|
|
204
256
|
|
|
205
257
|
> **Note**: These tests have been written as a best effort to make them work in most environments. However, the Adapter Builder often does not have the necessary information that is required to set up valid integration tests. For example, the order of the requests can be very important and data is often required for `creates` and `updates`. Hence, integration tests may have to be enhanced before they will work (integrate) with Git. Even after tests have been set up properly, it is possible there are environmental constraints that could result in test failures. Some examples of possible environmental issues are customizations that have been made within Git which change order dependencies or required data.
|
|
206
258
|
|
|
@@ -214,11 +266,23 @@ Test should also be written to clean up after themselves. However, it is importa
|
|
|
214
266
|
|
|
215
267
|
> **Reminder**: Do not check in code with actual credentials to systems.
|
|
216
268
|
|
|
217
|
-
|
|
269
|
+
### [Configuration](./PROPERTIES.md)
|
|
270
|
+
|
|
271
|
+
### [Utilities](./UTILITIES.md)
|
|
272
|
+
|
|
273
|
+
### Additional Information
|
|
274
|
+
|
|
275
|
+
#### [Enhancements](./ENHANCE.md)
|
|
276
|
+
|
|
277
|
+
#### [Contributing](./CONTRIBUTING.md)
|
|
278
|
+
|
|
279
|
+
#### Helpful Links
|
|
280
|
+
|
|
281
|
+
<a href="https://docs.itential.com/opensource/docs/adapters" target="_blank">Adapter Technical Resources</a>
|
|
218
282
|
|
|
219
|
-
|
|
283
|
+
### [Troubleshoot](./TROUBLESHOOT.md)
|
|
220
284
|
|
|
221
|
-
|
|
285
|
+
### License and Maintainers
|
|
222
286
|
|
|
223
287
|
```text
|
|
224
288
|
Itential Product Adapters are maintained by the Itential Product Team.
|
|
@@ -226,6 +290,6 @@ Itential OpenSource Adapters are maintained by the Itential Adapter Team and the
|
|
|
226
290
|
Custom Adapters are maintained by other sources.
|
|
227
291
|
```
|
|
228
292
|
|
|
229
|
-
|
|
293
|
+
### Product License
|
|
230
294
|
|
|
231
295
|
[Apache 2.0](./LICENSE)
|
package/SUMMARY.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
## Overview
|
|
2
2
|
|
|
3
|
-
This adapter is used to integrate the Itential
|
|
3
|
+
This adapter is used to integrate the Itential Platform with the Git System. The API that was used to build the adapter for Git is usually available in the report directory of this adapter. The adapter utilizes the Git API to provide the integrations that are deemed pertinent to Itential Platform. The ReadMe file is intended to provide information on this adapter it is generated from various other Markdown files.
|
|
4
4
|
|
|
5
5
|
>**Note**: It is possible that some integrations will be supported through the Git adapter while other integrations will not. If you need additional API calls, you can use the Update capabilities provided by the Adapter Builder or request Itential to add them if the Adapter is an Itential opensourced adapter.
|
|
6
6
|
|
|
7
7
|
Itential provides information on all of its product adapters in the Customer Knowledge Base. Information in the <a href="https://itential.atlassian.net/servicedesk/customer/portals" target="_blank">Customer Knowledge Base</a> is consistently maintained and goes through documentation reviews. As a result, it should be the first place to go for information.
|
|
8
8
|
|
|
9
|
-
For opensourced and custom built adapters, the ReadMe is a starting point to understand what you have built, provide the information for you to be able to update the adapter, and assist you with deploying the adapter into
|
|
9
|
+
For opensourced and custom built adapters, the ReadMe is a starting point to understand what you have built, provide the information for you to be able to update the adapter, and assist you with deploying the adapter into Itential Platform.
|
package/SYSTEMINFO.md
CHANGED
|
@@ -11,7 +11,7 @@ Product Page: https://en.wikipedia.org/wiki/Git
|
|
|
11
11
|
We classify Git into the CI/CD domain as Git handles the versioning, building, storage and deploying of the system and components.
|
|
12
12
|
|
|
13
13
|
## Why Integrate
|
|
14
|
-
The Git adapter from Itential is used to integrate the Itential
|
|
14
|
+
The Git adapter from Itential is used to integrate the Itential Platform with Git. With this adapter you have the ability to perform operations with Git on items such as:
|
|
15
15
|
|
|
16
16
|
- Manage projects and files in a repository
|
|
17
17
|
|
package/TAB1.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# Overview
|
|
2
2
|
|
|
3
|
-
This adapter is used to integrate the Itential
|
|
3
|
+
This adapter is used to integrate the Itential Platform with the Git System. The API that was used to build the adapter for Git is usually available in the report directory of this adapter. The adapter utilizes the Git API to provide the integrations that are deemed pertinent to Itential Platform. The ReadMe file is intended to provide information on this adapter it is generated from various other Markdown files.
|
|
4
4
|
|
|
5
5
|
## Details
|
|
6
|
-
The Git adapter from Itential is used to integrate the Itential
|
|
6
|
+
The Git adapter from Itential is used to integrate the Itential Platform with Git. With this adapter you have the ability to perform operations with Git on items such as:
|
|
7
7
|
|
|
8
8
|
- Manage projects and files in a repository
|
|
9
9
|
|
package/TAB2.md
CHANGED
|
@@ -11,14 +11,14 @@
|
|
|
11
11
|
## Specific Adapter Information
|
|
12
12
|
### Authentication
|
|
13
13
|
|
|
14
|
-
This document will go through the steps for authenticating the Git adapter with User and Password. Properly configuring the properties for an adapter in
|
|
14
|
+
This document will go through the steps for authenticating the Git adapter with User and Password. Properly configuring the properties for an adapter in Itential Platform is critical for getting the adapter online. You can read more about adapter authentication <a href="https://www.itential.com/automation-platform/integrations/adapters-resources/authentication/" target="_blank">HERE</a>.
|
|
15
15
|
|
|
16
16
|
#### User and Password Authentication
|
|
17
17
|
The Git adapter requires user and password for authentiaction.
|
|
18
18
|
|
|
19
19
|
STEPS
|
|
20
20
|
1. Ensure you have access to a Git server and that it is running
|
|
21
|
-
2. Follow the steps in the README.md to import the adapter into
|
|
21
|
+
2. Follow the steps in the README.md to import the adapter into Itential Platform if you have not already done so
|
|
22
22
|
3. Use the properties below for the ```properties.auth``` field
|
|
23
23
|
```json
|
|
24
24
|
"authentication": {
|
|
@@ -30,8 +30,8 @@ STEPS
|
|
|
30
30
|
|
|
31
31
|
#### Troubleshooting
|
|
32
32
|
- Make sure you copied over the correct username and password.
|
|
33
|
-
- Turn on debug level logs for the adapter in
|
|
34
|
-
- Turn on auth_logging for the adapter in
|
|
33
|
+
- Turn on debug level logs for the adapter in Itential Platform Admin Essentials.
|
|
34
|
+
- Turn on auth_logging for the adapter in Itential Platform Admin Essentials (adapter properties).
|
|
35
35
|
- Investigate the logs - in particular:
|
|
36
36
|
- The FULL REQUEST log to make sure the proper headers are being sent with the request.
|
|
37
37
|
- The FULL BODY log to make sure the payload is accurate.
|
|
@@ -40,7 +40,7 @@ STEPS
|
|
|
40
40
|
- Credentials should be ** masked ** by the adapter so make sure you verify the username and password - including that there are erroneous spaces at the front or end.
|
|
41
41
|
### Sample Properties
|
|
42
42
|
|
|
43
|
-
Sample Properties can be used to help you configure the adapter in the Itential
|
|
43
|
+
Sample Properties can be used to help you configure the adapter in the Itential Platform. You will need to update connectivity information such as the host, port, protocol and credentials.
|
|
44
44
|
|
|
45
45
|
```json
|
|
46
46
|
"properties": {
|
package/TROUBLESHOOT.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
## Troubleshoot
|
|
2
2
|
|
|
3
|
-
Run `npm run troubleshoot` to start the interactive troubleshooting process. The command allows you to verify and update connection, authentication as well as healthcheck configuration. After that it will test these properties by sending HTTP request to the endpoint. If the tests pass, it will persist these changes into
|
|
3
|
+
Run `npm run troubleshoot` to start the interactive troubleshooting process. The command allows you to verify and update connection, authentication as well as healthcheck configuration. After that it will test these properties by sending HTTP request to the endpoint. If the tests pass, it will persist these changes into Itential Platform.
|
|
4
4
|
|
|
5
5
|
You also have the option to run individual commands to perform specific test:
|
|
6
6
|
|