Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support to analyze and package studio projects #135

Merged
merged 1 commit into from
Jan 9, 2025
Merged

Conversation

thschmitt
Copy link
Collaborator

Integrated uipathcli with UiPath Studio to build, package and analyze studio projects.

Added two new plugin commands:

  • uipath studio package analyze
  • uipath studio package pack

Implementation:

  • Created infrastructure to download external plugins like the uipcli. The studio commands download the uipcli to the user cache dir and use it for packaging any studio project. Depending on the targetFramework the uipathcli either downloads the tool chain for building and packaging cross-platform or windows Studio projects.

  • Added ExecCmd abstraction which is used to start processes and can easily be faked in unit tests in order to validate the behavior with different exit codes

  • Refactored the existing browser launcher to use the ExecCmd abstraction

  • Extended the progress bar rendering to allow displaying a simple bar without any percentage or bytes indicator so that the build process can be visualized without knowing the total time in advance.

  • Increment the uipathcli version to 2.0. There are no backwards-incompatible changes. The major version increase only indicates that an important new feature has been added.

Examples:

uipath studio package analyze --source plugin/studio/projects/crossplatform

analyzing...        |██████████          |
{
  "error": null,
  "status": "Succeeded",
  "violations": [
    ...
  ]
}

uipath studio package pack --source plugin/studio/projects/crossplatform --destination . --debug

uipcli Information: 0 : Packing project(s) at path plugin\studio\projects\crossplatform\project.json...
uipcli Information: 0 : Orchestrator information is not provided, hence, orchestrator feeds will not be used.
uipcli Information: 0 : Proceeding with the local feeds...
uipcli Information: 0 : Detected schema version 4.0
...
uipcli Information: 0 : Packaged project MyProcess v1.0.2 saved to MyProcess.1.0.2.nupkg.
{
  "description": "Blank Process",
  "error": null,
  "name": "MyProcess",
  "output": "MyProcess.1.0.2.nupkg",
  "projectId": "9011ee47-8dd4-4726-8850-299bd6ef057c",
  "status": "Succeeded",
  "version": "1.0.2"
}

The following snippet allows users to package a local UiPath studio project, upload the package, create a release and run a job:

uipath studio package pack --source plugin/studio/projects/crossplatform --destination . --package-version 1.0.0
uipath orchestrator processes upload-package --file MyProcess.1.0.0.nupkg
$folderId = uipath orchestrator folders get --query "value[0].Id"
$releaseKey = uipath orchestrator releases post --folder-id $folderId --name "MyProcess" --process-key "MyProcess" --process-version "1.0.0" --query "Key" --output text
$jobId = uipath orchestrator jobs start-jobs --folder-id $folderId --start-info "ReleaseKey=$releaseKey" --query "value[0].Id" --output text
uipath orchestrator jobs get-by-id --folder-id $folderId --key $jobId

Integrated uipathcli with UiPath Studio to build, package and analyze
studio projects.

Added two new plugin commands:

- `uipath studio package analyze`
- `uipath studio package pack`

Implementation:

- Created infrastructure to download external plugins like the uipcli.
  The studio commands download the uipcli to the user cache dir
  and use it for packaging any studio project. Depending on the
  targetFramework the uipathcli either downloads the tool chain for
  building and packaging cross-platform or windows Studio projects.

- Added `ExecCmd` abstraction which is used to start processes and
  can easily be faked in unit tests in order to validate the behavior with
  different exit codes

- Refactored the existing browser launcher to use the `ExecCmd`
  abstraction

- Extended the progress bar rendering to allow displaying a simple bar
  without any percentage or bytes indicator so that the build process
  can be visualized without knowing the total time in advance.

- Increment the uipathcli version to 2.0.
  There are no backwards-incompatible changes. The major version increase
  only indicates that an important new feature has been added.

Examples:

`uipath studio package analyze --source plugin/studio/projects/crossplatform`

```
analyzing...        |██████████          |
```

```
{
  "error": null,
  "status": "Succeeded",
  "violations": [
    ...
  ]
}
```

`uipath studio package pack --source plugin/studio/projects/crossplatform --destination . --debug`

```
uipcli Information: 0 : Packing project(s) at path plugin\studio\projects\crossplatform\project.json...
uipcli Information: 0 : Orchestrator information is not provided, hence, orchestrator feeds will not be used.
uipcli Information: 0 : Proceeding with the local feeds...
uipcli Information: 0 : Detected schema version 4.0
...
uipcli Information: 0 : Packaged project MyProcess v1.0.2 saved to MyProcess.1.0.2.nupkg.
```

```
{
  "description": "Blank Process",
  "error": null,
  "name": "MyProcess",
  "output": "MyProcess.1.0.2.nupkg",
  "projectId": "9011ee47-8dd4-4726-8850-299bd6ef057c",
  "status": "Succeeded",
  "version": "1.0.2"
}
```

The following snippet allows users to package a local UiPath studio
project, upload the package, create a release and run a job:

```
uipath studio package pack --source plugin/studio/projects/crossplatform --destination . --package-version 1.0.0
uipath orchestrator processes upload-package --file MyProcess.1.0.0.nupkg
$folderId = uipath orchestrator folders get --query "value[0].Id"
$releaseKey = uipath orchestrator releases post --folder-id $folderId --name "MyProcess" --process-key "MyProcess" --process-version "1.0.0" --query "Key" --output text
$jobId = uipath orchestrator jobs start-jobs --folder-id $folderId --start-info "ReleaseKey=$releaseKey" --query "value[0].Id" --output text
uipath orchestrator jobs get-by-id --folder-id $folderId --key $jobId
```
@thschmitt thschmitt merged commit ee6bc13 into main Jan 9, 2025
7 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants