-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
documentation: documenting the current architecture/workflow and summarising the proposed changes to the Data API going forward #3425
Conversation
…anges proposed for Data API v2 This PR documents the current architecture/workflow - but also documents/discusses the proposed changes for Data API v2 (around having the Data API become the sole owner of the API as we've previously discussed). I've also split the `how automation works` section of the README out into the docs folder, for easier grouping
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @tombuildsstuff for the diagrams. Left some suggestions which would be good to have looked at.
The following guides are internal/technical documentation - documenting the overall architecture and requiring additional context: | ||
|
||
* [Internals: Architecture Diagrams](internals-architecture-diagrams.md) | ||
* [Internals: How the Automation Works](internals-how-automation-works.md) | ||
* [Internals: Future - changes to the Data API/Architecture](internals-architectural-changes-data-api.md) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As suggested over in #3266 I think these should be under a different header and not ## Guides
Whilst it was possible to coordinate changes to both Importers and the Data API for the API Definitions, given that we | ||
may need to support additional Importers in the future (e.g. Data Plane) and that in order for each Importer to support | ||
Identifying and Building Terraform Resources in the future - it's likely that divergences would emerge over time and that | ||
there's value in having a greater separation of concerns here. | ||
|
||
As such there's a number of improvements we can make to the system design which'll make life easier going forwards, | ||
namely having the Data API owning the API Definitions - and splitting out a dedicated tool for identifying and building | ||
the Terraform Data Sources and Resources from the API Definitions. | ||
|
||
This approach allows each tool to have a single focus - becoming far simpler and thus easier to reason with - which will | ||
enable reducing the complexity of the `importer-rest-api-specs` tool in particular. | ||
|
||
To do this we'll want to make two changes to the current system design: | ||
|
||
1. Have the Data API become the sole maintainer of the API Definitions. | ||
2. Split out the Terraform Identification/Builder logic from the `importer-rest-api-specs` tool. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're repeating yourself in several different ways here, this can and should be expressed more succinctly.
Whilst it was possible to coordinate changes to both Importers and the Data API for the API Definitions, given that we | |
may need to support additional Importers in the future (e.g. Data Plane) and that in order for each Importer to support | |
Identifying and Building Terraform Resources in the future - it's likely that divergences would emerge over time and that | |
there's value in having a greater separation of concerns here. | |
As such there's a number of improvements we can make to the system design which'll make life easier going forwards, | |
namely having the Data API owning the API Definitions - and splitting out a dedicated tool for identifying and building | |
the Terraform Data Sources and Resources from the API Definitions. | |
This approach allows each tool to have a single focus - becoming far simpler and thus easier to reason with - which will | |
enable reducing the complexity of the `importer-rest-api-specs` tool in particular. | |
To do this we'll want to make two changes to the current system design: | |
1. Have the Data API become the sole maintainer of the API Definitions. | |
2. Split out the Terraform Identification/Builder logic from the `importer-rest-api-specs` tool. | |
Currently an Importer has the following responsibilities: | |
* Parsing incoming data from a service type e.g. Resource Manager, Microsoft Graph and potentially Data Plane in the future | |
* Outputting API definitions for the `go-azure-sdk` | |
* Identifying and building Terraform resources | |
Divergences within the different service types may emerge over time, which would result in additional overhead and complexity to the existing design. As a result there's value in having a greater separation of concerns here with the goal being a singular focus for each tool, thus reducing the complexity of the Importer, i.e. `importer-rest-api-specs`. | |
To do this we'll want to make two changes to the current system design: | |
1. Have the Data API become the sole maintainer of the API Definitions. | |
2. Split out the Terraform Identification/Builder logic from the `importer-rest-api-specs` tool. |
Whilst the files used for the API Definitions are in sync, we can gradually migrate from the current setup to publishing | ||
the API Definitions to the Data API. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand how the files being in sync allows us to gradually migrate.
Whilst the files used for the API Definitions are in sync, we can gradually migrate from the current setup to publishing | ||
the API Definitions to the Data API. | ||
|
||
This means that we'll need to have a Data API instance available in order to run each Importer, which whilst might | ||
sound not ideal - means that we could extend the Data API to better support local development in the future. | ||
For example, supporting launching the Data API with a feature-flag where the API Definitions are stored in-memory | ||
only - meaning that these don't need to be persisted to disk, speeding up local development - or other changes which | ||
may seem helpful in the future. | ||
|
||
In order to run this in automation, we'll need to add a couple of new modes to the `wrapper-automation` tool, to support | ||
launching the Data API prior to running each Importer, but that should be mostly reusable from the existing logic / a | ||
previous implementation as can be found [in this pull request](https://github.com/hashicorp/pandora/pull/1637). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels very much like specific implementation detail which is information that should go into an issue rather than here.
Rather than doing this we should introduce a separate tool, working name `Terraform Resource Builder` - which focuses | ||
solely on Building Terraform Resources (that is, the Terraform Schema, any Mappings and the Acceptance Tests) based | ||
on the data within the Data API. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You already clarified what building a terraform resource entails, this is unnecessary repetition
Rather than doing this we should introduce a separate tool, working name `Terraform Resource Builder` - which focuses | |
solely on Building Terraform Resources (that is, the Terraform Schema, any Mappings and the Acceptance Tests) based | |
on the data within the Data API. | |
Rather than doing this we should introduce a separate tool, working name `Terraform Resource Builder`, which focuses | |
solely on Building Terraform Resources based on the data within the Data API. |
This allows each Importer (that is, `importer-rest-api-specs` and `importer-msgraph-metadata`) to remain focused on | ||
Importing the API Definitions - where the API Definitions are then pushed into the Data API - with the Terraform Resource | ||
Builder pulling information from the Data API - and subsequently pushing any changes back to it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Context has been set on what importers we have and are referring to, this is also repetition
This allows each Importer (that is, `importer-rest-api-specs` and `importer-msgraph-metadata`) to remain focused on | |
Importing the API Definitions - where the API Definitions are then pushed into the Data API - with the Terraform Resource | |
Builder pulling information from the Data API - and subsequently pushing any changes back to it. | |
This allows each Importer to remain focused on | |
Importing the API Definitions - where the API Definitions are then pushed into the Data API - with the Terraform Resource | |
Builder pulling information from the Data API - and subsequently pushing any changes back to it. |
Importing the API Definitions - where the API Definitions are then pushed into the Data API - with the Terraform Resource | ||
Builder pulling information from the Data API - and subsequently pushing any changes back to it. | ||
|
||
Whilst spreading these tools out does introduce a little more overhead, it makes the process boundaries clearer - since |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whilst spreading these tools out does introduce a little more overhead, it makes the process boundaries clearer - since | |
Whilst spreading these tools out does introduce a little more overhead, it makes the process boundaries clearer, since |
|
||
Whilst spreading these tools out does introduce a little more overhead, it makes the process boundaries clearer - since | ||
the inputs and outputs for each tool are more clearly defined. For example, this should make supporting Data Sources in | ||
the future simpler - since we can first add support the Terraform Resource Builder, push that data into the Data API, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know what this is trying to say first add support the Terraform Resource Builder
add or support? or add support for what?
the future simpler - since we can first add support the Terraform Resource Builder, push that data into the Data API, | |
the future simpler, since we can first add support the Terraform Resource Builder, push that data into the Data API, |
Closing this out for now |
This PR documents the current architecture/workflow - but also documents/discusses the proposed changes for Data API v2 (around having the Data API become the sole owner of the API as we've previously discussed).
I've also split the
how automation works
section of the README out into the docs folder, for easier grouping