Skip to content

Commit

Permalink
feat: Add job: Rebase Pull Requests (#3642)
Browse files Browse the repository at this point in the history
* Add job: Rebase Pull Requests

* use better package

* test branches

* Docs

* test

* Update README.md

* try this

* test

* test

* Try rebase in other jobs

* Try legacy rebase

* Revert

* Try fixing rebase

* fetch from current branch

* not working

* here we go again

* will not work

* lololo

* Would be nice if it works

* another try

* debug

* lolo

* sth

* sth

* sth

* Change rebase to merge

* Is it neccessary

* Is it neccessary

* It is neccessary

* Change all neccessary workflows

* Change readme back

* Add name to step

* Change naming convention: rebase to merge

* Move file

* Try removing depth

* Adjust naming
  • Loading branch information
akucharska authored Feb 6, 2025
1 parent 1c805ec commit dabfa47
Show file tree
Hide file tree
Showing 13 changed files with 99 additions and 78 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: 'Rebase'
description: 'Action for rebasing to the main branch'
name: 'Merge'
description: 'Action for merging PR with the latest main branch'

runs:
using: 'composite'
steps:
# Setup identity to avoid errors when git is trying to rebase without identity set
- name: Setup git identity
run: |
git config --global user.email "rebase@action.com"
git config --global user.name "Rebase Action"
git config --global user.email "merge@action.com"
git config --global user.name "Merge Action"
shell: bash

# Update origin/main branch locally to cover case when repo is not fully cloned
Expand All @@ -19,15 +19,15 @@ runs:
git fetch origin main
git checkout origin/main
git checkout -B main
git pull --unshallow origin main
git pull origin main
# go back to the HEAD commit
git switch --detach ${{ github.sha }}
shell: bash

- name: Rebase to main
- name: Merge with latest main
run: |
git rebase main
git merge main
shell: bash

- name: Print branch log
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/accessibility-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ name: Accessibility Tests

on:
schedule:
- cron: "0 6 * * 1"
- cron: '0 6 * * 1'
pull_request_target:
types: [opened, edited, synchronize, reopened, ready_for_review]
paths:
- ".github/workflows/accessibility-tests.yml"
- "tests/integration/tests/accessibility/**"
- "tests/integration/support/**"
- '.github/workflows/accessibility-tests.yml'
- 'tests/integration/tests/accessibility/**'
- 'tests/integration/support/**'

jobs:
run-accessibility-tests:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:

create-release:
name: Create release
needs: [ build-busola-web, build-busola-backend, build-busola ]
needs: [build-busola-web, build-busola-backend, build-busola]
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/lint-check-pr.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: PR Lint Check

on:
on:
pull_request:
types: [opened, edited, synchronize, reopened, ready_for_review]

Expand All @@ -15,7 +15,7 @@ jobs:
- name: lint_check
shell: bash
run: |
set -e
npm ci
npx eslint --max-warnings 0 src/ backend/
npm run lint-check
set -e
npm ci
npx eslint --max-warnings 0 src/ backend/
npm run lint-check
6 changes: 3 additions & 3 deletions .github/workflows/lint-markdown-links-daily.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
name: Lint Markdown Links Daily
run-name: ${{github.event.pull_request.title}}
on:
schedule:
schedule:
# Run everyday at 5:00 AM
- cron: "0 5 * * *"
- cron: '0 5 * * *'
jobs:
markdown-link-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gaurav-nelson/github-action-markdown-link-check@d53a906aa6b22b8979d33bc86170567e619495ec
with:
use-quiet-mode: 'yes'
use-quiet-mode: 'yes'
use-verbose-mode: 'yes'
config-file: '.mlc.config.json'
folder-path: '.'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint-markdown-links-pr.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: Lint Markdown Links PR
run-name: ${{github.event.pull_request.title}}
on: [ pull_request ]
on: [pull_request]
jobs:
markdown-link-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gaurav-nelson/github-action-markdown-link-check@d53a906aa6b22b8979d33bc86170567e619495ec
with:
use-quiet-mode: 'yes'
use-quiet-mode: 'yes'
use-verbose-mode: 'yes'
config-file: '.mlc.config.json'
folder-path: '.'
Expand Down
21 changes: 12 additions & 9 deletions .github/workflows/pull-integration-cluster-k3d.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ name: PR Integration Cluster Tests

on:
pull_request:
types: [ opened, edited, synchronize, reopened, ready_for_review ]
types: [opened, edited, synchronize, reopened, ready_for_review]
paths:
- ".github/workflows/pull-integration-cluster-k3d.yml"
- "resources/**"
- "tests/**"
- "nginx/**"
- "src/**"
- "backend/**"
- '.github/workflows/pull-integration-cluster-k3d.yml'
- 'resources/**'
- 'tests/**'
- 'nginx/**'
- 'src/**'
- 'backend/**'

jobs:
run-cluster-test:
Expand All @@ -20,11 +20,14 @@ jobs:
with:
comment_on_pr: false
- uses: actions/checkout@v4
# - uses: ./.github/actions/rebase
with:
fetch-depth: 0
- name: Merge with latest main
uses: ./.github/actions/merge
- name: Create Single Cluster
uses: AbsaOSS/k3d-action@4e8b3239042be1dc0aed6c5eb80c13b18200fc79 #v2.4.0
with:
cluster-name: "k3dCluster"
cluster-name: 'k3dCluster'
args: >-
--agents 1
--port 80:80@loadbalancer
Expand Down
21 changes: 12 additions & 9 deletions .github/workflows/pull-integration-namespace-k3d.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
name: PR Integration Namespace Tests

on:
on:
pull_request:
types: [opened, edited, synchronize, reopened, ready_for_review]
paths:
- ".github/workflows/pull-integration-namespace-k3d.yml"
- "resources/**"
- "tests/**"
- "nginx/**"
- "src/**"
- "backend/**"
- '.github/workflows/pull-integration-namespace-k3d.yml'
- 'resources/**'
- 'tests/**'
- 'nginx/**'
- 'src/**'
- 'backend/**'

jobs:
run-namespace-test:
Expand All @@ -20,11 +20,14 @@ jobs:
with:
comment_on_pr: false
- uses: actions/checkout@v4
# - uses: ./.github/actions/rebase
with:
fetch-depth: 0
- name: Merge with latest main
uses: ./.github/actions/merge
- name: Create Single Cluster
uses: AbsaOSS/k3d-action@4e8b3239042be1dc0aed6c5eb80c13b18200fc79 #v2.4.0
with:
cluster-name: "k3dCluster"
cluster-name: 'k3dCluster'
args: >-
--agents 1
--port 80:80@loadbalancer
Expand Down
21 changes: 12 additions & 9 deletions .github/workflows/pull-kyma-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ on:
pull_request:
types: [opened, edited, synchronize, reopened, ready_for_review]
paths:
- ".github/workflows/pull-kyma-intergation-tests.yml"
- "resources/**"
- "tests/integration/**"
- "nginx/**"
- "src/**"
- "backend/**"
- "kyma/**"
- "Dockerfile*"
- '.github/workflows/pull-kyma-intergation-tests.yml'
- 'resources/**'
- 'tests/integration/**'
- 'nginx/**'
- 'src/**'
- 'backend/**'
- 'kyma/**'
- 'Dockerfile*'
jobs:
run-integration-test:
runs-on: ubuntu-latest
Expand All @@ -21,7 +21,10 @@ jobs:
with:
comment_on_pr: false
- uses: actions/checkout@v4
# - uses: ./.github/actions/rebase
with:
fetch-depth: 0
- name: Merge with latest main
uses: ./.github/actions/merge
- name: Install k3d
env:
K3D_URL: https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh
Expand Down
19 changes: 11 additions & 8 deletions .github/workflows/pull-lighthouse.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: PR Lighthouse Test

on:
on:
pull_request:
types: [opened, edited, synchronize, reopened, ready_for_review]
paths:
- ".github/workflows/pull-lighthouse.yml"
- "resources/**"
- "tests/**"
- "nginx/**"
- "src/**"
- '.github/workflows/pull-lighthouse.yml'
- 'resources/**'
- 'tests/**'
- 'nginx/**'
- 'src/**'

jobs:
run-lighthouse-test:
Expand All @@ -19,11 +19,14 @@ jobs:
with:
comment_on_pr: false
- uses: actions/checkout@v4
# - uses: ./.github/actions/rebase
with:
fetch-depth: 0
- name: Merge with latest main
uses: ./.github/actions/merge
- name: Create Single Cluster
uses: AbsaOSS/k3d-action@4e8b3239042be1dc0aed6c5eb80c13b18200fc79 #v2.4.0
with:
cluster-name: "k3dCluster"
cluster-name: 'k3dCluster'
args: >-
--agents 1
--port 80:80@loadbalancer
Expand Down
23 changes: 13 additions & 10 deletions .github/workflows/pull-smoke-test-prod.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
name: PR Kyma Dashboard Smoke Tests Prod

on:
on:
pull_request:
types: [opened, edited, synchronize, reopened, ready_for_review]
paths:
- ".github/workflows/pull-smoke-test-prod.yml"
- "resources/**"
- "tests/kyma/**"
- "nginx/**"
- "src/**"
- "kyma/**"
- "Dockerfile*"
- '.github/workflows/pull-smoke-test-prod.yml'
- 'resources/**'
- 'tests/kyma/**'
- 'nginx/**'
- 'src/**'
- 'kyma/**'
- 'Dockerfile*'

jobs:
run-smoke-test-prod:
Expand All @@ -21,7 +21,10 @@ jobs:
with:
comment_on_pr: false
- uses: actions/checkout@v4
# - uses: ./.github/actions/rebase
with:
fetch-depth: 0
- name: Merge with latest main
uses: ./.github/actions/merge
- name: Install k3d
env:
K3D_URL: https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh
Expand All @@ -38,7 +41,7 @@ jobs:
run: |
set -o pipefail
./.github/scripts/setup-busola.sh | tee busola-build.log
env:
env:
ENV: prod
- name: run_tests
shell: bash
Expand Down
23 changes: 13 additions & 10 deletions .github/workflows/pull-smoke-test-stage.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
name: PR Kyma Dashboard Smoke Tests Stage

on:
on:
pull_request:
types: [opened, edited, synchronize, reopened, ready_for_review]
paths:
- ".github/workflows/pull-smoke-test-stage.yml"
- "resources/**"
- "tests/kyma/**"
- "nginx/**"
- "src/**"
- "kyma/**"
- "Dockerfile*"
- '.github/workflows/pull-smoke-test-stage.yml'
- 'resources/**'
- 'tests/kyma/**'
- 'nginx/**'
- 'src/**'
- 'kyma/**'
- 'Dockerfile*'

jobs:
run-smoke-test-stage:
Expand All @@ -21,7 +21,10 @@ jobs:
with:
comment_on_pr: false
- uses: actions/checkout@v4
# - uses: ./.github/actions/rebase
with:
fetch-depth: 0
- name: Merge with latest main
uses: ./.github/actions/merge
- name: Install k3d
env:
K3D_URL: https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh
Expand All @@ -36,7 +39,7 @@ jobs:
shell: bash
run: |
./.github/scripts/setup-busola.sh | tee busola-build.log
env:
env:
ENV: stage
- name: Run tests
shell: bash
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/pull-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ jobs:
with:
comment_on_pr: false
- uses: actions/checkout@v4
# - uses: ./.github/actions/rebase
with:
fetch-depth: 0
- name: Merge with latest main
uses: ./.github/actions/merge
- uses: actions/setup-node@v4
with:
node-version: 20
Expand Down

0 comments on commit dabfa47

Please sign in to comment.