Skip to content

build and run testDocker on PRs #8846

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
merged 15 commits into from
Jul 10, 2025

Conversation

macfarla
Copy link
Contributor

@macfarla macfarla commented Jun 24, 2025

PR description

Previously testDocker task was only run on merge to main. This PR modifies the workflows so that those checks run at PR stage

  • extra workflow file develop-pr.yml was added to run the relevant checks (build, testDocker but not publish) on PR
  • fixes to build.gradle to ensure testDocker can work without docker env which was also supplying docker org and artifact name (in addition to docker creds which are not needed since we're not publishing)

This PR starts with a commit to reproduce the issue with errorprone check not being picked up until buildDocker (merge to main), and then modifies the workflows so that those checks run at PR stage.

* change was made to BlobType (remove final keyword) to trigger the original issue

For some reason the errorprone check only fails on besu-arm runner not the ubuntu-arm one or ubuntu-22-04

eg on this run you can see the errorprone check fails the build for 1 of 2 runners https://github.com/hyperledger/besu/actions/runs/15864950425?pr=8846

and once the final keyword is fixed, both runners succeed

Errorprone root cause #8730 was fixed separately

Fixed Issue(s)

inspired by #8730

Thanks for sending a pull request! Have you done the following?

  • Checked out our contribution guidelines?
  • Considered documentation and added the doc-change-required label to this PR if updates are required.
  • Considered the changelog and included an update if required.
  • For database changes (e.g. KeyValueSegmentIdentifier) considered compatibility and performed forwards and backwards compatibility tests

Locally, you can run these tests to catch failures early:

  • spotless: ./gradlew spotlessApply
  • unit tests: ./gradlew build
  • acceptance tests: ./gradlew acceptanceTest
  • integration tests: ./gradlew integrationTest
  • reference tests: ./gradlew ethereum:referenceTests:referenceTests

macfarla added 12 commits June 24, 2025 15:21
Signed-off-by: Sally MacFarlane <[email protected]>
Signed-off-by: Sally MacFarlane <[email protected]>
Signed-off-by: Sally MacFarlane <[email protected]>
Signed-off-by: Sally MacFarlane <[email protected]>
Signed-off-by: Sally MacFarlane <[email protected]>
Signed-off-by: Sally MacFarlane <[email protected]>
Signed-off-by: Sally MacFarlane <[email protected]>
Signed-off-by: Sally MacFarlane <[email protected]>
Signed-off-by: Sally MacFarlane <[email protected]>
@macfarla macfarla changed the title [DO NOT MERGE] revert final keyword to check errorprone behavior run testDocker on PRs Jun 25, 2025
@macfarla macfarla changed the title run testDocker on PRs build and run testDocker on PRs Jun 25, 2025
@macfarla macfarla marked this pull request as ready for review June 25, 2025 01:40
@macfarla
Copy link
Contributor Author

so the error prone PR besu-eth/besu-errorprone-checks#13 fixes the root cause that was flagged initially here - so this besu PR would be just if we want to run build & test docker on PRs rather than just on merge to main. I would argue it's worth it if it doesn't slow down the PR build time. It takes 5 min and it's run in parallel. Maybe we would get enough signal from running on 1 of 2 runners

@macfarla macfarla requested review from joshuafernandes and jflo July 3, 2025 01:40
def dockerBuildVersion = project.hasProperty('release.releaseVersion') ? project.property('release.releaseVersion') : "${rootProject.version}"
def dockerOrgName = project.hasProperty('dockerOrgName') ? project.getProperty("dockerOrgName") : "hyperledger"
def dockerArtifactName = project.hasProperty("dockerArtifactName") ? project.getProperty("dockerArtifactName") : "besu"
def dockerBuildVersion = project.hasProperty('release.releaseVersion') && project.property('release.releaseVersion') ? project.property('release.releaseVersion') : "${rootProject.version}"
Copy link
Member

Choose a reason for hiding this comment

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

What does this line achieve? project.hasProperty('release.releaseVersion') && project.property('release.releaseVersion')? @macfarla

Copy link
Contributor Author

Choose a reason for hiding this comment

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

project.hasProperty is does it exist
project.property will give true if it's not null

kind of like getting a value from a java Optional

Copy link
Contributor Author

Choose a reason for hiding this comment

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

basically this set of changes was to make sure docker org name and artifact name never get set to empty

@@ -0,0 +1,81 @@
name: docker develop build and test only

on:
Copy link
Member

Choose a reason for hiding this comment

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

You can further enhance this by adding:

on:
  pull_request:
    branches:
      - main

this will allow this workflow to only trigger for PR requests against main branch.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

# Set the build target name as an environment variable
echo "BUILD_TARGET_NAME=${BUILD_TARGET_NAME}" >> $GITHUB_ENV

- name: Checkout Repo
Copy link
Member

Choose a reason for hiding this comment

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

@macfarla Checkout Repo must (usually) be the first job i.e. should appear before Prepare.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think in this case prepare has to be first because it sets up the platform and some environment variables.

Copy link
Member

@usmansaleem usmansaleem left a comment

Choose a reason for hiding this comment

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

LGTM - few comments that can be incorporated.

@macfarla macfarla enabled auto-merge (squash) July 10, 2025 22:41
@macfarla macfarla merged commit 5a5d72f into hyperledger:main Jul 10, 2025
51 checks passed
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