Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

Validate all example and sample applications#1059

Merged
andreaTP merged 13 commits into
mainfrom
mp/check-examples-using-java-8-and-11
Jul 30, 2021
Merged

Validate all example and sample applications#1059
andreaTP merged 13 commits into
mainfrom
mp/check-examples-using-java-8-and-11

Conversation

@marcospereira

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Some of them were not compiled or tested. The script now discovers all apps and tests them.

Why are the changes needed?

To make sure all apps are in good shape, compiling, and building as expected.

Does this PR introduce any user-facing change?

No API changes at all.

How was this patch tested?

Running ./scripts/build-all.sh test so far.

@marcospereira marcospereira marked this pull request as draft May 27, 2021 18:17

@marcospereira marcospereira left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This was sitting on my machine since yesterday's night. There are some other minor changes to make all the samples run in the CI. I will push them when I have the time, but feel free to take over if you want.

Comment thread scripts/build-all.sh
Comment thread scripts/build-all.sh Outdated
@marcospereira marcospereira force-pushed the mp/check-examples-using-java-8-and-11 branch 4 times, most recently from 43276ca to 98c7c79 Compare June 1, 2021 16:30
@marcospereira marcospereira force-pushed the mp/check-examples-using-java-8-and-11 branch from 98c7c79 to 00b59a6 Compare July 23, 2021 14:12
@marcospereira marcospereira force-pushed the mp/check-examples-using-java-8-and-11 branch 6 times, most recently from 58a1005 to 6f8de0c Compare July 23, 2021 20:02
@marcospereira marcospereira force-pushed the mp/check-examples-using-java-8-and-11 branch from 6f8de0c to 94464de Compare July 23, 2021 20:40
@marcospereira marcospereira force-pushed the mp/check-examples-using-java-8-and-11 branch from 94464de to 96b20f2 Compare July 23, 2021 20:56
@marcospereira marcospereira marked this pull request as ready for review July 26, 2021 19:56
Comment thread .github/workflows/build-pr.yaml
Comment thread .github/workflows/build-pr.yaml
Comment thread .github/workflows/build-pr.yaml
./build-all.sh +test
run: ./scripts/build-core.sh +test

build-and-test-sbt-examples:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Split into different jobs so that they can run independently.

Comment thread .github/workflows/push.yml Outdated
Comment thread core/build.sbt Outdated
.getOrElse("0.0.0-SNAPSHOT")}"""")
}

lazy val writeVersionToFile = taskKey[Unit]("Write project version to file")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This helps to have a consistent version that will be used when running the tests for all the samples. The file will later be read by the build shell scripts.

The goal here is to avoid tasks that change files to break dynver (used as a fallback by the samples) since it generates another version if the git repository is dirty.

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.

Please remove this customization.

The goal here is to avoid tasks that change files to break dynver

That's the reason why we should keep it as it was, the tasks should not change files to while running, otherwise, we want the CI to fail.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It will fail anyway, but instead of failing with unresolved artifacts for the next sample, it would fail for the right reason if that is the case.

This is also relevant when running the Maven examples where we need the CLOUDFLOW_VERSION env since we don't have dynver there. Or is there an option for Maven samples?

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.

for Maven something like:

export CLOUDFLOW_VERSION=$(sbt -no-colors --error 'print version')

should make it work.

It will fail anyway

If the git repo is not dirty the version is always the same.
But maybe I'm misunderstanding, can you elaborate? or maybe is faster to go through in a sync meeting?

@marcospereira marcospereira left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@RayRoestenburg, this grew a lot beyond my initial intention. Most of the changes are due to code format, though. Some other changes are small compilation issues in the samples code, which is the original idea behind this PR.

I'm leaving some comments on points you may want to be interested.

@RayRoestenburg

Copy link
Copy Markdown
Contributor

Sure, let's look at these as possible improvements and pick it up in a support cycle. @andreaTP might also be interested in these changes

@RayRoestenburg RayRoestenburg requested a review from andreaTP July 27, 2021 13:30

@andreaTP andreaTP left a comment

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.

I will review this better tomorrow, overall I really like the separation of the bash scripts, thanks @marcospereira !

The current issue with this PR is how it plays with dynver we should be able to avoid fixing the version.

Comment thread .github/workflows/build-pr.yaml Outdated
Comment thread .github/workflows/build-pr.yaml
Comment thread .github/workflows/build-test-tools.yml Outdated
steps:
- name: Checkout
uses: actions/checkout@v2.3.3
- uses: actions/checkout@v2

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.

Have you tested this workflow in isolation to verify this change?
I'm pretty sure we experienced a few regressions on the versioning here ...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I have not. How can I do that?

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.

you can hack the workflow in a branch to be triggered on push and verify that the output (e.g. the version) is correct and cosistent

Comment thread .github/workflows/push.yml
.enablePlugins(CloudflowApplicationPlugin)
.settings(
cloudflowAkkaBaseImage := "myRepositoryUrl/myRepositoryPath:2.0.10-cloudflow-akka-2.6.6-scala-2.12",
cloudflowDockerBaseImage := "myRepositoryUrl/myRepositoryPath:2.0.10-cloudflow-akka-2.6.6-scala-2.12",

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.

I'm not sure what is going on here ...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Avoid using the deprecated setting in the example.

Comment thread scripts/functions.sh
Comment thread scripts/build-mvn-examples.sh
Comment thread scripts/build-sbt-examples.sh Outdated
@marcospereira marcospereira force-pushed the mp/check-examples-using-java-8-and-11 branch from 6e6e97d to 25b5841 Compare July 30, 2021 04:13

@andreaTP andreaTP left a comment

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.

Added one commit to test examples only on Java 8.

Thanks for the hard work @marcospereira ! LGTM!

@andreaTP andreaTP merged commit 13c0cd6 into main Jul 30, 2021
@andreaTP andreaTP deleted the mp/check-examples-using-java-8-and-11 branch July 30, 2021 10:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants