Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/ci-scheduler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Scheduled Hibernate Validator Builds

on:
schedule:
- cron: '0 0 * * 6'

permissions:
contents: read

jobs:
build-maintenance-branches:
name: Limited support branches build
strategy:
fail-fast: false
matrix:
branch: [ '9.0', '8.0', '6.2' ]
uses: ./.github/workflows/ci.yml
with:
branch: ${{ matrix.branch }}
24 changes: 23 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ on:
# we'll reject such dependant PRs and send a PR ourselves.
- '!dependabot/**'
- 'dependabot/maven/build-dependencies-**'
# Allow calling this workflow from the scheduler
workflow_call:
inputs:
branch:
required: true
type: string
# Allow running this workflow manually
workflow_dispatch:

concurrency:
group: "workflow = ${{ github.workflow }}, ref = ${{ github.event.ref }}, pr = ${{ github.event.pull_request.id }}"
Expand Down Expand Up @@ -86,8 +94,10 @@ jobs:
- name: Support longpaths on Windows
if: "startsWith(matrix.os.runs-on, 'windows')"
run: git config --global core.longpaths true
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # 6.0.0
- name: Checkout ${{ inputs.branch }}
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # 6.0.0
with:
ref: ${{ inputs.branch }}
persist-credentials: false
- name: Set up Java ${{ matrix.os.java.version }}
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # 5.0.0
Expand Down Expand Up @@ -140,5 +150,17 @@ jobs:
name: build-scan-data-incontainer-${{ matrix.os.name }}
path: ~/.m2/.develocity/build-scan-data

- name: Notify the build failure
if: ${{ failure() && github.repository == 'hibernate/hibernate-validator'}}
uses: zulip/github-actions-zulip/send-message@e4c8f27c732ba9bd98ac6be0583096dea82feea5 # v1.0.2
with:
api-key: ${{ secrets.ZULIP_GITHUB_WORKFLOW_NOTIFICATION_API_KEY }}
email: ${{ secrets.ZULIP_GITHUB_WORKFLOW_NOTIFICATION_EMAIL }}
organization-url: "https://hibernate.zulipchat.com"
type: "stream"
to: "hibernate-validator-dev"
topic: "GitHub workflow failures"
content: "The GitHub [build #${{github.run_id}}](https://github.com/hibernate/hibernate-validator/actions/runs/${{github.run_id}}) failed and requires your attention :warning:"
Comment on lines +153 to +163
Copy link
Member Author

Choose a reason for hiding this comment

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

hey @yrodiere
since validator workflows are relatively the fastest ones to run 😃 I thought I'd test things out on them first...
I've added a scheduler to trigger the builds on the branches we have in a limited support state and then this extra step to send a zulip notification if things go wrong. But we'd need to setup a new zulip bot to get that working.
That is, of course 🙂, if you think that this ^ makes sense 🫣 🙂

Copy link
Member

Choose a reason for hiding this comment

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

I would have preferred email notifications since this is not something we can/should drop everything else to work on, but... we don't have appropriate mailing lists for that for now, and I don't think Commonhaus is ready to provide any (yet).

So the only thing I would ask is: can we somehow move this to a shared action/workflow that we could update independently, avoiding the need to push to every single branch next time we want to change this (e.g. to switch to emails)?

For Jenkins I believe we can do that by moving the notification stuff to a custom function in the pipeline helpers. For GitHub actions I think shared workflows are our only option...

Copy link
Member Author

Choose a reason for hiding this comment

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

ok, let me try that out ... we might be able to leverage https://docs.github.com/en/actions/tutorials/create-actions/create-a-composite-action
I'm thinking that the hibernate-jenkins-pipeline-helpers could be a place for this shared action ?

the problem with the email notification is ... that it's not a built in functionality, and I didn't see some reputable send-an-email action, that's how I ended up with the zulip idea...

Copy link
Member

Choose a reason for hiding this comment

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

I'm thinking that the hibernate-jenkins-pipeline-helpers could be a place for this shared action ?

I would have put it in https://github.com/hibernate/.github/?

Copy link
Member Author

Choose a reason for hiding this comment

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

hmm yeah .. I thought about this one initially ... but then thought that the .github one is more of a "special" repository and we'd be bettter with the action/workflow in some CI related repository 🙂
but if you think .github is the place for it 👍🏻 🙂

btw the idea with the shared action didn't play out as I'd wish it to... since for it to work we need to pass the secrets to the action when we use it .. so it means we'd be changing the workflows if we decide to send notifications somewhere else... I'll try the workflow next, but it would probably require some orther changes (e.g. the "current repository" might be not the one from which we've called the workflow 🫣 🙂 and I've used that in the action to decrease the # of input parameters)

Copy link
Member

Choose a reason for hiding this comment

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

At the end of the day, whatever works. But the Quarkus team seems the .github repo is a decent place for shared GitHub Actions workflows, at least: https://github.com/quarkusio/.github/tree/main/.github/workflows


- name: Omit produced artifacts from build cache
run: rm -r ~/.m2/repository/org/hibernate/validator