Skip to content

Fix serial warning in starter and example archetypes#38028

Closed
Subramanya-Veeregowda wants to merge 2 commits into
apache:masterfrom
Subramanya-Veeregowda:fix-serial-warning-archtypes
Closed

Fix serial warning in starter and example archetypes#38028
Subramanya-Veeregowda wants to merge 2 commits into
apache:masterfrom
Subramanya-Veeregowda:fix-serial-warning-archtypes

Conversation

@Subramanya-Veeregowda
Copy link
Copy Markdown
Contributor

@Subramanya-Veeregowda Subramanya-Veeregowda commented Apr 1, 2026

Adds @SuppressWarning("serial") to anonymous classes in starter and example archetypes to avoid serialization warnings in IDEs.

this aligns with excepted usage where DoFn and other functions are serialized.

Closes #18120


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.

@github-actions github-actions Bot added the java label Apr 1, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses build-time warnings related to serialization in anonymous classes within the project's starter archetypes. By explicitly suppressing these warnings, the codebase maintains cleaner logs and better IDE integration for developers using these templates.

Highlights

  • Code Cleanup: Added @SuppressWarnings("serial") annotations to anonymous classes within the starter archetype to resolve IDE serialization warnings.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@Subramanya-Veeregowda
Copy link
Copy Markdown
Contributor Author

This PR adds @SuppressWarnings("serial") to anonymous classes in both starter and example archetypes to avoid IDE warnings.

Tested locally for starter module. Example archetype build requires shell environment (generate-sources.sh), so relying on CI for validation.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 1, 2026

Assigning reviewers:

R: @kennknowles for label java.

Note: If you would like to opt out of this review, comment assign to next reviewer.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

@Subramanya-Veeregowda
Copy link
Copy Markdown
Contributor Author

@stankiewicz should remove it and re-commit it again or is it fine with this?

@stankiewicz
Copy link
Copy Markdown
Contributor

@stankiewicz should remove it and re-commit it again or is it fine with this?

yes please.

@Subramanya-Veeregowda
Copy link
Copy Markdown
Contributor Author

@stankiewicz Please give review on this?

@stankiewicz
Copy link
Copy Markdown
Contributor

@stankiewicz Please give review on this?

there are conflicts -please rebase and resolve conflicts

@Subramanya-Veeregowda Subramanya-Veeregowda force-pushed the fix-serial-warning-archtypes branch from b90cfb5 to 5b2b417 Compare April 25, 2026 17:18
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 57.63%. Comparing base (1cb2a71) to head (5b2b417).
⚠️ Report is 28 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master   #38028      +/-   ##
============================================
+ Coverage     54.61%   57.63%   +3.01%     
- Complexity     1689    13344   +11655     
============================================
  Files          1067     2604    +1537     
  Lines        168155   266683   +98528     
  Branches       1226    10994    +9768     
============================================
+ Hits          91844   153712   +61868     
- Misses        74116   107183   +33067     
- Partials       2195     5788    +3593     
Flag Coverage Δ
java 63.18% <ø> (-4.17%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Subramanya-Veeregowda
Copy link
Copy Markdown
Contributor Author

@stankiewicz Can u go through, this i have resolved the conflict?

@stankiewicz
Copy link
Copy Markdown
Contributor

so what is this change about after all?

@stankiewicz
Copy link
Copy Markdown
Contributor

waiting on author

@Subramanya-Veeregowda
Copy link
Copy Markdown
Contributor Author

@stankiewicz This change addresses the issue where starter and example archetypes show
serialization warnings in IDEs due to anonymous classes.

I added @SuppressWarnings("serial") to those classes so that the examples
align with expected Beam usage (where DoFn and similar constructs are serialized),
and users are not presented with unnecessary warnings when using the starter templates.

Please let me know if you'd like me to refine this further.

Fixes #18120

@stankiewicz
Copy link
Copy Markdown
Contributor

please read your comment and your code changes.

@damccorm
Copy link
Copy Markdown
Contributor

Closing since currently the code changes don't match the description (and they don't seem to add value)

@damccorm damccorm closed this May 20, 2026
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.

SuppressWarnings("serial") for starter and example archetypes

3 participants