Skip to content

Commit 988652e

Browse files
markcowlmikeharder
authored andcommitted
Use conditional compile (Azure#24374)
* Add conditional compile of client.tsp * Always execute from main.tsp, always check client.tsp * Fix script * Remove yaml reference * Update specification/cognitiveservices/HealthInsights/healthinsights.oncophenotype/tspconfig.yaml --------- Co-authored-by: Mike Harder <[email protected]>
1 parent 10fb6ad commit 988652e

File tree

10 files changed

+69
-45
lines changed

10 files changed

+69
-45
lines changed

eng/pipelines/templates/steps/typespec-ci.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,14 @@ steps:
1414
pushd ${{parameters.Folder}}
1515
1616
# Pass "--no" to ensure npx does not install anything (TypeSpec compiler should already be installed)
17-
npx --no tsp compile . --warn-as-error || exit_code=1
17+
18+
if test -f main.tsp; then
19+
npx --no tsp compile . --warn-as-error || exit_code=1
20+
fi
21+
if test -f client.tsp; then
22+
npx --no tsp compile client.tsp --no-emit --warn-as-error || exit_code=1
23+
fi
24+
1825
1926
# Format parent folder to include shared files (disabled until formatting diffs are fixed)
2027
# npx tsp format ../**/*.tsp

eng/pipelines/typespec-ci.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,16 @@ jobs:
4949
Folder: specification/cognitiveservices/HealthInsights/healthinsights.openapi
5050
DisplayName: healthinsights.openapi
5151

52+
- template: templates/steps/typespec-ci.yml
53+
parameters:
54+
Folder: specification/cognitiveservices/HealthInsights/healthinsights.oncophenotype
55+
DisplayName: healthinsights.oncophenotype
56+
57+
- template: templates/steps/typespec-ci.yml
58+
parameters:
59+
Folder: specification/cognitiveservices/HealthInsights/healthinsights.trialmatcher
60+
DisplayName: healthinsights.trialmatcher
61+
5262
- template: templates/steps/typespec-ci.yml
5363
parameters:
5464
Folder: specification/cognitiveservices/OpenAI.Inference

package-lock.json

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"@azure-tools/typespec-azure-core": "0.31.0",
1212
"@azure-tools/typespec-azure-resource-manager": "0.31.0",
1313
"@azure-tools/typespec-providerhub": "0.31.0",
14+
"@azure-tools/typespec-client-generator-core": "0.31.0",
1415
"@typespec/compiler": "0.45.0",
1516
"@azure/avocado": "^0.8.4",
1617
"@types/prettier": "^2.7.2",

specification/cognitiveservices/AnomalyDetector/client.tsp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ import "./main.tsp";
33

44
using Azure.ClientGenerator.Core;
55

6-
@@convenientAPI(AnomalyDetector.Univariate.DetectUnivariateEntireSeries, false)
6+
@@convenientAPI(AnomalyDetector.Univariate.detectUnivariateEntireSeries, false)

specification/cognitiveservices/HealthInsights/healthinsights.oncophenotype/client.tsp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ namespace ClientForAzureHealthInsights;
1717
service: AzureHealthInsights
1818
})
1919
interface CancerProfilingClient {
20-
InferCancerProfile is AzureHealthInsights.OncoPhenotype.createJob;
20+
#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "https://github.com/microsoft/typespec/issues/2037"
21+
inferCancerProfile is AzureHealthInsights.OncoPhenotype.createJob;
2122
}
Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,19 @@
1-
emit: [
2-
"@azure-tools/typespec-csharp",
3-
# "@azure-tools/cadl-python",
4-
# "@azure-tools/typespec-java",
5-
# "@azure-tools/cadl-typescript",
6-
]
7-
1+
emit: []
82
options:
93
"@azure-tools/typespec-csharp":
104
namespace : "Azure.Health.Insights.CancerProfiling"
115
clear-output-folder : true
126
new-project : false
137
model-namespace : false
14-
# "@azure-tools/typespec-java":
15-
# namespace: "Com.Azure.Health.Insights.CancerProfiling"
16-
# clear-output-folder: true
17-
# new-project: false
18-
# model-namespace: false
19-
# "@azure-tools/cadl-python":
20-
# package-mode: "dataplane"
21-
# package-name: "azure-healthinsights-cancerprofiling"
22-
# "@azure-tools/cadl-typescript":
23-
# packageDetails:
24-
# name: "@azure-rest/health-insights-cancerprofiling"
25-
# description: "Azure Health Insights CancerProfiling"
8+
"@azure-tools/typespec-java":
9+
namespace: "Com.Azure.Health.Insights.CancerProfiling"
10+
clear-output-folder: true
11+
new-project: false
12+
model-namespace: false
13+
"@azure-tools/cadl-python":
14+
package-mode: "dataplane"
15+
package-name: "azure-healthinsights-cancerprofiling"
16+
"@azure-tools/cadl-typescript":
17+
packageDetails:
18+
name: "@azure-rest/health-insights-cancerprofiling"
19+
description: "Azure Health Insights CancerProfiling"

specification/cognitiveservices/HealthInsights/healthinsights.openapi/tspconfig.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
emit: [
22
"@azure-tools/typespec-autorest",
3-
# "@azure-tools/cadl-apiview"
43
]
5-
6-
74
options:
85
"@azure-tools/typespec-autorest":
96
azure-resource-provider-folder: "data-plane"

specification/cognitiveservices/HealthInsights/healthinsights.trialmatcher/client.tsp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ namespace ClientForAzureHealthInsights;
1717
service: AzureHealthInsights
1818
})
1919
interface ClinicalMatchingClient {
20-
MatchTrials is AzureHealthInsights.TrialMatcher.createJob;
20+
#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "https://github.com/microsoft/typespec/issues/2037"
21+
matchTrials is AzureHealthInsights.TrialMatcher.createJob;
2122
}
Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,19 @@
1-
emit: [
2-
"@azure-tools/typespec-csharp",
3-
# "@azure-tools/cadl-python",
4-
# "@azure-tools/typespec-java",
5-
# "@azure-tools/cadl-typescript",
6-
]
7-
1+
emit: []
82
options:
93
"@azure-tools/typespec-csharp":
104
namespace : "Azure.Health.Insights.ClinicalMatching"
115
clear-output-folder : true
126
new-project : false
137
model-namespace : false
14-
# "@azure-tools/typespec-java":
15-
# namespace: "Com.Azure.Health.Insights.ClinicalMatching"
16-
# clear-output-folder: true
17-
# new-project: false
18-
# model-namespace: false
19-
# "@azure-tools/cadl-python":
20-
# package-mode: "dataplane"
21-
# package-name: "azure-healthinsights-clinicalmatching"
22-
# "@azure-tools/cadl-typescript":
23-
# packageDetails:
24-
# name: "@azure-rest/health-insights-clinicalmatching"
25-
# description: "Azure Health Insights ClinicalMatching"
8+
"@azure-tools/typespec-java":
9+
namespace: "Com.Azure.Health.Insights.ClinicalMatching"
10+
clear-output-folder: true
11+
new-project: false
12+
model-namespace: false
13+
"@azure-tools/cadl-python":
14+
package-mode: "dataplane"
15+
package-name: "azure-healthinsights-clinicalmatching"
16+
"@azure-tools/cadl-typescript":
17+
packageDetails:
18+
name: "@azure-rest/health-insights-clinicalmatching"
19+
description: "Azure Health Insights ClinicalMatching"

0 commit comments

Comments
 (0)