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

Refactoring Github workflows #161

Merged
merged 7 commits into from
Apr 11, 2023
Merged

Refactoring Github workflows #161

merged 7 commits into from
Apr 11, 2023

Conversation

didierofrivia
Copy link
Collaborator

@didierofrivia didierofrivia commented Apr 7, 2023

This PR not only fixes the bundle creation and catalog verification that was failing because of a mismatch of listed dependency versions:

Referenced Limitador version is 0.6.0, but found 0.0.0 in the bundle 
make[1]: *** [make/catalog.mk:26: /home/runner/work/kuadrant-operator/kuadrant-operator/catalog/kuadrant-operator-catalog/operator.yaml] Error 1
make[1]: Leaving directory '/home/runner/work/kuadrant-operator/kuadrant-operator'
make: *** [make/catalog.mk:35: catalog] Error 2
Error: Process completed with exit code 2.

but also a complete refactor of every build job:

  1. Event push, branch main:
  • Will add latest tag and 0.0.0 version to the Kuadrant Operator
  • Will include in the bundle and catalog, the latest tagged bundles
  1. Event push, release branch
  • Adds semantic version x.y.z from the tagged branch for both version and tag
  • At the moment, dependencies are left to latest
  • This particular case could be set to manual and add the specific dependencies tags
  1. Event push, any branch but main and release (tagged as semantic vx.y.z)
  • Will add branch name tag and 0.0.0 version to the Kuadrant Operator
  • Dependencies will be included as in the main case.
  1. Event scheduled, branch main:
  • It triggers once per week
  • Collects the latest sha github reference that are stored in GH action variables
  • Tags itself and dependencies to the sha collected, sets version to 0.0.0
  1. Event workflow_dispatch, branch any:
  • Manual trigger of building images
  • The user is responsible to input the specific versions

Notes:

  • The jobs listed above will call (workflow_call) a reusable workflow build-images-base
  • Every image built will be tagged with the specific tag provided, and the github sha reference
  • The old build-images workflow was removed.

@didierofrivia didierofrivia self-assigned this Apr 7, 2023
@didierofrivia didierofrivia force-pushed the refactoring-gh-workflows branch 4 times, most recently from affc938 to 02bb7d0 Compare April 7, 2023 15:40
@didierofrivia didierofrivia marked this pull request as ready for review April 10, 2023 10:19
@didierofrivia didierofrivia requested a review from a team as a code owner April 10, 2023 10:19

jobs:
workflow-build:
if: ${{ github.ref_name =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-.+)?$ }}
Copy link
Contributor

Choose a reason for hiding this comment

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

This snippet does not work??

on:
  push:
    tags:
      - 'v[0-9]+.[0-9]+.[0-9]+'

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Some how it wasn't triggering in Act, that's why I change it to the job conditional. I could do that way, it might work with Github

* For `workflow_call` and `workflow_dispatch` events
* Builds Kuadrant Operator image, it's bundle and catalog
* Configurable by inputs
* Only triggered by cron
* Sending kuadrant op version and tag (ref sha)
* Uses defaults for tags, version and dependencies
* Sends `git_ref` as op version and tag, defaults for the rest
* Triggered by push to a branch that's not main nor release
* Triggered by tag creation, filtered by release regex
* Passes the semantic version of the release tag
* Dependencies are default for now, could be edited to be manually
  triggered with dependencies version inputs.
* This is replaced by the combo of caller workflows and
  `build-images-base` one
@didierofrivia didierofrivia merged commit b6ba914 into main Apr 11, 2023
@didierofrivia didierofrivia deleted the refactoring-gh-workflows branch April 11, 2023 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants