Skip to content

test automatically prevent future merges when a backport fails #1909

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

Merged
merged 31 commits into from
Jun 23, 2022
Merged
Changes from 6 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
b8705de
WIP: test automatically prevent future merges when a backport fails
Mikaayenson Apr 1, 2022
0364c4d
dont wait for workflows status (increases billable hours)
Mikaayenson Apr 19, 2022
837fee8
fail workflow if latest backporting is in a bad state
Mikaayenson Apr 19, 2022
bbcff6b
Merge branch 'main' into 1899-automatically-prevent-future-merges
Mikaayenson Apr 19, 2022
cf3fcc2
use variables
Mikaayenson Apr 21, 2022
3a28448
Merge branch '1899-automatically-prevent-future-merges' of https://gi…
Mikaayenson Apr 21, 2022
6498be6
check unit tests status for all supported branch versions
Mikaayenson Apr 25, 2022
e82be88
branch version list from file
Mikaayenson Apr 25, 2022
59fb772
Merge branch 'main' into 1899-automatically-prevent-future-merges
Mikaayenson Jun 6, 2022
b32e1fe
use stack-schema-map file to get target branch list
Mikaayenson Jun 6, 2022
067fb40
test new list-target-branches
Mikaayenson Jun 6, 2022
e7b44ea
wip: test branch status check
Mikaayenson Jun 6, 2022
d44893f
WIP test parsing stack-schema
Mikaayenson Jun 6, 2022
a711adf
wip: cleanup parsing
Mikaayenson Jun 6, 2022
52f9405
readd target list file
Mikaayenson Jun 6, 2022
820ee8f
fix target-branches file name
Mikaayenson Jun 6, 2022
2daff61
update target list
Mikaayenson Jun 6, 2022
327ea2f
Merge branch 'main' into 1899-automatically-prevent-future-merges
Mikaayenson Jun 15, 2022
fd5797b
add newline
Mikaayenson Jun 15, 2022
d54be26
WIP: reuse workflow
Mikaayenson Jun 16, 2022
f11580e
fix workflow name typo
Mikaayenson Jun 16, 2022
a969982
wip: test local reference
Mikaayenson Jun 16, 2022
8ad444f
Merge branch 'main' into 1899-automatically-prevent-future-merges
Mikaayenson Jun 16, 2022
c807b32
Merge branch 'main' into 1899-automatically-prevent-future-merges
Mikaayenson Jun 20, 2022
0cf92bc
Ensure navigator update occurs after build
Mikaayenson Jun 22, 2022
7d61153
migrate list-target-branches job to independent workflow
Mikaayenson Jun 22, 2022
b57f9fc
add target_branch_list key
Mikaayenson Jun 22, 2022
faca523
remote committed target-branch file
Mikaayenson Jun 22, 2022
2031ad1
output target branches as optional arg
Mikaayenson Jun 23, 2022
244c981
remove python setup
Mikaayenson Jun 23, 2022
1277543
remove checkout
Mikaayenson Jun 23, 2022
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
41 changes: 29 additions & 12 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,34 @@ jobs:
- name: Python License Check
run: |
python -m detection_rules dev license-check


- name: Unit tests
run: |
python -m detection_rules test

- name: Get Backport Status
id: get_backport_status
uses: fjogeleit/http-request-action@v1
with:
url: "https://api.github.com/repos/elastic/detection-rules/actions/workflows/backport.yml/runs?per_page=1"
method: 'GET'

- name: Check Backport Status
uses: actions/github-script@v6
with:
script: |
const workflow_status = ${{ toJSON(fromJSON(steps.get_backport_status.outputs.response).workflow_runs[0].status) }}
const workflow_conclusion = ${{ toJSON(fromJSON(steps.get_backport_status.outputs.response).workflow_runs[0].conclusion) }}
if (workflow_status != 'completed' || workflow_conclusion != 'success') {
core.setFailed('Recent Backport status: ' + workflow_status + ', conclusion: ' + workflow_conclusion)
}

- name: Update navigator gist files
env:
GITHUB_TOKEN: "${{ secrets.NAVIGATOR_GIST_TOKEN }}"
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
run: python -m detection_rules dev update-navigator-gists

- name: Build release package
env:
# only generate the navigator files on push events to main
Expand All @@ -46,14 +73,4 @@ jobs:
with:
name: release-files
path: |
releases

- name: Unit tests
run: |
python -m detection_rules test

- name: Update navigator gist files
env:
GITHUB_TOKEN: "${{ secrets.NAVIGATOR_GIST_TOKEN }}"
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
run: python -m detection_rules dev update-navigator-gists
releases