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

[chore] [mdatagen] Mdatagen hack metadata #21464

Closed

Conversation

BominRahmani
Copy link
Contributor

@BominRahmani BominRahmani commented May 3, 2023

Description: Changed what mdatagen outputs into the generated_status_go file for receivers. If the receiver has the suffix "receiver", it will get rid of that. This will allow us to also get rid of the "typeStr" variable for most of the receivers and standardize it into metadata.Type. The same way we have been doing for stability -> metadata.Stability

Within this change is also the make generate update for generated_status_go files for the receivers that have had that bit added in.

@BominRahmani
Copy link
Contributor Author

@dmitryax This was intended to be a solution, but if someone else had another way of doing it thats cleaner or adds more functionality in the long run, then this could be a temporary. I just wanted to try to get this in so when I go through and and do #21213, I can also handle the changing of the typeStr on the receivers.

@@ -7,6 +7,6 @@ import (
)

const (
Type = "activedirectorydsreceiver"
Type = "activedirectoryds"
Copy link
Contributor

@atoulme atoulme May 3, 2023

Choose a reason for hiding this comment

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

The type registered in factory.go is active_directory_ds. Unfortunately, this change is not enough to accommodate.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, you are right. This one is a bit strange with the underscores. Do you have any solutions to this in mind, I can take a look into implementing a fix if you have an idea.

Copy link
Contributor

Choose a reason for hiding this comment

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

No, for now, I lean towards taking your fix, and we will need to iterate one more time for this component and a few others.

Copy link
Member

Choose a reason for hiding this comment

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

Another solution: align type in metadata.yaml with what we need, like active_directory_ds in this case. And use the directory name for Scope.Name. This solution will work even with #21469

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dmitryax Just so I understand correctly, you are talking about going into active_directory_ds's metadata.yaml then changing the Type from active_directory_ds into something like activedirectoryds?

Copy link
Member

@dmitryax dmitryax May 4, 2023

Choose a reason for hiding this comment

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

No, we should keep the type as is. Otherwise, it'll be a significant breaking change. I mean, we set active_directory_ds in metadata.yaml to have it rendered here. But the #21382 can be solved by setting the directory in the Scope.Name field instead of this type

Copy link
Member

@dmitryax dmitryax May 5, 2023

Choose a reason for hiding this comment

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

Updated link in my latest comment ^

@atoulme
Copy link
Contributor

atoulme commented May 3, 2023

Please rebase off main to pick up the fix when checking licenses.

@BominRahmani BominRahmani force-pushed the mdatagen-hack-metadata branch from 39a9c31 to 8dfcc7a Compare May 4, 2023 14:15
@BominRahmani BominRahmani marked this pull request as ready for review May 4, 2023 17:30
@BominRahmani BominRahmani requested a review from a team May 4, 2023 17:30
@dmitryax
Copy link
Member

dmitryax commented May 5, 2023

Why do we need to merge this PR if the generated type cannot be used yet?

@atoulme
Copy link
Contributor

atoulme commented May 5, 2023

I think I can make it work for this PR: #21275

@dmitryax
Copy link
Member

dmitryax commented May 5, 2023

@atoulme
Copy link
Contributor

atoulme commented May 5, 2023

True, I can make it work either way, I could drop that code though if this one comes in.

@BominRahmani
Copy link
Contributor Author

So what is the consensus on this? Do you guys want me to start looking at @dmitryax solution for this and drop this PR? I'd really like to get this or the other solution in ASAP so I can start knocking out the #21213.

@dmitryax
Copy link
Member

dmitryax commented May 5, 2023

I don't see how this PR can resolve #21382 and unblock #21213

@dmitryax
Copy link
Member

dmitryax commented May 5, 2023

I submitted #21501. Once it's merged, you can set the actual component type in the metadata.yaml

@djaglowski
Copy link
Member

Superseded by #21382

@djaglowski djaglowski closed this May 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants