droolsjbpm-build-bootstrap icon indicating copy to clipboard operation
droolsjbpm-build-bootstrap copied to clipboard

[BXMSPROD-1770] Centralize Operating Systems Configuration

Open lampajr opened this issue 2 years ago • 6 comments

Thank you for submitting this pull request

JIRA:

  • https://issues.redhat.com/browse/BXMSPROD-1770

referenced Pull Requests:

  • https://github.com/kiegroup/kogito-pipelines/pull/590
  • https://github.com/kiegroup/droolsjbpm-build-bootstrap/pull/2040

Improvements:

  • Added OS Preparation Github action
  • Changed Pull Request workflow to configure the os matrix using the new composite action
  • Allow triggering windows specific job using 'windows_check' label

Once we agree on and merge this:

  • I'll propagate Pull Request flow changes on all other repositories
  • Add the same OS preparation step on Kogito-* repos
How to replicate CI configuration locally?

Build Chain tool does "simple" maven build(s), the builds are just Maven commands, but because the repositories relates and depends on each other and any change in API or class method could affect several of those repositories there is a need to use build-chain tool to handle cross repository builds and be sure that we always use latest version of the code for each repository.

build-chain tool is a build tool which can be used locally on command line or in Github Actions workflow(s), in case you need to change multiple repositories and send multiple dependent pull requests related with a change you can easily reproduce the same build by executing it on Github hosted environment or locally in your development environment. See local execution details to get more information about it.

A general local execution could be the following one, where the tool clones all dependent projects starting from the -sp one and it locally applies the pull request (if it exists) in order to reproduce a complete build scenario for the provided Pull Request.

Note: the tool considers multiple Pull Requests related to each other if their branches (generally in the forked repositories) have the same name.

$ build-chain-action -df 'https://raw.githubusercontent.com/${GROUP:kiegroup}/droolsjbpm-build-bootstrap/${BRANCH:main}/.ci/pull-request-config.yaml' build pr -url <pull-request-url> -sp kiegroup/kie-wb-distributions [--skipExecution]

Consider changing kiegroup/kie-wb-distributions with the correct starting project.

How to retest this PR or trigger a specific build:
  • a pull request please add comment: Jenkins retest (using this e.g. Jenkins retest this optional but no longer required)

  • for a full downstream build

    • for jenkins job: please add comment: Jenkins run fdb
    • for github actions job: add the label run_fdb
  • a compile downstream build please add comment: Jenkins run cdb

  • a full production downstream build please add comment: Jenkins execute product fdb

  • an upstream build please add comment: Jenkins run upstream

lampajr avatar Aug 22 '22 20:08 lampajr

Once we agree, I'll revert the commit 85271135e47e521f335af2ff6e51855951b1199e and 077e87701621e0d53b630b3851046ba32be46c14 such that the os-prep step will be implemented as:

os-prep:
    runs-on: ubuntu-latest
    outputs:
      os: ${{ steps.set-os.outputs.operating-systems }}
    steps:
    - name: OS Preparation
      id: set-os
      uses: kiegroup/droolsjbpm-build-bootstrap/.ci/actions/os-preparation@main

And the action checkout as:

runs:
  using: "composite"
  steps:
    - name: Check out droolsjbpm-build-bootstrap
      uses: actions/checkout@v3
      with:
        repository: kiegroup/droolsjbpm-build-bootstrap
        path: matrix_preparation

lampajr avatar Aug 23 '22 08:08 lampajr

A valid test should be to add the windows_check label and check the PR job is run on Windows

lampajr avatar Aug 23 '22 08:08 lampajr

please check my comments. For logging purposes I propose to add a final step on os-preparation action printing either the filters to decide which os to take (event + repository) and array output

Added a new step for printing the resulting os array. Regarding the filters, they are already visible on the console output since I set them as env variables:

2022-08-23T10:10:16.4712276Z env:
2022-08-23T10:10:16.4712515Z   repo_name: droolsjbpm-build-bootstrap
2022-08-23T10:10:16.4712781Z   event: pull_request
2022-08-23T10:10:16.4713233Z   label_name: 

lampajr avatar Aug 23 '22 12:08 lampajr

Configuration fixed [this will fail until merged in main].

PR Workflow succeeded using temporary testing configuration, the results can be found here

lampajr avatar Aug 25 '22 12:08 lampajr

what is the root cause of this error on os-prep GHA?

 Error: Can't find 'action.yml', 'action.yaml' or 'Dockerfile' under '/home/runner/work/_actions/kiegroup/droolsjbpm-build-bootstrap/main/.ci/actions/os-preparation'. Did you forget to run actions/checkout before running your local action?

mareknovotny avatar Aug 26 '22 08:08 mareknovotny

what is the root cause of this error on os-prep GHA?

 Error: Can't find 'action.yml', 'action.yaml' or 'Dockerfile' under '/home/runner/work/_actions/kiegroup/droolsjbpm-build-bootstrap/main/.ci/actions/os-preparation'. Did you forget to run actions/checkout before running your local action?

That's because I fixed the workflow configuration which now takes the action from branch main, thus since it is not merged yet it won't find it. All the checks succeeded temporary referring to the dev branch BXMSPROD-1770_os_preparation on my fork, here the results https://github.com/kiegroup/droolsjbpm-build-bootstrap/actions/runs/2925715643.

lampajr avatar Aug 26 '22 08:08 lampajr

is it ready for merging? @Ginxo @lampajr ?

mareknovotny avatar Dec 13 '22 10:12 mareknovotny

is it ready for merging? @Ginxo @lampajr ?

Yeah it is

lampajr avatar Dec 13 '22 10:12 lampajr