-
Notifications
You must be signed in to change notification settings - Fork 6
Kick lang formatting using composable workflow #85
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
Note Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported. |
Adds a formatting step to the Java code generation workflow. This runs 'mvn spotless:apply' after code generation to ensure that generated code is formatted correctly before a pull request is created. This prevents creating pull requests that only contain formatting changes, which can happen when the code generation output doesn't perfectly match the project's style guidelines.
This reverts commit bb97322.
Refactors the code generation workflow to use a composite action for formatting. This new approach modularizes the formatting step by allowing each library to define its own formatting action. The main workflow calls this action, checks for diffs, and then creates a pull request. This change is initially applied to the Java `generate-per-service` job. The workflow now dynamically checks for the existence of the format action, making the pattern extensible to other languages in the future.
Updates the `generate-per-service` job to facilitate testing the new composite formatting action for Java. The changes include: - Pointing to a specific feature branch in the Java library repository to get the new formatter. - Reducing the service matrix to a single service (`checkout`) to speed up test runs. - Prefixing the PR branch and title with a test identifier to avoid conflicts.
The GitHub Actions workflow was failing with an "Unrecognized named-value: 'matrix'" error. This was caused by `if` conditions and other expressions referencing values that were not part of the matrix definition for a specific job. This commit corrects the conditions to be specific to each job's matrix, resolving the validation error.
Implements a "move and use" strategy to dynamically run language-specific formatting actions from within a matrix job. This works around a GitHub Actions limitation that prevents using matrix variables in the path of a local 'uses:' clause. The new approach moves the composite action from the checked-out SDK repository to a temporary static path, allowing it to be called correctly.
448c970 to
9062493
Compare
gcatanese
approved these changes
Jan 12, 2026
Contributor
gcatanese
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, I left one minor question
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Running formatting after generation makes calculating diff impossible. This is the current flow:
Because (3) happens after (2), the next time generation runs it will compare
formattedwithraw, meaning there will always be a deltaThis PR fixes this by making sure formatting happens before the diff is calculated.
It's done by invoking a composable action on each lang's repos. I've already moved the format action in
javato this setup and will proceed with the same for the other languages.Tested scenarios