Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Change Nephio builds to remove generated code form the repositories #851

Open
liamfallon opened this issue Feb 11, 2025 · 1 comment
Open

Comments

@liamfallon
Copy link
Member

In both the "nephio" and "porch" repositories, generated code is checked into the repositories.

As a rule, generated files should not ever be checked into a repository and is bad practice. They should be generated as part of the build as a precompile step in the build and placed in a temporary location were the compile step of the build can access them. This:

  • reduces the risk of misalignment happening here the metadata used to generate the generated files gets out of sync with the compiled code
  • reduces the risk of tooling used to generate code changing and causing different versions of generated code to be rendered for the same metadata
  • reduces the volume of code that needs to be maintained
  • avoids the risk of developers accidentally (or worse pragmatically) modifying the generated code
  • reduces the size of PRs
@efiacor
Copy link
Collaborator

efiacor commented Feb 11, 2025

I'm not 100% sure but I think the operator sdk is a special case.
As part of the project generation it creates:

  • The api/v1alpha definitons
  • The related CRDs
  • Lots of stuff under the config dir

Some of the above is used internally as part of the testing setup and run. To build these each time would not be ideal in my opinion.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants