Skip to content
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

Updates to github workflows for PDO #504

Merged
merged 2 commits into from
Oct 30, 2024

Conversation

cmickeyb
Copy link
Contributor

@cmickeyb cmickeyb commented Oct 25, 2024

EXPERIMENTAL -- new github workflows will only be visible and runnable when they are attached to the main branch. this commit will enable further testing.

Expand the github workflows associated with the PDO repository. The old "ci" workflow has been moved to a workflow called "full_test" and is used as a condition for merge of PRs. It will no longer be run on every push but only on PR creation and synchronization (when updates are pushed).

Add a "configured_test" workflow that can be dispatched on demand. This workflow allows for different build and run parameters to be set interactively.

Add a "build_docker" workflow that will attempt to build docker images pdo_client, pdo_services and pdo_ccf when a PR is merged successfully. This workflow can also be dispatched interactively.

*EXPERIMENTAL* -- new github workflows will only be
visible and runnable when they are attached to the
main branch. this commit will enable further testing.

Expand the github workflows associated with the PDO repository. The
old "ci" workflow has been moved to a workflow called "full_test" and
is used as a condition for merge of PRs. It will no longer be run on
every push but only on PR creation.

Add a "configured_test" workflow that can be dispatched on
demand. This workflow allows for different build and run parameters to
be set interactively.

Add a "build_docker" workflow that will attempt to build docker images
pdo_client, pdo_services and pdo_ccf when a PR is merged
successfully. This workflow can also be dispatched interactively.

Signed-off-by: Mic Bowman <[email protected]>
Copy link
Member

@marcelamelara marcelamelara left a comment

Choose a reason for hiding this comment

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

LGTM thanks @cmickeyb !

Copy link
Contributor

@g2flyer g2flyer left a comment

Choose a reason for hiding this comment

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

looks goot to me. I've added a few comment/suggestions but they are definitely of the "take it or leave it" kind ....


- name: Build and run tests
if: "!contains(github.event.commits[0].message, '[debug]')"
Copy link
Contributor

Choose a reason for hiding this comment

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

The old way of triggering debug builds clearly was hacky. But maybe would be good to add a comment to configured_test.yml and the possibility to manually trigger now parameterized builds?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. I will document it better.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Small amount of documentation added.

workflow_dispatch:

pull_request:
types: [closed]
Copy link
Contributor

@g2flyer g2flyer Oct 29, 2024

Choose a reason for hiding this comment

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

Before seeing below if, i stumbled over this [closed] and the lack of something like a type [merged]. Googling a bit i found https://github.com/orgs/community/discussions/26724#discussioncomment-3253093 which proposes an arguably simpler solution to achieve the same effect: on: push: branches: - main

Oops, i notice the same discussion later also mentions your pattern. I didn't see though any problem with above pattern which still seems moderately simpler/more robust (e.g., you don't have to match other triggers in the if clause ..)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually

  1. The comment at the top of that issue is actually wrong (you can detect a merged PR)
  2. Even in that series of responses, the conclusion is to use the pull_request event with a check for merged

I'm going to leave this as is.

jobs:
pdo_specific_tests:
name: Run specific PDO tests
runs-on: ubuntu-22.04
Copy link
Contributor

Choose a reason for hiding this comment

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

This could be another parameter (input)? Although admittedly as everything is done in docker, if we would parameterize that it probably would be better to parameterize docker's UBUNTU_VERSION build argument?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point. if i can actually use the variables from the dispatch i will add this. it will probably have to be fixed in a later PR though since i have no way to test it right now.


if: >
github.event.name == 'workflow_dispatch' ||
github.event.name == 'pull_request' && github.event.pull_request.merged == true
Copy link
Contributor

Choose a reason for hiding this comment

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

Right now we would generate the dockers for every PR, whether it is a version upgrade or not. But i guess there is no easy way to test whether this is a version upgrade PR? That said, as long as storage is not an issue, i guess there is loittle cost for doing it on all PRs (the actual build should be "free" if github caching works properly as the CI already should have built them?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

agree. but remember that the version is updated with every commit. i think there is a question that we need to talk through about when to trigger the action. i don't think this is an unreasonable starting point. i would prefer to get this version working and then come back and address the trigger conditions.

@g2flyer g2flyer merged commit 832f89f into hyperledger-labs:main Oct 30, 2024
5 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.

3 participants