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

feat: generate pr description from configuration comparison result #2841

Merged
merged 18 commits into from
Jun 10, 2024

Conversation

JoeWang1127
Copy link
Collaborator

@JoeWang1127 JoeWang1127 commented May 31, 2024

In this PR:

  • Generate pull request description from configuration comparison result.
  • The pull request description contains repo-level changes, if applicable, and googleapis commit from baseline config (exclusive) to current config (inclusive).

An example of pr description with repo-level change:

This pull request is generated with proto changes between [googleapis/googleapis@3b6f144](https://github.com/googleapis/googleapis/commit/3b6f144d47b0a1d2115ab2445ec06e80cc324a44) (exclusive) and [googleapis/googleapis@0cea717](https://github.com/googleapis/googleapis/commit/0cea7170404bec3d994f43db4fa292f5034cbe9a) (inclusive).

BEGIN_COMMIT_OVERRIDE
BEGIN_NESTED_COMMIT
fix(deps): update the Java code generator (gapic-generator-java) to 1.2.3
END_NESTED_COMMIT
BEGIN_NESTED_COMMIT
chore: update the libraries_bom version to 2.3.4
END_NESTED_COMMIT
BEGIN_NESTED_COMMIT
feat: Make Layout Parser generally available in V1

PiperOrigin-RevId: 638924855

Source Link: [googleapis/googleapis@0cea717](https://github.com/googleapis/googleapis/commit/0cea7170404bec3d994f43db4fa292f5034cbe9a)
END_NESTED_COMMIT
END_COMMIT_OVERRIDE

@product-auto-label product-auto-label bot added the size: l Pull request size is large. label May 31, 2024
@JoeWang1127 JoeWang1127 marked this pull request as ready for review June 9, 2024 19:44
@JoeWang1127 JoeWang1127 requested a review from a team as a code owner June 9, 2024 19:44
Copy link
Contributor

@diegomarquezp diegomarquezp left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. Just a few nits + 1 comment.

@@ -0,0 +1,18 @@
BEGIN_COMMIT_OVERRIDE
BEGIN_NESTED_COMMIT
Update repo-level parameter gapic_generator_version to 1.2.3
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we change this to something like fix(deps): Update the Java code generator (gapic-generator-java) to 2.39.0 to keep it consistent with the existing Owlbot behavior? See googleapis/java-bigtable#2191

Copy link
Collaborator Author

@JoeWang1127 JoeWang1127 Jun 10, 2024

Choose a reason for hiding this comment

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

We need a mapping to do this, from parameter name to description.

What's the benefits of doing this? I think we don't have to generate the same message as long as the meaning of this message is clear.

Copy link
Collaborator

Choose a reason for hiding this comment

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

What's the benefits of doing this? I think we don't have to generate the same message as long as the meaning of this message is clear.

I agree. But I think the previous message makes more sense for handwritten library owners. Because

  1. It includes a conventional commit prefix.
  2. They don't need to know something like repo-level parameter, it is an implementation detail of hermetic build scripts. On high level, they just need to know the generator version is updated and the GAPIC layer is regenerated.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure, this does make sense.

I need to create a mapping from parameter to commit message and I'll only add generator version and libraries_bom version for now. Other parameter will fallback to default message.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

Update repo-level parameter libraries_bom_version to 2.3.4
END_NESTED_COMMIT
BEGIN_NESTED_COMMIT
Update repo-level parameter protoc_version to 3.4.5
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should remove protoc_version from our test proto now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is just for testing a optional parameter change can appear in the message.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, but using protoc_version might also confuse other people. Can you use googleapis_commitish instead? Or use something random to indicate that the current logic can be used for any repo level changes?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Can you use googleapis_commitish instead?

googleapis commit will not appear here because the commits are formatted to separate messages.

I'll remove this message.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

@JoeWang1127 JoeWang1127 requested a review from blakeli0 June 10, 2024 17:38
@JoeWang1127 JoeWang1127 changed the title feat: combine repo-level change in pr description feat: generate pr description from configuration comparison result Jun 10, 2024
Copy link

Quality Gate Passed Quality Gate passed for 'gapic-generator-java-root'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link

Quality Gate Passed Quality Gate passed for 'java_showcase_integration_tests'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@JoeWang1127
Copy link
Collaborator Author

Downstream check failed in java-spanner-jdbc, but I don't think this related to this PR.

Setup maven mirror
Installing this repo's modules to local maven.
Install complete. java-shared-dependencies = 3.31.1-SNAPSHOT
~/work/sdk-platform-java/sdk-platform-java/java-shared-dependencies/target ~/work/sdk-platform-java/sdk-platform-java
Cloning into 'java-spanner-jdbc'...
warning: Could not find remote branch v2.1[9](https://github.com/googleapis/sdk-platform-java/actions/runs/9453493033/job/26039662521?pr=2841#step:7:10).2 to clone.
fatal: Remote branch v2.19.2 not found in upstream origin

@JoeWang1127 JoeWang1127 merged commit e508ae6 into main Jun 10, 2024
47 of 48 checks passed
@JoeWang1127 JoeWang1127 deleted the feat/combine-config-change branch June 10, 2024 20:46
lqiu96 pushed a commit that referenced this pull request Jun 10, 2024
…2841)

In this PR:
- Generate pull request description from configuration comparison
result.
- The pull request description contains repo-level changes, if
applicable, and googleapis commit from baseline config (exclusive) to
current config (inclusive).

An example of pr description with repo-level change:
```
This pull request is generated with proto changes between [googleapis/googleapis@3b6f144](googleapis/googleapis@3b6f144) (exclusive) and [googleapis/googleapis@0cea717](googleapis/googleapis@0cea717) (inclusive).

BEGIN_COMMIT_OVERRIDE
BEGIN_NESTED_COMMIT
fix(deps): update the Java code generator (gapic-generator-java) to 1.2.3
END_NESTED_COMMIT
BEGIN_NESTED_COMMIT
chore: update the libraries_bom version to 2.3.4
END_NESTED_COMMIT
BEGIN_NESTED_COMMIT
feat: Make Layout Parser generally available in V1

PiperOrigin-RevId: 638924855

Source Link: [googleapis/googleapis@0cea717](googleapis/googleapis@0cea717)
END_NESTED_COMMIT
END_COMMIT_OVERRIDE
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: l Pull request size is large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants