Skip to content

chore: add building examples as part of CI#184

Merged
KeranYang merged 6 commits intomainfrom
example-ci
May 4, 2025
Merged

chore: add building examples as part of CI#184
KeranYang merged 6 commits intomainfrom
example-ci

Conversation

@KeranYang
Copy link
Copy Markdown
Member

@KeranYang KeranYang commented May 3, 2025

  1. A recent change update the Response Getter function from getSuccess() to isSuccess. An example was broken because of that.
/home/runner/work/numaflow-java/numaflow-java/examples/src/test/java/io/numaproj/numaflow/examples/sink/simple/SimpleSinkTest.java:[32,51] cannot find symbol
Error:    symbol:   method getSuccess()
Error:    location: variable response of type io.numaproj.numaflow.sinker.Response

Issue was detected late during the example image build push. This code change adds the building of examples to the CI so that if an SDK change breaks any examples, the issue can be caught during CI instead of after merging.

  1. This makes me realize the change of sinker success from Boolean to boolean is backward-incompatible to users, who use the getter in udsink. I scanned Intuit repo and saw we do have existing users using the getter. I am reverting the Boolean to boolean change for now to ensure backward compatiblitity.

Signed-off-by: Keran Yang <yangkr920208@gmail.com>
@codecov
Copy link
Copy Markdown

codecov bot commented May 3, 2025

Codecov Report

Attention: Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.

Please upload report for BASE (main@57e4214). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...main/java/io/numaproj/numaflow/sinker/Service.java 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #184   +/-   ##
=======================================
  Coverage        ?   58.76%           
  Complexity      ?      476           
=======================================
  Files           ?      151           
  Lines           ?     3390           
  Branches        ?      231           
=======================================
  Hits            ?     1992           
  Misses          ?     1231           
  Partials        ?      167           

☔ 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.

KeranYang added 2 commits May 3, 2025 13:37
.
Signed-off-by: Keran Yang <yangkr920208@gmail.com>
This reverts commit 01ee28e.
@KeranYang KeranYang changed the title (WIP) chore: add building examples as part of CI chore: add building examples as part of CI May 3, 2025
Signed-off-by: Keran Yang <yangkr920208@gmail.com>
@KeranYang KeranYang requested a review from yhl25 May 3, 2025 17:54
}
@Test
@Order(1)
public void testMapServerInvocation() {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This file is not changed. Just IntelliJ re-format.

public void testSimpleSink() {
int datumCount = 10;
SimpleSink simpleSink = new SimpleSink();
@Test
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This file is not changed. Just IntelliJ re-format.

@KeranYang KeranYang requested a review from vigith May 3, 2025 17:58
public class Response {
private final String id;
private final boolean success;
private final Boolean success;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Change it back because it's backward incompatible. If we ever decide to have a backward in-compatible release, we can make this change. Tracking it here.

@KeranYang KeranYang marked this pull request as ready for review May 3, 2025 18:46
@KeranYang
Copy link
Copy Markdown
Member Author

@yhl25 could you please review? Thanks!

distribution: 'temurin'
- name: Build with Maven, run unit tests and the coverage check
run: mvn clean install
- name: Build Examples
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we avoid building docker images? The executions inside the examples pom will build the docker images, which can take longer.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I added it because I want to make sure there is no issue building the images so that it's more unlikely that the push image action fails. The recent build took 39 seconds.

import io.numaproj.numaflow.sinker.ResponseList;
import io.numaproj.numaflow.sinker.SinkerTestKit;
import io.numaproj.numaflow.sourcetransformer.SourceTransformerTestKit;
import java.time.Instant;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why is it reformatting? Editor config is not used?

Copy link
Copy Markdown
Member Author

@KeranYang KeranYang May 4, 2025

Choose a reason for hiding this comment

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

Thank you @yhl25 ! I tested a bit on my local. It was reformatting because 1. my IDE wasn't configured to respect editor config, and 2. some of the files in the examples folder were not formatted following editor config.

I configured my IDE to respect and also copied the .editorconfig file to examples folder, just so if future developers create a project using examples folder as root, the editor config is still respected by their IDE.

KeranYang added 2 commits May 4, 2025 11:31
Signed-off-by: Keran Yang <yangkr920208@gmail.com>
.
Signed-off-by: Keran Yang <yangkr920208@gmail.com>
@KeranYang KeranYang requested a review from yhl25 May 4, 2025 15:43
@KeranYang KeranYang merged commit 2aeaaff into main May 4, 2025
5 checks passed
@KeranYang KeranYang deleted the example-ci branch May 4, 2025 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants