Skip to content

Commit a67818a

Browse files
committed
Allow New RP if doesnt exists in specs folder
1 parent 5925082 commit a67818a

2 files changed

Lines changed: 5 additions & 8 deletions

File tree

.github/workflows/src/arm-lease-validation/arm-lease-validation.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,7 @@ export async function validateLeaseContent(leaseFile, relativePath, workspaceRoo
188188
serviceExists = true;
189189
}
190190
} catch {
191-
// Service folder doesn't exist
192-
errors.push(
193-
`Service folder not found: specification/${orgName}. The orgName in the lease path must match an existing service folder in specification/.`,
194-
);
191+
// Service folder doesn't exist - skip validation (new RP with no specs yet)
195192
}
196193

197194
// Then check if resource-manager/<rpNamespace>/ exists (skip if new RP or service doesn't exist)

.github/workflows/test/arm-lease-validation/arm-lease-validation.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,16 +193,16 @@ describe("validate-arm-leases", () => {
193193
expect(mockStat).toHaveBeenCalledTimes(2);
194194
});
195195

196-
it("fails when service folder does not exist", async () => {
196+
it("allows new RP when service folder does not exist", async () => {
197197
mockReadFile.mockResolvedValue(validYaml);
198198
mockStat.mockRejectedValue(new Error("ENOENT"));
199199

200200
const result = await validateLeaseContent(
201-
"/repo/.github/arm-leases/invalidservice/Microsoft.Test/lease.yaml",
202-
".github/arm-leases/invalidservice/Microsoft.Test/lease.yaml",
201+
"/repo/.github/arm-leases/newservice/Microsoft.Test/lease.yaml",
202+
".github/arm-leases/newservice/Microsoft.Test/lease.yaml",
203203
"/repo",
204204
);
205-
expect(result.errors.some((e) => e.includes("Service folder not found"))).toBe(true);
205+
expect(result.errors).toHaveLength(0);
206206
});
207207

208208
it("allows new RP when service exists but RP folder does not", async () => {

0 commit comments

Comments
 (0)