Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into cpopa/java-inspector
Browse files Browse the repository at this point in the history
  • Loading branch information
custompointofview committed Mar 14, 2024
2 parents 316cf3f + bbc1b03 commit fa0db14
Show file tree
Hide file tree
Showing 14 changed files with 60 additions and 34 deletions.
37 changes: 18 additions & 19 deletions robocorp-code/README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
## Robocorp VS Code extension

The Robocorp extension makes it easy to create Python based automation projects.
The Robocorp extension makes it easy to create Python based automation projects and AI Actions.

You can use this extension as part of the [Robocorp Automation Stack](https://github.com/robocorp/rcc), which has been optimized for tasks such as robotic process automation (RPA), web scraping and IT automation. It scales up from simple image fetching or API calling all the way to complex process automation workflows.
You can use this extension as part of the [Robocorp Automation Stack](https://github.com/robocorp/rcc), which has been optimized for Python Automation and creating AI actions. It scales up from simple image fetching or API calling all the way to complex process enterprise automation workflows.

Main features include:

- **Create, run and debug AI Actions** - Robocorp AI Actions provide end-to-end stack supporting every type of connection between AI and your apps and data. You are in control where to run the code and everything is built for easiness, security, and scalability.

- **Automatic configuration of dependencies** - Every Python oriented project uses its own lightweight virtual environment and runs in isolation.

- **Inspector for Web, Windows Application Elements & more** - Pick elements from different mediums and create locators for automation

- **Create, run and debug projects** - Do these with ease while developing Tasks to automate applications

- **Deploy projects to Robocorp Cloud** - Run unattended automation in a safe, reliable and easy to use Cloud Platform.
- **Deploy projects to Robocorp Control Room** - Run unattended automation in a safe, reliable and easy to use Cloud Platform.

> Note: the use of cloud-based orchestration in [Robocorp Cloud](https://robocorp.com/robocorp-cloud) requires a free account.
> Note: the use of cloud-based orchestration in [Robocorp Control Room](https://cloud.robocorp.com/) requires a free account.
![Example of a Robot running with the extension](images/gif_run.gif)

Expand All @@ -24,7 +26,7 @@ Main features include:

2. Open the command palette - (Windows, Linux): `CTRL-SHIFT-P` (macOS): `CMD-SHIFT-P`

3. Select the command `Robocorp: Run Robot`
3. Select the command `Robocorp: Run Task Package (Robot)`

![image of command palette](images/command-palette.png)

Expand All @@ -33,27 +35,25 @@ Main features include:
> Note: You can do the same actions from the side bar after opening the Extension tab in VS Code.
Find more examples and tutorials at the [Robocorp Portal](https://robocorp.com/robots/).
You can also find helpful videos on the [YouTube Robocorp channel](https://youtu.be/zQQl8xZkGko?list=PLfXJKwwF049DIZxvwYuBgahHcDDGPpfN6).
You can also find helpful videos on the [YouTube Robocorp channel](https://www.youtube.com/watch?v=FaN7IUA8a0w&list=PLfXJKwwF049Dpl35x7i6sTTvIzlUaMChU).

Full instructions are available at the [Product Manual](https://robocorp.com/docs/product-manuals/robocorp-code) for the VS Code Extension.

This is under active development, so please [contact us](#Reporting-Issues) for issues and feature requests.
This is under active development, so please [contact us](https://robocorp.com/contact-us) for issues and feature requests.

### Requirements

Supported operating systems: Windows 10, Linux or Mac OS.

The [Robot Framework Language Server](https://marketplace.visualstudio.com/items?itemName=robocorp.robotframework-lsp) extension provides extra Robot Framework related capabilities, including code completion and formatting, as well as syntax validation and highlighting. It is highly recommended to install it alongside this Robocorp Code extension.

### Installation

Find the full installation instructions at [https://robocorp.com/docs/product-manuals/robocorp-code](https://robocorp.com/docs/product-manuals/robocorp-code).
Find the full installation instructions at [https://robocorp.com/docs/visual-studio-code/extension-features](https://robocorp.com/docs/visual-studio-code/extension-features).

### Configuration

During the first activation, the extension will download additional dependencies (such as Conda manager) that are required for it to run.

### Features (1.18.0)
### Features (1.19.0)

- Preliminary Support for [Robocorp Action Server](https://github.com/robocorp/robocorp/action_server) (Coding Actions for AIs).
- Packages view supporting Action Packages.
Expand All @@ -65,15 +65,14 @@ During the first activation, the extension will download additional dependencies
- Code Lenses to `Run Task` / `Debug Task` for tasks decorated with `@task`.
- `ROBO TASKS OUTPUT` which shows the output of tasks run with `@task`.
- Support for [Work Items](https://robocorp.com/docs/developer-tools/visual-studio-code/extension-features#using-work-items).
- Automatic bootstrapping of the Python environment for the `Robot Framework Language Server`.
- Create a Robot from a pre-configured template using the `Robocorp: Create Robot` action.
- Upload a Robot to the cloud with the `Robocorp: Upload Robot to the Robocorp Cloud` action.
- Link to the cloud with the `Robocorp: Link to Robocorp Cloud` action.
- Unlink from the cloud with the `Robocorp: Unlink and remove credentials from Robocorp Cloud` action.
- Create a Task Package from a pre-configured template using the `Robocorp: Create Task Package (Robot)` action.
- Upload a Robot to the cloud with the `Robocorp: Upload Task Package (Robot) to Control Room` action.
- Link to the cloud with the `Robocorp: Link to Control Room` action.
- Unlink from the cloud with the `Robocorp: Unlink and remove credentials from Control Room` action.
- Verify Robot for inconsistencies with `Robocorp: Robot Configuration Diagnostics` action.
- Create a terminal with a Robot environment through the `Robocorp: Terminal with Robot environment` action.
- Run a Robot with the `Robocorp: Run Robot` action.
- Debug a Robot with the `Robocorp: Debug Robot` action. - It's possible to debug plain Python tasks using the Python extension or Robot Framework tasks using the Robot Framework Language Server (in which case the task must start with `python -m robot` and finish with the folder/filename to be run).
- Create a terminal with a Robot environment through the `Robocorp: Terminal with Task Package (Robot) environment` action.
- Run a Robot with the `Robocorp: Run Task Package (Robot)` action.
- Debug a Robot with the `Robocorp: Debug Task Package (Robot)` action. - It's possible to debug plain Python tasks using the Python extension or Robot Framework tasks using the Robot Framework Language Server (in which case the task must start with `python -m robot` and finish with the folder/filename to be run).
- When a [robot.yaml](https://robocorp.com/docs/setup/robot-yaml-format) is found, it utilises the related Python environment when running/debugging `.robot` files using the RobotFramework Language Server.
- Set the pythonPath configuration to get code completion in the Python extension through the `Set pythonPath based on robot.yaml` action.
- View, launch and debug Robots from the `Robots` view.
Expand Down
6 changes: 6 additions & 0 deletions robocorp-code/codegen/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,12 @@ def __init__(
add_to_package_json=True,
server_handled=False,
),
Command(
"robocorp.downloadActionServer",
"Download Action Server",
add_to_package_json=True,
server_handled=False,
),
Command(
"robocorp.startActionServer.internal",
"Start Action Server (internal)",
Expand Down
5 changes: 5 additions & 0 deletions robocorp-code/docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
New in 1.19.0 (2024-03-12)
-----------------------------

- New action: `Robocorp Code: Download Action Server` (downloads the latest version of the Action Server).

New in 1.18.0 (2024-02-29)
-----------------------------

Expand Down
6 changes: 3 additions & 3 deletions robocorp-code/docs/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ To release a new version:

- Create release branch (`git branch -D release-robocorp-code & git checkout -b release-robocorp-code`)

- Update version (`python -m dev set-version 1.18.0`).
- Update version (`python -m dev set-version 1.19.0`).

- Update README.md to add notes on features/fixes.

- Update changelog.md to add notes on features/fixes and set release date.

- Push contents to release branch, get the build in https://github.com/robocorp/robotframework-lsp/actions and install locally to test.
- `mu acp Release Robocorp Code 1.18.0`
- `mu acp Release Robocorp Code 1.19.0`

- Rebase with master (`git checkout master & git rebase release-robocorp-code`).

- Create a tag (`git tag robocorp-code-1.18.0`) and push it.
- Create a tag (`git tag robocorp-code-1.19.0`) and push it.
Binary file modified robocorp-code/images/command-palette.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified robocorp-code/images/gif_run.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 7 additions & 1 deletion robocorp-code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"url": "https://github.com/robocorp/robotframework-lsp.git"
},
"license": "SEE LICENSE IN LICENSE.txt",
"version": "1.18.0",
"version": "1.19.0",
"icon": "images/icon.png",
"publisher": "robocorp",
"engines": {
Expand Down Expand Up @@ -123,6 +123,7 @@
"onCommand:robocorp.runPreRunScripts.internal",
"onCommand:robocorp.getPyPiBaseUrls.internal",
"onCommand:robocorp.startActionServer",
"onCommand:robocorp.downloadActionServer",
"onCommand:robocorp.startActionServer.internal",
"onCommand:robocorp.listActions.internal",
"onDebugInitialConfigurations",
Expand Down Expand Up @@ -800,6 +801,11 @@
"title": "Start Action Server",
"category": "Robocorp"
},
{
"command": "robocorp.downloadActionServer",
"title": "Download Action Server",
"category": "Robocorp"
},
{
"command": "robocorp.startActionServer.internal",
"title": "Start Action Server (internal)",
Expand Down
2 changes: 1 addition & 1 deletion robocorp-code/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "robocorp-code"
version = "1.18.0"
version = "1.19.0"
description = "Robocorp Code: Visual Studio Code Extension for Software Robot Development"
authors = [
"Fabio Zadrozny <fabio@robocorp.com>",
Expand Down
2 changes: 1 addition & 1 deletion robocorp-code/src/robocorp_code/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import sys
from typing import List

__version__ = "1.18.0"
__version__ = "1.19.0"
version_info: List[int] = [int(x) for x in __version__.split(".")]

__file__ = os.path.abspath(__file__)
Expand Down
1 change: 1 addition & 0 deletions robocorp-code/src/robocorp_code/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
ROBOCORP_RUN_PRE_RUN_SCRIPTS_INTERNAL = "robocorp.runPreRunScripts.internal" # Run Pre Run Scripts
ROBOCORP_GET_PY_PI_BASE_URLS_INTERNAL = "robocorp.getPyPiBaseUrls.internal" # Get PyPi base urls
ROBOCORP_START_ACTION_SERVER = "robocorp.startActionServer" # Start Action Server
ROBOCORP_DOWNLOAD_ACTION_SERVER = "robocorp.downloadActionServer" # Download Action Server
ROBOCORP_START_ACTION_SERVER_INTERNAL = "robocorp.startActionServer.internal" # Start Action Server (internal)
ROBOCORP_LIST_ACTIONS_INTERNAL = "robocorp.listActions.internal" # Lists the actions available in an action package given a root dir (internal)

Expand Down
5 changes: 4 additions & 1 deletion robocorp-code/vscode-client/src/actionServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ if (process.platform === "win32") {
DOWNLOAD_URL = "https://downloads.robocorp.com/action-server/releases/latest/macos64/action-server";
}

// Update so that Robocorp Code requests the latest version of the action server.
const LATEST_ACTION_SERVER_VERSION = "0.0.28";

async function downloadActionServer(internalActionServerLocation: string) {
await window.withProgress(
{
Expand Down Expand Up @@ -95,7 +98,7 @@ export const downloadOrGetActionServerLocation = async (): Promise<string | unde
verifiedActionServerVersions.set(location, true);
const actionServerVersion = await getActionServerVersion(location);

const expected = "0.0.24";
const expected = LATEST_ACTION_SERVER_VERSION;
const compare = compareVersions(expected, actionServerVersion);
if (compare > 0) {
const DOWNLOAD = "Download new";
Expand Down
14 changes: 13 additions & 1 deletion robocorp-code/vscode-client/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ import {
ROBOCORP_CREATE_ACTION_PACKAGE,
ROBOCORP_CREATE_TASK_OR_ACTION_PACKAGE,
ROBOCORP_NEW_ROBOCORP_INSPECTOR_JAVA,
ROBOCORP_DOWNLOAD_ACTION_SERVER,
} from "./robocorpCommands";
import { installPythonInterpreterCheck } from "./pythonExtIntegration";
import { refreshCloudTreeView } from "./viewsRobocorp";
Expand All @@ -169,7 +170,7 @@ import { RobotOutputViewProvider } from "./output/outView";
import { setupDebugSessionOutViewIntegration } from "./output/outViewRunIntegration";
import { showInspectorUI } from "./inspector/inspectorView";
import { IAppRoutes } from "./inspector/protocols";
import { startActionServer } from "./actionServer";
import { downloadLatestActionServer, startActionServer } from "./actionServer";
import { askAndRunRobocorpActionFromActionPackage, createActionPackage } from "./robo/actionPackage";
import { showSelectOneStrQuickPick } from "./ask";

Expand Down Expand Up @@ -392,6 +393,17 @@ function registerRobocorpCodeCommands(C: CommandRegistry, context: ExtensionCont
}
}
});
C.register(ROBOCORP_DOWNLOAD_ACTION_SERVER, async () => {
try {
const location = await downloadLatestActionServer();
window.showInformationMessage(`The latest action server was downloaded to: ${location}`);
} catch (error) {
logError("Error downloading latest action server", error, "ERR_DOWNLOAD_ACTION_SERVER");
window.showErrorMessage(
"There was an error downloading the action server. See `OUTPUT > Robocorp Code` for more information."
);
}
});
C.register(ROBOCORP_UPLOAD_ROBOT_TO_CLOUD, () => uploadRobot());
C.register(ROBOCORP_CONFIGURATION_DIAGNOSTICS, () => rccConfigurationDiagnostics());
C.register(ROBOCORP_RUN_ROBOT_RCC, () => askAndRunRobotRCC(true));
Expand Down
1 change: 1 addition & 0 deletions robocorp-code/vscode-client/src/robocorpCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,6 @@ export const ROBOCORP_HAS_PRE_RUN_SCRIPTS_INTERNAL = "robocorp.hasPreRunScripts.
export const ROBOCORP_RUN_PRE_RUN_SCRIPTS_INTERNAL = "robocorp.runPreRunScripts.internal"; // Run Pre Run Scripts
export const ROBOCORP_GET_PY_PI_BASE_URLS_INTERNAL = "robocorp.getPyPiBaseUrls.internal"; // Get PyPi base urls
export const ROBOCORP_START_ACTION_SERVER = "robocorp.startActionServer"; // Start Action Server
export const ROBOCORP_DOWNLOAD_ACTION_SERVER = "robocorp.downloadActionServer"; // Download Action Server
export const ROBOCORP_START_ACTION_SERVER_INTERNAL = "robocorp.startActionServer.internal"; // Start Action Server (internal)
export const ROBOCORP_LIST_ACTIONS_INTERNAL = "robocorp.listActions.internal"; // Lists the actions available in an action package given a root dir (internal)
7 changes: 0 additions & 7 deletions robotframework-ls/vscode-client/src/testview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,6 @@ export function computeUriTestId(uri: string): string {
if (uri.startsWith("id:")) {
throw new Error("It seems that this uri is actually a test id already.");
}
if (process.platform == "win32") {
uri = uri.toLowerCase();
}
return "id:" + uri;
}

Expand Down Expand Up @@ -161,10 +158,6 @@ function removeTreeStructure(uri: vscode.Uri) {
function addTreeStructure(workspaceFolder: vscode.WorkspaceFolder, uri: vscode.Uri): vscode.TestItem {
let workspaceFolderPath = workspaceFolder.uri.path;
let uriPath = uri.path;
if (process.platform == "win32") {
workspaceFolderPath = workspaceFolderPath.toLowerCase();
uriPath = uriPath.toLowerCase();
}
const path = posixPath.relative(workspaceFolderPath, uriPath);
const parts = path.split("/");

Expand Down

0 comments on commit fa0db14

Please sign in to comment.