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

[vrotsc] (#215) Upgrade vrotsc TS from 3.8.3 to 5.4.5 #245

Merged
merged 6 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### Enhancements
* [vrotsc] `vrotsc` migrate ts from 3.8.3 to 5.4.5. Check [this](https://github.com/vmware/build-tools-for-vmware-aria/pull/245) for detailed information

### Enhancements
* [vra] Issue 279 / content sharing policies not pulled if scope is different than configured project in the settings.xml.
* [vro] Added new strategy StrategyForceLatestVersions that will force you to upload a newer or same version of artifacts, otherwise the build will fail. New property has been introduced `-Dvro.forceImportLatestVersions={{BOOLEAN}}` that is set by default to false.
Expand All @@ -17,19 +20,20 @@

### Enhancements
* Add support for `vgpu` in `VcVirtualDeviceBackingInfo` class

### Fixes
* [vro-types] 251 / Add missing types to AD Plugin

### Fixes
* [artifact-manager] IACCOE-809 : Fixed an issue for importing Aria Pipelines with dependencies on another pipelines for rollback.

## v2.38.0 - 29 Mar 2024

### Enhancements
* [vrotsc] `vrotsc` refactoring. Updated documentation and reworks. Check [this](https://github.com/vmware/build-tools-for-vmware-aria/pull/233) for detailed information
* [artifact-manager] IAC-796 / Upgrade VCD archetype to support Angular 15
* [artifact-manage] IAC-796 / Upgrade VCD archetype to support Angular 15
* [vRA-NG] IAC-782 / vra-ng:pull : Added support for export of policies of the following types: Approval Policy, Day 2 Actions Policy, Deployment Limit Policy, Lease Policy, Resource Quota policy.
* [artifact-manager] IAC-782 / vrealize:push : Added support for import of policies of the following types: Approval Policy, Day 2 Actions Policy, Deployment Limit Policy, Lease Policy, Resource Quota policy.

### Fixes
* [vro-types] Fix SSHSession 'error' and 'state' types
* [typescript] 165 / vro:pull command for legacy archetype fails when workflow folder path name contains character '&'.
Expand Down Expand Up @@ -61,13 +65,12 @@
* [artifact-manager] IAC-788 / Improved Handling of Empty vRA Blueprint Versions for vRA 8.12.x.
* [artifact-manager] IAC-801 / Fix vRA catalog items appearing twice on multi page results.

## v2.35.2
### Enhancements
* [vro-types/o11n-plugin-aria] IAC-789 / Adding new Aria Automation Plugin vRO inventory Types.
* [vro-types/o11n-plugin-aria] IAC-798 / Deprecating SQLDatabaseManager getDatabase() function.
* [artifact-manager] IAC-786 / Set Aria Operations Default Policy vROPs 8.12.x.
* [artifact-manager] IAC-790 / Update usage of deprecated policy APIs for vROPs 8.12.x.
* [archetypes] IAC-797 / Improved content.yaml definition for "ts-vra-ng" and "vra-ng"
* [archetypes] IAC-797 / Improved content.yaml definition for "ts-vra-ng" and "vra-ng".

### Bugs
* [o11n-plugin-ssh] session esxiCode returns type void() instead of number.
Expand Down Expand Up @@ -246,6 +249,7 @@

## v2.26.0 - 19 Jul 2022


### Enhancements

* [artifact-manager] IAC-613 / Pulling Non Present Content needs to error.
Expand Down
8 changes: 4 additions & 4 deletions docs/versions/latest/Release.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,11 +258,11 @@ Republish the same tenants on VCD plugin upgrade instead of publish to all tenan

### Fix on legacy archetype failing with vro:pull (when workflow folder path name contains special characters(&))

#### Previous Behaviour
#### Previous Behavior

When executing a vro:pull command on a legacy archetype, the command will fail without proper error if the workflow paths contains special characters such as '&'.

#### Current Behaviour
#### Current Behavior

When executing a vro:pull command on a legacy archetype, if the workflows paths contains special character(&), the command will fail but will provide descriptive error message.

Expand All @@ -280,7 +280,7 @@ Method `error` and `state` should return type `String` instead of type `void`

VMware Cloud Director v10.6 is going to drop support for Angular v9 or less.

#### Previous Behaviour
#### Previous Behavior

VMware Cloud Director archetype is using:

Expand All @@ -301,7 +301,7 @@ The old archetype can still be bootstrapped with:
-DlicenseHeader= \
-DlicenseTechnicalPreview=false`

#### Current Behaviour
#### Current Behavior

VMware Cloud Director archetype is using:

Expand Down
6 changes: 3 additions & 3 deletions typescript/vrotsc/Gulpfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ gulp.task("compile", done => {

gulp.task("test", done => {
tsc("tests");
let error = undefined;
let error = "";
if (0 !== exec(process.argv[0], [path.join("dist", "src", "tests", "e2e.js")])) {
error = "One or more test cases failed.";
}
done(error);
done(error ? new Error(error): null);
});

gulp.task("clean", done => {
Expand Down Expand Up @@ -104,7 +104,7 @@ function tsc(projectName?: string): void {
exec(tscCommand, tscArgs, undefined, true);
}

function exec(command: string, args: string[] = [], cwd?: string, checkExitCode?: boolean): number {
function exec(command: string, args: string[] = [], cwd?: string, checkExitCode?: boolean): number | null{
const commandLine = `${command} ${args.join(" ")}`;
log(`Executing '${ansiColors.cyan(commandLine)}'...`);
const result = childProcess.spawnSync(`"${command}"`, args, {
Expand Down
31 changes: 31 additions & 0 deletions typescript/vrotsc/e2e/cases/5.3.3-tests/action1.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//Variadic Tuple Types
export function tail<T, U>(arr1: T[], arr2: U[]): Array<T | U>;
export function tail(arg) {
const [_, ...result] = arg;
return result
}
// Labeled Tuple Elements
type Range = [start: number, end: number];
export function foo(x: Range): void {
// ...
}
// Short-Circuiting Assignment Operators
let a = undefined;
const b = 3;

a ||= b;
a &&= b;
a ??= b;

export type VerticalAlignment = "top" | "middle" | "bottom";
export type HorizontalAlignment = "left" | "center" | "right";

// Takes
// | "top-left" | "top-center" | "top-right"
// | "middle-left" | "middle-center" | "middle-right"
// | "bottom-left" | "bottom-center" | "bottom-right"
export declare function setAlignment(value: `${VerticalAlignment}-${HorizontalAlignment}`): void;


let as = { prop: "hello" } as const;

7 changes: 7 additions & 0 deletions typescript/vrotsc/e2e/cases/5.3.3-tests/action2.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { foo, tail, setAlignment } from "./action1";

tail([1,2,3,4],[5,6,7,8]);


foo([1,32]); // works error
setAlignment("top-left"); // works!
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,7 @@ import { PolicyTemplate } from "vrotsc-annotations";
@PolicyTemplate({
name: "Policy Template Amqp",
path: "MyOrg/MyProject",
templateVersion: "v2",
elements: {
AMQPSubscription: {
type: "AMQP:Subscription",
events: {
OnMessage: "onMessage"
}
}
}
type: "AMQP:Subscription",
})
export class PolicyTemplateAmqp {
onMessage(self: AMQPSubscription, event: any) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,10 @@ import { PolicyTemplate } from "vrotsc-annotations";
@PolicyTemplate({
name: "Policy Template Schedule",
path: "MyOrg/MyProject",
templateVersion: "v2",
elements: {
Schedule: {
type: "Periodic Event",
events: {
OnExecute: "onExecute"
},
schedule: {
periode: "every-days",
when: "11:12:00,12:00:00",
timezone: "Europe/Sofia"
}
}
schedule: {
periode: "every-days",
when: "11:12:00,12:00:00",
timezone: "Europe/Sofia"
}
})
export class PolicyTemplateAmqp {
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,7 @@ import { PolicyTemplate } from "vrotsc-annotations";
@PolicyTemplate({
name: "Policy Template SNMP Trap",
path: "MyOrg/MyProject",
templateVersion: "v2",
elements: {
SNMPSnmpDevice: {
type: "SNMP:SnmpDevice",
events: {
OnTrap: "onTrap"
}
}
}
type: "SNMP:SnmpDevice"
})
export class PolicyTemplateSnmpTrap {
onTrap(self: SNMPSnmpDevice, event: any) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,7 @@ import { PolicyTemplate } from "vrotsc-annotations";
@PolicyTemplate({
name: "Policy Template SNMP Trap All",
path: "MyOrg/MyProject",
templateVersion: "v2",
elements: {
SNMPTrapHost: {
type: "SNMP:TrapHost",
events: {
OnTrapAll: "onTrapAll"
}
}
}
type: "SNMP:TrapHost"
})
export class PolicyTemplateSnmpTrapAll {
onTrapAll(self: SNMPTrapHost, event: any) {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions typescript/vrotsc/e2e/cases/nullable-reference/action1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ interface TestInterface {
}
}

var obj: TestInterface = {};
System.log(`obj.prop1.prop2.prop3=${obj.prop1?.prop2?.prop3}`);
var obj1: TestInterface = {};
System.log(`obj.prop1.prop2.prop3=${obj1.prop1?.prop2?.prop3}`);
4 changes: 2 additions & 2 deletions typescript/vrotsc/e2e/cases/promise/action2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ export async function asyncThrowAnError(): Promise<void> {
throw new Error("test error");
}

export function all(): Promise<string[]> {
export function all(): Promise<[string,string, string]> {
return Promise.all(
[
Promise.resolve("test1"),
new Promise((resolve) => {
new Promise((resolve: (value: string) => void) => {
resolve("test2");
}),
Promise.resolve("test3")
Expand Down
23 changes: 23 additions & 0 deletions typescript/vrotsc/e2e/expect/5.3.3-tests/actions/action1.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* @return {Any}
*/
(function () {
var exports = {};
function tail(arg) {
var _ = arg[0], result = arg.slice(1);
return result;
}
exports.tail = tail;
function foo(x) {
// ...
}
exports.foo = foo;
// Short-Circuiting Assignment Operators
var a = undefined;
var b = 3;
a || (a = b);
a && (a = b);
a !== null && a !== void 0 ? a : (a = b);
var as = { prop: "hello" };
return exports;
});
Loading
Loading