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

Fix generated comments to reflect azure-service-operator #1570

Merged
merged 9 commits into from
Jun 17, 2021

Conversation

theunrepentantgeek
Copy link
Member

What this PR does / why we need it:

Our generated code had comments indicating the source was k8s-infra and k8s-infra-gen - we change these to read azure-service-operator while retaining the ability to detect and clean up generated code from older versions.

How does this PR make you feel:
gif


// Required for backward compatibility.
// Presence of any one string will result in the file being treated as a generated file that we are responsible for
CodeGenerationCommentsDeprecated []string = []string{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the plan to delete this later?

Feels like we should maybe just delete this now and tell the 3 or 4 of us to manually clean up the directory once when we pull? Cleaner than having legacy here before we're even released?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, didn't take a lot to persuade me. 😁

@@ -8,7 +8,14 @@ package astmodel
var (
CodeGenerationComments []string = []string{
// Note that this format is actually an official specification in go: https://github.com/golang/go/issues/13560
"// Code generated by k8s-infra. DO NOT EDIT.", // TODO: Update this when the generated is moved/renamed
"// Code generated by azure-service-operator. DO NOT EDIT.", // TODO: Update this when the generated is moved/renamed
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe remove the TODO? Although I guess we still want to update it if it's moved again.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree - remove TODO. I think the TODO was in reference to what @theunrepentantgeek just did (i.e. that it shouldn't say k8sinfra)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nah, that TODO has been there for ages. I'll remove it though.

@@ -8,7 +8,14 @@ package astmodel
var (
CodeGenerationComments []string = []string{
// Note that this format is actually an official specification in go: https://github.com/golang/go/issues/13560
"// Code generated by k8s-infra. DO NOT EDIT.", // TODO: Update this when the generated is moved/renamed
"// Code generated by azure-service-operator. DO NOT EDIT.", // TODO: Update this when the generated is moved/renamed
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO we should differentiate between ASO and the tool that generates aso.

Maybe this is ASO-gen or something?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to azure-service-operator-codegen.

@theunrepentantgeek theunrepentantgeek merged commit 2b2437f into master Jun 17, 2021
@theunrepentantgeek theunrepentantgeek deleted the fix/generated-code-cleanup branch June 17, 2021 03:07
@codecov-commenter
Copy link

Codecov Report

Merging #1570 (e69deb8) into master (cac6e83) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1570   +/-   ##
=======================================
  Coverage   63.43%   63.43%           
=======================================
  Files         181      181           
  Lines       11796    11796           
=======================================
  Hits         7483     7483           
  Misses       3644     3644           
  Partials      669      669           
Impacted Files Coverage Δ
hack/generator/pkg/astmodel/package_definition.go 25.88% <ø> (ø)
...ator/pkg/codegen/pipeline_delete_generated_code.go 4.54% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cac6e83...e69deb8. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants