Skip to content

Commit 7e0b848

Browse files
author
Konrad Jamrozik
committed
elaborate
1 parent b81f1a7 commit 7e0b848

1 file changed

Lines changed: 21 additions & 16 deletions

File tree

documentation/directory-structure.md

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -50,34 +50,30 @@ A `service` **must version uniformly**. This means that the service,
5050
all its dependencies, and all artifacts generated from the service,
5151
**must** have the same version.
5252

53-
In practice, this means, for an example service with version `2024-03-25`:
53+
In practice this means, for an example service with version `2024-03-25`:
5454

5555
- All the OpenAPI specification `.json` files the service is composed of must have the same version of `2024-03-25`.
56-
- All the shared specifications (i.e. `common-types`) the service depends on must have the same version.
56+
- All the shared specifications (i.e. `common-types`) the service depends on must have the same version,
57+
[e.g. `v6`][common-types v6] (but it can be different from the version of the service).
5758
- In case of ARM service, all the resource types must have the same version of `2024-03-25`.
5859
- The language SDKs generated from the service must have the same version of `2024-03-25`.
5960
- The documentation published for the service must have the same version of `2024-03-25`.
6061
- Update to any version of the above requires update of all the other versions.
61-
For example, if `common-types` published an updated version of `2024-04-17`,
62+
For example, if `common-types` published an updated version of `v7`,
6263
then if the service wants to take dependency on it, it can only do it in
63-
a new version of `2024-04-17`.
64+
a new version. For example, `2024-04-17`.
6465
Because the service version is now `2024-04-17`, all the OpenAPI specification `.json` files the service is composed
65-
of must have the same version of `2024-04-17`.
66+
of must have the same version of `2024-04-17` and the `info.version` property must say `2024-04-17`.
6667
In addition, a new SDK must be generated from the service, and new documentation published, both tagged with
6768
version `2024-04-17`.
6869
- As a consequence of the above, if given service version uses `-preview` version anywhere, then the service
6970
version itself must be `-preview`, it can depend **only** on `-preview` versions, and the generated SDK
7071
and published docs must denote they are in `preview` too.
7172

72-
TODO:
73-
- These rules seem too strict. What if cadence of releasing `common-types` does not align with cadence of releasing
74-
given service? Same for resource types?
75-
- For example, service got released on `2024-01-01`, then new `common-types` got released on `2024-02-01` and on
76-
`2024-03-01` new service version is to be released? Can a `2024-03-01` service version depend on `2024-02-01` `common-types`?
77-
- If a service version can depend on `common-types` of a different version, can the generated SDK also depend
78-
on different `.json` versions?
79-
See e.g. [this bad setup of compute rm 2024-03-01](https://github.com/Azure/azure-rest-api-specs/blob/main/specification/compute/resource-manager/readme.md#tag-package-2024-03-01).
80-
Could we make package `2024-03-01` depend on, say, `common-types` of `2024-02-01` and all other `.json` files of, say, `2024-02-15` ?
73+
TODO:
74+
- Per the rules above, a service and everything related must have exactly the same version, with the singular exception
75+
of `common-types`, which use different versioning scheme anyway (`v1`, `v2`, ...). Is this what we want?
76+
What about `common-types` specific to a service group?
8177
- What is the difference between resource types and OpenAPI specification `.json` files?
8278
Can one deduce the resource type version by looking at the source OpenAPI `.json` ?
8379
- What does it mean for OpenAPI specification `.json` to "have a version"? Are we talking about it being in appropriate
@@ -245,6 +241,8 @@ One service has one SDK package and one documentation portal, while a service gr
245241
In case of a `service group`, the structure is like for `service`, but the contents of each
246242
`resource-manager/<RPNS>` and `data-plane/<dataPlaneSubfolder>` is instead additionally nested in a `<service>` parent, for each service in the service group.
247243

244+
The Azure team that has a service group has following directory structure:
245+
248246
- `<azureTeam>/<typeSpecFolder>` (multiple folders)
249247
- `<azureTeam>/resource-manager/<RPNS>/<service>` (multiple folders, one for each value of `<service>`)
250248
- `<azureTeam>/data-plane/<dataPlaneSubfolder>/<service>` (multiple folders, one for each value of `<service>`)
@@ -284,8 +282,14 @@ services for examples of different versioning cycles in a service group.
284282

285283
### Migrating from singular service to service group
286284

287-
TODO: how do we do it? This is the case of:
288-
- https://github.com/Azure/azure-rest-api-specs-pr/pull/17717#issuecomment-2081974288
285+
TODO:
286+
- how do we do it? This is the case of:
287+
- https://github.com/Azure/azure-rest-api-specs-pr/pull/17717#issuecomment-2081974288
288+
- Specifically, if given directory has `stable` and `preview` children, is it allowed to also have other children?
289+
This is the case that is necessary in case of migration: `<azureTeam>/resource-manager/<RPNS>/` has `stable` and `preview` children, but with the service
290+
group addition, it also has `<service>` child, beside `stable` and `preview`.
291+
- Do we allow any other sharing of common types than `common-types` ? In the example PR we have `operations`. Also, these
292+
operations are versioned like API versions, not like the global `common-types`.
289293

290294
## Deprecated structure and hand-written OpenAPI specs
291295

@@ -317,6 +321,7 @@ All of the aforementioned cases are considered legacy and are not allowed going
317321
[aks REST reference 2024-01-01]: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-01-01
318322
[Azure Kubernetes Fleet Manager]: https://learn.microsoft.com/en-us/azure/kubernetes-fleet/
319323
[Azure Kubernetes Service]: https://learn.microsoft.com/en-us/azure/aks/
324+
[common-types v6]: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/common-types/resource-management/
320325
[fleet REST reference 2023-10-15]: https://learn.microsoft.com/en-us/rest/api/fleet/operation-groups?view=rest-fleet-2023-10-15
321326
[Resource Provider list]: https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/azure-services-resource-providers#match-resource-provider-to-service
322327
[Specification index]: https://azure.github.io/azure-sdk/releases/latest/all/specs.html

0 commit comments

Comments
 (0)