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: demo of fixes in fix_poms.py #1692

Closed
wants to merge 1 commit into from
Closed

Conversation

cloud-java-bot
Copy link
Collaborator

No description provided.

Copy link

Warning: This pull request is touching the following templated files:

  • renovate.json

@product-auto-label product-auto-label bot added size: s Pull request size is small. api: pubsublite Issues related to the googleapis/java-pubsublite API. labels Jul 26, 2024
diegomarquezp added a commit to googleapis/sdk-platform-java that referenced this pull request Aug 31, 2024
Fixes googleapis/google-cloud-java#10037 ☕ 

### Overview

This will modify the behavior of library generation at the
postprocessing stage. The main change is that generated _cloud_ poms
(i.e. `google-cloud-${service}/pom.xml`) will now have the dependencies
`proto-google-common-protos` and `grpc-google-iam-v1` declared as
`<scope>test</scope>` if the libraries belong to a monorepo.

### Integration test

It will be failing until we update the test branch. Once this approach
is validated, I will proceed with updating the branch.

### Approach
#### For new libraries
Via template in `owlbot/teplates/poms/cloud_pom.xml.j2`. New libraries
will have these two dependencies declared as test scope if they are part
of a monorepo.

#### For existing libraries
The script `fix_poms.py` will now modify the existing poms by setting
the two dependencies as test-scoped, only if they are part of a
monorepo.

### Confirmation that it works
* java-bigquerystorage: no effects since these dependencies are [not
found in the
pom](https://github.com/search?q=repo%3Agoogleapis%2Fjava-bigquerystorage%20path%3Agoogle-cloud-bigquerystorage%2Fpom.xml%20grpc-google&type=code)
* java-datastore: [no relevant
changes](https://github.com/googleapis/java-datastore/pull/1530/files)
since the dependencies are [not found in the
pom](https://github.com/googleapis/java-datastore/blob/main/google-cloud-datastore/pom.xml)
* java-firestore: [no relevant
changes](googleapis/java-firestore#1764) since
the one targeted dependency is [already declared as test
scoped](https://github.com/googleapis/java-firestore/blob/main/google-cloud-firestore/pom.xml#L160-L164)
* java-logging: [no relevant
changes](googleapis/java-logging#1660)] since
the dependencies are [not declared in the
pom](https://github.com/googleapis/java-logging/blob/main/google-cloud-logging/pom.xml)
* java-pubsub: no changes. Relevant dependency [already declared as test
scoped](https://github.com/googleapis/java-pubsub/blob/2b15b0a3f43c9ccef663fedf0398375f58fd9183/google-cloud-pubsub/pom.xml#L135-L139)
* java-pubsublite: [no relevant
changes](googleapis/java-pubsublite#1692) since
there are [no relevant dependencies declared in the
pom](https://github.com/googleapis/java-pubsublite/blob/main/google-cloud-pubsublite/pom.xml)
 * java-spanner: ignored - dependency kept as is
 * java-storage: ignored - kept as is
* **google-cloud-java: [91 poms
affected](https://github.com/googleapis/google-cloud-java/pull/11031/files)
by converting dependencies to test-scoped (PR only contains pom changes
for simplicity + outdated googleapis_committish)**
* We had a special situation with `java-dataproc` because it references
`google-iam-v1` via `grpc-google-iam-v1`. However this is incorrect
because what this library really needs is the proto classes. The fix for
this was to treat this library as any other library and add
`proto-google-iam-v1` as a dependency.
ldetmer pushed a commit to googleapis/sdk-platform-java that referenced this pull request Sep 17, 2024
Fixes googleapis/google-cloud-java#10037 ☕ 

### Overview

This will modify the behavior of library generation at the
postprocessing stage. The main change is that generated _cloud_ poms
(i.e. `google-cloud-${service}/pom.xml`) will now have the dependencies
`proto-google-common-protos` and `grpc-google-iam-v1` declared as
`<scope>test</scope>` if the libraries belong to a monorepo.

### Integration test

It will be failing until we update the test branch. Once this approach
is validated, I will proceed with updating the branch.

### Approach
#### For new libraries
Via template in `owlbot/teplates/poms/cloud_pom.xml.j2`. New libraries
will have these two dependencies declared as test scope if they are part
of a monorepo.

#### For existing libraries
The script `fix_poms.py` will now modify the existing poms by setting
the two dependencies as test-scoped, only if they are part of a
monorepo.

### Confirmation that it works
* java-bigquerystorage: no effects since these dependencies are [not
found in the
pom](https://github.com/search?q=repo%3Agoogleapis%2Fjava-bigquerystorage%20path%3Agoogle-cloud-bigquerystorage%2Fpom.xml%20grpc-google&type=code)
* java-datastore: [no relevant
changes](https://github.com/googleapis/java-datastore/pull/1530/files)
since the dependencies are [not found in the
pom](https://github.com/googleapis/java-datastore/blob/main/google-cloud-datastore/pom.xml)
* java-firestore: [no relevant
changes](googleapis/java-firestore#1764) since
the one targeted dependency is [already declared as test
scoped](https://github.com/googleapis/java-firestore/blob/main/google-cloud-firestore/pom.xml#L160-L164)
* java-logging: [no relevant
changes](googleapis/java-logging#1660)] since
the dependencies are [not declared in the
pom](https://github.com/googleapis/java-logging/blob/main/google-cloud-logging/pom.xml)
* java-pubsub: no changes. Relevant dependency [already declared as test
scoped](https://github.com/googleapis/java-pubsub/blob/2b15b0a3f43c9ccef663fedf0398375f58fd9183/google-cloud-pubsub/pom.xml#L135-L139)
* java-pubsublite: [no relevant
changes](googleapis/java-pubsublite#1692) since
there are [no relevant dependencies declared in the
pom](https://github.com/googleapis/java-pubsublite/blob/main/google-cloud-pubsublite/pom.xml)
 * java-spanner: ignored - dependency kept as is
 * java-storage: ignored - kept as is
* **google-cloud-java: [91 poms
affected](https://github.com/googleapis/google-cloud-java/pull/11031/files)
by converting dependencies to test-scoped (PR only contains pom changes
for simplicity + outdated googleapis_committish)**
* We had a special situation with `java-dataproc` because it references
`google-iam-v1` via `grpc-google-iam-v1`. However this is incorrect
because what this library really needs is the proto classes. The fix for
this was to treat this library as any other library and add
`proto-google-iam-v1` as a dependency.
@bcol-google
Copy link
Contributor

Appears to be a formatting-only fixup. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsublite Issues related to the googleapis/java-pubsublite API. size: s Pull request size is small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants