From 272b4f97bbbf2ab31ef2e2c79e5470dd35d1cf6f Mon Sep 17 00:00:00 2001 From: mkolasinski-splunk Date: Wed, 25 Sep 2024 13:23:47 +0200 Subject: [PATCH 1/3] fix: publish conditions fix and documentation adjustments --- .github/pull_request_template.md | 13 +++++++++++++ .github/workflows/reusable-build-test-release.yml | 5 +++-- README.md | 14 +++++++++++++- 3 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 .github/pull_request_template.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..7e9aab6d --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,13 @@ +### Description + +(PR description goes here) + +### Checklist + +- [ ] `README.md` has been updated or is not required +- [ ] push trigger tests +- [ ] manual release test +- [ ] automated releaes test +- [ ] pull request trigger tests +- [ ] schedule trigger tests +- [ ] workflow errors/warnings reviewed and addressed diff --git a/.github/workflows/reusable-build-test-release.yml b/.github/workflows/reusable-build-test-release.yml index be6e3875..aa3c47c0 100644 --- a/.github/workflows/reusable-build-test-release.yml +++ b/.github/workflows/reusable-build-test-release.yml @@ -2333,7 +2333,7 @@ jobs: summary-scripted* pre-publish: - if: ${{ !cancelled() && needs.validate-custom-version.result == 'success' }} + if: ${{ !cancelled() }} # The following line will rename 'pre-publish' to 'pre-publish-not_main_pr' when PR is created towards main branch # It is necessary to avoid confusion caused by githubactions considering pre-publish for both push to develop branch # and pull_request to main branch events. @@ -2377,8 +2377,9 @@ jobs: publish: if: | - (!cancelled() && needs.pre-publish.result == 'success' && github.event_name != 'pull_request' && github.event_name != 'schedule') || + (!cancelled() && needs.pre-publish.result == 'success' && github.event_name == 'push' && github.event.inputs.custom-version == '') || (!cancelled() && needs.pre-publish.result == 'success' && github.event.inputs.custom-version != '' && needs.validate-custom-version.result == 'success') + # First condition for standard release process, second one for manual custom-version release process name: ${{ github.event.inputs.custom-version == '' && 'publish' || 'publish-custom-version' }} needs: diff --git a/README.md b/README.md index 3a801f20..b7e8bde0 100644 --- a/README.md +++ b/README.md @@ -17,13 +17,25 @@ Workflow defines jobs which perform security code scanning, execute different ty * If bugfix release is needed: * make a change * test it + * pull-request scenario + * push scenario + * release scenario (test-addonfactory-repository) * create a PR to the `main` branch * get all the approvals from the team * merge it using "squash commit" option * backport the change back to the `develop` branch * new version of the workflow is going to be released (v4.17.0 (before) -> v4.17.1 (after)) and it will automatically applied to all the repositories -# Troubleshooting for different workflow stages in GitHub Actions +# Workflow jobs + +## Inputs +* marker - list of markers used to paralelize modinput tests +* ui_marker - list of markers used to paralelize ui tests +* custom-version - version used for release on manual workflow trigger +* execute-tests-on-push-to-release - enable tests on release branch - default false +* k8s-enfironment - k8s environment for testing +* k8s-manifests-branch - k8s-manifests branch for testing +* scripted-inputs-os-list - list of OSes used for scripted inputs tests ## General troubleshooting From 1231ff5cd49b1e887ef7039b74591e488abe82c1 Mon Sep 17 00:00:00 2001 From: mkolasinski-splunk <105011638+mkolasinski-splunk@users.noreply.github.com> Date: Wed, 25 Sep 2024 14:45:21 +0200 Subject: [PATCH 2/3] Update .github/pull_request_template.md Co-authored-by: kdoroszko-splunk --- .github/pull_request_template.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 7e9aab6d..89f8b385 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -11,3 +11,6 @@ - [ ] pull request trigger tests - [ ] schedule trigger tests - [ ] workflow errors/warnings reviewed and addressed + +### Testing done +(for each selected checkbox, the corresponding test results link should be listed here) From de0409f659d55d8885d2c7677e24509bd5a5d08e Mon Sep 17 00:00:00 2001 From: mkolasinski-splunk Date: Wed, 25 Sep 2024 20:52:18 +0200 Subject: [PATCH 3/3] chore: simplify publish job condition --- .github/workflows/reusable-build-test-release.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/reusable-build-test-release.yml b/.github/workflows/reusable-build-test-release.yml index aa3c47c0..b37e3048 100644 --- a/.github/workflows/reusable-build-test-release.yml +++ b/.github/workflows/reusable-build-test-release.yml @@ -2376,12 +2376,8 @@ jobs: exit 1 publish: - if: | - (!cancelled() && needs.pre-publish.result == 'success' && github.event_name == 'push' && github.event.inputs.custom-version == '') || - (!cancelled() && needs.pre-publish.result == 'success' && github.event.inputs.custom-version != '' && needs.validate-custom-version.result == 'success') - # First condition for standard release process, second one for manual custom-version release process + if: ${{ !cancelled() && needs.pre-publish.result == 'success' && (github.event_name == 'push' || needs.validate-custom-version.result == 'success') }} name: ${{ github.event.inputs.custom-version == '' && 'publish' || 'publish-custom-version' }} - needs: - pre-publish - validate-custom-version