Azure / azure-rest-api-specs

The source for REST API specifications for Microsoft Azure.
MIT License
2.6k stars 5.01k forks source link

`Invalid URL / TypeError: Invalid URL` when processing Chaos Experiments #27372

Open jeffreyaven opened 7 months ago

jeffreyaven commented 7 months ago

when processing this tag in azure-rest-api-specs/specification/chaos/resource-manager/readme.md:

### Tag: package-2024-01

These settings apply only when `--tag=package-2024-01` is specified on the command line.

```yaml $(tag) == 'package-2024-01'
input-file:
  - Microsoft.Chaos/stable/2024-01-01/capabilities.json
  - Microsoft.Chaos/stable/2024-01-01/capabilityTypes.json
  - Microsoft.Chaos/stable/2024-01-01/experiments.json
  - Microsoft.Chaos/stable/2024-01-01/operationStatuses.json
  - Microsoft.Chaos/stable/2024-01-01/operations.json
  - Microsoft.Chaos/stable/2024-01-01/targetTypes.json
  - Microsoft.Chaos/stable/2024-01-01/targets.json
directive:
  - from: swagger-document
    where: "$.definitions.action"
    transform: >
      $["x-ms-client-name"] = "ChaosExperimentAction";
  - from: swagger-document
    where: "$.definitions.branch"
    transform: >
      $["x-ms-client-name"] = "ChaosExperimentBranch";
  - from: swagger-document
    where: "$.definitions.step"
    transform: >
      $["x-ms-client-name"] = "ChaosExperimentStep";
  - from: swagger-document
    where: "$.definitions.filter"
    transform: >
      $["x-ms-client-name"] = "ChaosTargetFilter";
  - from: swagger-document
    where: "$.definitions.simpleFilter"
    transform: >
      $["x-ms-client-name"] = "ChaosTargetSimpleFilter";
  - from: swagger-document
    where: "$.definitions.simpleFilterParameters"
    transform: >
      $["x-ms-client-name"] = "ChaosTargetSimpleFilterParameters";
  - from: swagger-document
    where: "$.definitions.selector"
    transform: >
      $["x-ms-client-name"] = "ChaosTargetSelector";
  - from: swagger-document
    where: "$.definitions.listSelector"
    transform: >
      $["x-ms-client-name"] = "ChaosTargetListSelector";
  - from: swagger-document
    where: "$.definitions.querySelector"
    transform: >
      $["x-ms-client-name"] = "ChaosTargetQuerySelector";

the following failure occurs:

debug   | [12.07 s] openapi-document/emitter - END [0 s][109 MB]
fatal   | Process() cancelled due to exception : Invalid URL / TypeError: Invalid URL
    at new URL (node:internal/url:775:36)
    at /mnt/c/LocalGitRepos/stackql/stackql-azure-openapi/nodemodules/@autorest/core/dist/src_lib_autorest-corets.js:3135:52
    at Array.map (<anonymous>)
    at resolveCommonRoot (/mnt/c/LocalGitRepos/stackql/stackql-azure-openapi/nodemodules/@autorest/core/dist/src_lib_autorest-corets.js:3135:41)
    at resolveNewIdentity (/mnt/c/LocalGitRepos/stackql/stackql-azure-openapi/nodemodules/@autorest/core/dist/src_lib_autorest-corets.js:3161:18)
    at normalizeIdentity (/mnt/c/LocalGitRepos/stackql/stackql-azure-openapi/nodemodules/@autorest/core/dist/src_lib_autorest-corets.js:3172:25)
    at async ScheduleNode (/mnt/c/LocalGitRepos/stackql/stackql-azure-openapi/nodemodules/@autorest/core/dist/src_lib_autorest-corets.js:1351:29)

by process of elimination I have narrowed the issue to this file : azure-rest-api-specs/specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/experiments.json

JackTn commented 7 months ago

@RenzoPrettoMS @brrusino can you check on this issues. Let me know if you have any question !

RenzoPrettoMS commented 7 months ago

Hello @jeffreyaven! I will be looking into this issue. What does you mean by "processing this tag"? Can we get repro steps as to how you reached this point?