Skip to content

Commit

Permalink
chore: Switch to stale bot (#742)
Browse files Browse the repository at this point in the history
  • Loading branch information
a-thaler committed Jan 23, 2024
1 parent 5ca33c6 commit 112096f
Show file tree
Hide file tree
Showing 10 changed files with 118 additions and 21 deletions.
19 changes: 0 additions & 19 deletions .github/stale.yml

This file was deleted.

File renamed without changes.
31 changes: 31 additions & 0 deletions .github/workflows/periodic-github-checks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: 'Periodic Github Checks'

on:
schedule:
- cron: '0 0 * * *' # Runs daily at midnight
workflow_dispatch: # Allows manual triggering of the workflow

jobs:
stale-issues:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v9
with:
days-before-stale: 60
days-before-close: 7
stale-issue-label: 'lifecycle/stale'
stale-pr-label: 'lifecycle/stale'
exempt-issue-labels: 'lifecycle/frozen'
exempt-pr-labels: 'lifecycle/frozen'
stale-issue-message: |
This issue has been automatically marked as stale due to the lack of recent activity. It will soon be closed if no further activity occurs.
Thank you for your contributions.
stale-pr-message: |
This pull request has been automatically marked as stale due to the lack of recent activity. It will soon be closed if no further activity occurs.
Thank you for your contributions.
close-issue-message: |
This issue has been automatically closed due to the lack of recent activity.
/lifecycle rotten
close-pr-message: |
This pull request has been automatically closed due to the lack of recent activity.
/lifecycle rotten
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
85 changes: 85 additions & 0 deletions .github/workflows/pr-lifecycle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: PR Lifecycle

on:
pull_request:
branches:
- "main"
- "release-*"
paths-ignore:
- 'docs/**'
- '**.md'
workflow_dispatch:

jobs:
manager-upgrade:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Setup Golang
uses: "./.github/template/setup-golang"

- name: Provision K3D
shell: bash
run: make provision-k3d

- name: Deploy with latest tag
shell: bash
run: |
git fetch --tags
LATEST_TAG=$(git tag --sort=-creatordate | sed -n 1p)
echo "Using tag ${LATEST_TAG}"
git checkout ${LATEST_TAG}
GIT_COMMIT_SHA=$(git rev-parse --short=8 HEAD)
GIT_COMMIT_DATE=$(git show -s --format=%cd --date=format:'v%Y%m%d' ${GIT_COMMIT_SHA})
echo "Deploying Manager using image europe-docker.pkg.dev/kyma-project/prod/telemetry-manager:${GIT_COMMIT_DATE}-${GIT_COMMIT_SHA}"
IMG=europe-docker.pkg.dev/kyma-project/prod/telemetry-manager:${GIT_COMMIT_DATE}-${GIT_COMMIT_SHA} make deploy-dev
- name: Switch back to current revision
uses: actions/checkout@v4

- name: Wait for operator readiness
shell: bash
run: kubectl -n kyma-system rollout status deployment telemetry-operator --timeout=90s

- name: Run test on latest tag
shell: bash
run: make run-upgrade-test

- name: Wait for cleanup of test run
shell: bash
run: hack/wait-for-namespaces.sh

# wait for the build to succeed so that the manager image is available
- name: Wait for the 'pull-telemetry-manager-build' job to succeed
uses: kyma-project/wait-for-commit-status-action@2b3ffe09af8b6f40e1213d5fb7f91a7bd41ffb20
with:
context: "pull-telemetry-manager-build"
commit_ref: "${{ github.event.pull_request.head.sha }}" # Note: 'github.event.pull_request.head.sha' is not same as 'github.sha' on pull requests.
timeout: 600000 # 10 minutes in milliseconds
# The check interval is kept long otherwise it will exhaust the GitHub rate limit (More info: https://docs.github.com/en/rest/overview/resources-in-the-rest-api?apiVersion=2022-11-28#rate-limiting)
check_interval: 60000 # 1 minute in milliseconds
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
GITHUB_OWNER: "${{ github.repository_owner }}"
GITHUB_REPO: "telemetry-manager"

- name: Deploy with current version
shell: bash
run: |
IMG=europe-docker.pkg.dev/kyma-project/dev/telemetry-manager:PR-${{ github.event.number }} make deploy-dev
- name: Wait for operator readiness
shell: bash
run: kubectl -n kyma-system rollout status deployment telemetry-operator --timeout=90s

- name: Run test on current version
shell: bash
run: make run-upgrade-test

- name: Finalize test
uses: "./.github/template/finalize-test"
if: success() || failure()
with:
failure: failure()
2 changes: 1 addition & 1 deletion .github/workflows/slack-message.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"text": "'${{ github.workflow }}' workflow failed on '${{ env.DEFAULT_BRANCH }}' branch in the '${{ github.event.repository.name }}' repository!"
"text": "'${{ github.workflow }}' workflow failed, see https://github.com/kyma-project/telemetry-manager/actions"
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: GitHub Release
name: Tag Release

on:
push:
Expand Down

0 comments on commit 112096f

Please sign in to comment.