Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Generate protos #4

Merged
merged 11 commits into from
Oct 11, 2022
Merged

Generate protos #4

merged 11 commits into from
Oct 11, 2022

Conversation

jlegoff
Copy link
Contributor

@jlegoff jlegoff commented Sep 26, 2022

This is a first attempt at setting up the build files and generating the protos.

Since the generated protos are part of the repo, the generation itself is not part of the build pipeline and is set up as an standalone project in the generateProtos directory. Regenerating them can be done manually as explained in the README.

While the issue mentions a makefile for proto generation, I took inspiration from opentelemetry-proto-java and used a gradle script instead. I can change that if needed.

Note also that the generated code is not published as a library. I suggest doing this in a separate PR.

Resolves #1

[submodule "opamp-spec"]
path = opamp-spec
url = [email protected]:open-telemetry/opamp-spec.git
branch = v0.6.0
Copy link
Member

Choose a reason for hiding this comment

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

Not familiar with .gitmodules files, but the info in here points to the wrong repository. We don't have these files in opentelemetry-java or opentelemetry-java-instrumentation. Care to summarize their purpose?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the opamp-spec repo is used to get the proto definitions, as suggested in the issue. Here I set up a submodule and pinned it to the latest release.


pluginManagement {
plugins {
id("com.google.protobuf") version "0.8.17"
Copy link
Member

Choose a reason for hiding this comment

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

Current latest version of this plugin is 0.8.19.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated, thanks

sourceSets {
main {
proto {
srcDir("../opamp-spec/proto")
Copy link
Member

Choose a reason for hiding this comment

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

What's the advantage of doing the submodule thing referencing the opamp-spec repo versus defining a task to download the protos from the opamp-spec into the build dir?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is a good question. This is what is suggested in the repo, but I can change it do behave like opentelemetry-java-protos. Perhaps @tigrannajaryan has an opinion here.

Choose a reason for hiding this comment

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

I like git submodule, unless there are any other advantages w.r.t. task to download the protos.

Copy link
Member

Choose a reason for hiding this comment

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

this is a good question. This is what is suggested in the repo, but I can change it do behave like opentelemetry-java-protos. Perhaps @tigrannajaryan has an opinion here.

@jlegoff I used the submodule in opamp-go since it was the simplest way I knew to bring it as a dependency pinned to a specific commit. If using a gradle download task has any advantages feel free to do that instead. What do you gain by doing that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Honestly, I don't know what we gain by using a download tasks instead of a submodule. Seems like a matter of taste. @jack-berg do you have a strong opinion against using submodules?

Copy link
Member

Choose a reason for hiding this comment

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

Nope, no strong opinion. Agree it feels like a matter of taste.

repositories {
mavenCentral()
mavenLocal()
}
Copy link
Member

Choose a reason for hiding this comment

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

These should come from otel.java-conventions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks, I removed this section

@tigrannajaryan
Copy link
Member

Hey folks, great to see progress on this but I want to make sure we set the expectations right. Unless we find the second long-term maintainer we will not be able to move forward with this repo. It is not healthy to have a repo with only one long-term maintainer.

@jack-berg since you are reviewing this are you interested in being the second maintainer?

sourceSets {
main {
proto {
srcDir("../opamp-spec/proto")

Choose a reason for hiding this comment

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

I like git submodule, unless there are any other advantages w.r.t. task to download the protos.

@jack-berg
Copy link
Member

Hey @tigrannajaryan - I'm happy to act in an approver capacity for this repository, but not able to commit to be a maintainer.

If we need a second maintainer (which I think is a very reasonable requirement), someone else will have to volunteer.

@tigrannajaryan
Copy link
Member

Thanks @jack-berg, your reviews/approvals are appreciated.

We now also have @AvadheshKaria who I believe will work on becoming the long term maintainer of this repo.

@tigrannajaryan
Copy link
Member

@jlegoff we now have approvals. I can merge this if you don't plan any other changes to this PR.

@jlegoff
Copy link
Contributor Author

jlegoff commented Oct 11, 2022

@tigrannajaryan great, let's merge it and I'll work on the next issue later this week

@tigrannajaryan tigrannajaryan merged commit f38c498 into open-telemetry:main Oct 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consume opamp-spec as a submodule and use protos from it
4 participants