Skip to content
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

[Feature Req] Display direct dependencies for unbranded generation #4690

Open
jsquire opened this issue May 8, 2024 · 1 comment
Open

[Feature Req] Display direct dependencies for unbranded generation #4690

jsquire opened this issue May 8, 2024 · 1 comment
Labels
Client This issue points to a problem in the data-plane of the library. CodeGen Issues that relate to code generation v3 Version 3 of AutoRest C# generator.

Comments

@jsquire
Copy link
Member

jsquire commented May 8, 2024

Problem statement

Code emitted by the generator has implicit dependencies on certain fundamental libraries, such as System.ClientModel and Azure.Core. Because the generated code uses these libraries extensively, it is often bound to a specific version of the libraries. For the initial generation, a project file is emitted which references the needed dependencies. After the initial run, the generator does not make changes to the project file.

For Azure libraries, this is reasonable because dependency versions are managed centrally, and the versions of the fundamental libraries are kept synchronized to the version needed by the generator. For unbranded libraries, however, this leaves a gap. Because unbranded libraries cannot assume the Azure SDK environment, the package references in the project file track the versions of dependences. These are not centrally managed and, thus, not synchronized with the versions needed by the generator.

This creates a challenge for unbranded library authors when running code generation. The generator expects certain versions of dependencies but does not maintain those versions in the generated project file. It also does not advertise the needed dependency versions, so project authors are not aware of them. This results in a scenario where a project may be left unable to compile after running code generation.

Challenges

  • Because library authors own the project file and may customize it to meet their needs, it is not feasible for the generator to assume that it can be safely updated.

Proposed solution

The generator should advertise its dependencies when code is generated. Because code generation is inherently a command line tool, writing out an explicit and clear section with dependency information to the console window should allow library authors to understand the generator's needs.

Along with the name and version of the dependency, the generator should also include the date that the version reference was last changed. This would allow library authors to more quickly identify and react to changes.

Examples from prior art

The npm package manager shows updates in the following format:
image

It also generates a dependency tree on demand:
image

The Angular CLI emits dependency information in the following format:
image

@jsquire jsquire added v3 Version 3 of AutoRest C# generator. Client This issue points to a problem in the data-plane of the library. CodeGen Issues that relate to code generation labels May 8, 2024
@jsquire
Copy link
Member Author

jsquire commented May 8, 2024

//fyi: @m-nash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. CodeGen Issues that relate to code generation v3 Version 3 of AutoRest C# generator.
Projects
None yet
Development

No branches or pull requests

1 participant