Skip to content

Commit c0e2f53

Browse files
authored
Merge pull request #70 from Azure/versioning
feat: AZAPI Provider Migration with Version Management
2 parents c27834a + 86923e0 commit c0e2f53

File tree

245 files changed

+45402
-28226
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

245 files changed

+45402
-28226
lines changed

.devcontainer/devcontainer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010
"version": "latest"
1111
},
1212
"ghcr.io/devcontainers/features/go:1": {
13-
"version": "1.19"
13+
"version": "1.23"
1414
},
1515
"ghcr.io/devcontainers/features/terraform:1": {
1616
"version": "1.5.4",
1717
"tflint": "latest",
1818
"terragrunt": "latest"
1919
},
2020
"ghcr.io/devcontainers-contrib/features/tfcdk-cli:1": {
21-
"version": "0.17.3"
21+
"version": "0.20.8"
2222
},
2323
"ghcr.io/devcontainers-contrib/features/jest:2": {
2424
"version": "latest"

.eslintrc.json

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

.github/workflows/build.yml

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

.github/workflows/release.yml

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/upgrade-main.yml

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

.gitignore

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

.projen/deps.json

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

.projen/tasks.json

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

.projenrc.ts

Lines changed: 85 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import { JsonPatch } from "projen/lib/json-patch";
55
const project = new cdktf.ConstructLibraryCdktf({
66
author: "Microsoft",
77
authorAddress: "https://microsoft.com",
8-
cdktfVersion: "0.17.3",
9-
jsiiVersion: "~5.2.0",
8+
cdktfVersion: "0.20.8",
9+
jsiiVersion: "~5.9.0",
1010
description:
11-
"A collection of CDK modules for provisioning and managing Terraform resources efficiently.",
11+
"Azure CDK constructs using AZAPI provider for direct Azure REST API access. Version 1.0.0 - Major breaking change migration from AzureRM to AZAPI.",
1212
keywords: [
1313
"cdk",
1414
"cdktf",
@@ -17,14 +17,16 @@ const project = new cdktf.ConstructLibraryCdktf({
1717
"cloud",
1818
"devops",
1919
"azure",
20+
"azapi",
21+
"rest-api",
2022
],
21-
constructsVersion: "^10.1.106",
22-
typescriptVersion: "~5.2.0", // should always be the same major/minor as JSII
23+
constructsVersion: "^10.3.0",
24+
typescriptVersion: "~5.9.3", // should always be the same major/minor as JSII
2325
minNodeVersion: "20.10.0",
2426
defaultReleaseBranch: "main",
2527
name: "@microsoft/terraform-cdk-constructs",
28+
majorVersion: 1, // Set to version 1.0.0 for AZAPI migration
2629
projenrcTs: true,
27-
prerelease: "pre",
2830
jest: true,
2931
testdir: "",
3032
prettier: true,
@@ -50,27 +52,19 @@ const project = new cdktf.ConstructLibraryCdktf({
5052
jestOptions: {
5153
updateSnapshot: UpdateSnapshot.NEVER,
5254
},
53-
deps: [
54-
55-
"nanoid@^4.0.2",
56-
"ts-md5@^1.3.1",
57-
58-
//"constructs@^10.1.106",
59-
"moment@^2.30.1",
60-
],
61-
peerDeps: ["@cdktf/[email protected]"],
62-
bundledDeps: ["moment@^2.30.1", "ts-md5@^1.3.1", "nanoid@^4.0.2"],
55+
// Dependencies for AZAPI-only implementation (removed AzureRM dependencies)
56+
// AZAPI provider classes are built into this package in src/core-azure/lib/providers-azapi/
57+
deps: ["[email protected]"],
58+
peerDeps: ["[email protected]", "constructs@^10.3.0"], // Only core CDK dependencies
59+
bundledDeps: [],
6360
devDeps: [
64-
65-
66-
"@types/jest@^29.5.8",
67-
"@types/node@^18.7.18",
68-
"jest@^29.6.1",
69-
"ts-jest@^29.1.1",
70-
"ts-node@^10.9.1",
71-
"typescript@^4.9.5",
72-
73-
"@types/moment@^2.13.0",
61+
62+
"@types/jest@^29.5.13",
63+
"@types/node@^22",
64+
"jest@^29.7.0",
65+
"ts-jest@^29.2.5",
66+
"ts-node@^10.9.2",
67+
"typescript@~5.9.3",
7468
],
7569
releaseToNpm: true,
7670
});
@@ -177,15 +171,80 @@ if (buildWorkflow) {
177171
);
178172
}
179173

174+
// Add include-hidden-files to upload-artifact and download-artifact steps
175+
// NOTE: addOverride applies to the BASE template BEFORE JsonPatch operations
176+
// so use indices from the original template, not after Azure step insertion
177+
178+
// For build workflow (BEFORE Azure step is inserted at position 2):
179+
// Step 5 = Upload patch, Step 8 = Upload artifact
180+
if (buildWorkflow) {
181+
buildWorkflow.addOverride(
182+
"jobs.build.steps.5.with.include-hidden-files",
183+
true,
184+
);
185+
buildWorkflow.addOverride(
186+
"jobs.build.steps.8.with.include-hidden-files",
187+
true,
188+
);
189+
// Add include-hidden-files to download-artifact steps in package jobs
190+
// package-js: step 1 = Download build artifacts (index 1, after setup-node at index 0)
191+
buildWorkflow.addOverride(
192+
"jobs.package-js.steps.1.with.include-hidden-files",
193+
true,
194+
);
195+
// package-java: step 2 = Download build artifacts (index 2, after setup-java and setup-node)
196+
buildWorkflow.addOverride(
197+
"jobs.package-java.steps.2.with.include-hidden-files",
198+
true,
199+
);
200+
// package-python: step 2 = Download build artifacts (index 2, after setup-node and setup-python)
201+
buildWorkflow.addOverride(
202+
"jobs.package-python.steps.2.with.include-hidden-files",
203+
true,
204+
);
205+
// package-dotnet: step 2 = Download build artifacts (index 2, after setup-node and setup-dotnet)
206+
buildWorkflow.addOverride(
207+
"jobs.package-dotnet.steps.2.with.include-hidden-files",
208+
true,
209+
);
210+
}
211+
212+
// For release workflow (BEFORE Azure step is inserted at position 3):
213+
// Step 8 = Upload artifact
214+
if (releaseWorkflow) {
215+
releaseWorkflow.addOverride(
216+
"jobs.release.steps.8.with.include-hidden-files",
217+
true,
218+
);
219+
}
220+
221+
// For upgrade-main workflow (no Azure step, use original indices):
222+
// Step 5 = Upload patch
223+
const upgradeWorkflow = project.tryFindObjectFile(
224+
".github/workflows/upgrade-main.yml",
225+
);
226+
if (upgradeWorkflow) {
227+
upgradeWorkflow.addOverride(
228+
"jobs.upgrade.steps.5.with.include-hidden-files",
229+
true,
230+
);
231+
}
232+
180233
// Add .gitignore entries
181234
project.gitignore.include("cdk.out");
182235
project.gitignore.exclude("cdktf.out");
183236
project.gitignore.exclude("/test");
184237
project.gitignore.exclude("*terraform.*.tfstate*");
238+
project.gitignore.exclude(".gen"); // Exclude generated CDKTF provider bindings
185239

186240
project.prettier?.addIgnorePattern(".github");
187241
project.eslint?.addIgnorePattern(".github");
188242

243+
// Ignore generated AZAPI provider files completely
244+
project.eslint?.addIgnorePattern(
245+
"src/core-azure/lib/azapi/providers-azapi/**/*.ts",
246+
);
247+
189248
// Add generate index script
190249
project.addScripts({
191250
"generate-index": "node ./scripts/generate-index.js",

0 commit comments

Comments
 (0)