Skip to content

Commit

Permalink
🔧 Create Scheduled Issue workflows (#5191)
Browse files Browse the repository at this point in the history
* 🔧 Create Ingestion Issue workflow

* Update .github/workflows/ingestion-issue-schedule.yml

Co-authored-by: Jacob Woffenden <[email protected]>

* Update .github/workflows/ingestion-issue-schedule.yml

Co-authored-by: Jacob Woffenden <[email protected]>

* Update .github/workflows/ingestion-issue-schedule.yml

Co-authored-by: Jacob Woffenden <[email protected]>

* Update .github/workflows/ingestion-issue-schedule.yml

Co-authored-by: Jacob Woffenden <[email protected]>

* Update .github/workflows/ingestion-issue-schedule.yml

Co-authored-by: Jacob Woffenden <[email protected]>

* 🚧 WIP

* 🔧 Update maintenance workflows

* 📝 typo

* 📝 Typo

* 🔧 Add JupyterLab Schedule

---------

Co-authored-by: Jacob Woffenden <[email protected]>
  • Loading branch information
Gary-H9 and Jacob Woffenden authored Sep 3, 2024
1 parent 2874e4b commit 82d6629
Show file tree
Hide file tree
Showing 5 changed files with 258 additions and 1 deletion.
63 changes: 63 additions & 0 deletions .github/workflows/schedule-issue-actions-runner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
name: 📥 Maintenance - Create Actions Runner Issue

on:
schedule:
- cron: "0 8 1,15 * *" # UTC time: “At 08:00 on day-of-month 1 and 15.”

permissions: {}

jobs:
create-maintenance-issue:
name: Create Maintenance Issue
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Create Maintenance Issue
id: create_maintenance_issue
run: |
if [[ "${CLOSE_PREVIOUS}" == true ]]; then
previous_issue_number=$(gh issue list \
--label "$LABELS" \
--json number \
--jq '.[0].number')
if [[ -n $previous_issue_number ]]; then
gh issue close "$previous_issue_number"
gh issue unpin "$previous_issue_number"
fi
fi
new_issue_url=$(gh issue create \
--title "$TITLE" \
--assignee "$ASSIGNEES" \
--label "$LABELS" \
--body "$BODY")
if [[ $PINNED == true ]]; then
gh issue pin "$new_issue_url"
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
TITLE: 📥 Maintenance - Actions Runner
ASSIGNEES:
LABELS: maintenance
BODY: |
> [!NOTE]
> This issue is created by a scheduled workflow.
### User Story
As an… engineer on the Analytical Platform
I need/want/expect to… keep Actions Runner image up to date
So that… security / best practice etc
### Definition of Done
- [ ] Merge any open dependabot Pull Requests in the Actions Runnner [repository](https://github.com/ministryofjustice/analytical-platform-actions-runner/pulls).
- [ ] Create new [release](https://github.com/ministryofjustice/analytical-platform-actions-runner).
- [ ] Create a new release in [development](https://controlpanel.services.dev.analytical-platform.service.justice.gov.uk/releases/).
- [ ] Deployment development.
- [ ] Create a new release in [production](https://controlpanel.services.analytical-platform.service.justice.gov.uk/releases/).
- [ ] Deploy production.
PINNED: false
CLOSE_PREVIOUS: false
66 changes: 66 additions & 0 deletions .github/workflows/schedule-issue-ingestion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
name: 📥 Maintenance - Create Ingestion Issue

on:
schedule:
- cron: "0 8 1,15 * *" # UTC time: “At 08:00 on day-of-month 1 and 15.”

permissions: {}

jobs:
create-maintenance-issue:
name: Create Maintenance Issue
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Create Maintenance Issue
id: create_maintenance_issue
run: |
if [[ "${CLOSE_PREVIOUS}" == true ]]; then
previous_issue_number=$(gh issue list \
--label "$LABELS" \
--json number \
--jq '.[0].number')
if [[ -n $previous_issue_number ]]; then
gh issue close "$previous_issue_number"
gh issue unpin "$previous_issue_number"
fi
fi
new_issue_url=$(gh issue create \
--title "$TITLE" \
--assignee "$ASSIGNEES" \
--label "$LABELS" \
--body "$BODY")
if [[ $PINNED == true ]]; then
gh issue pin "$new_issue_url"
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
TITLE: 📥 Maintenance - Ingestion
ASSIGNEES:
LABELS: maintenance
BODY: |
> [!NOTE]
> This issue is created by a scheduled workflow.
### User Story
As an… engineer on the Analytical Platform
I need/want/expect to… keep the ingestion service up to date
So that… security / best practice etc
### Definition of Done
- [ ] Merge any open dependabot Pull Requests in the Ingestion repositories (noted below).
- [ ] Create new release of [ingestion-transfer](https://github.com/ministryofjustice/analytical-platform-ingestion-transfer/releases).
- [ ] Create new release of [ingestion-scan ](https://github.com/ministryofjustice/analytical-platform-ingestion-scan/releases).
- [ ] Create new release of [ingestion-notify](https://github.com/ministryofjustice/analytical-platform-ingestion-notify/releases/tag/0.0.14).
- [ ] Update the images used in the Modernisation Platform environments repository (in the manner done [here](https://github.com/ministryofjustice/modernisation-platform-environments/commit/af4d5003385721502127e5a8c22d0a21eee492fa)).
- [ ] Deploy development.
- [ ] Deploy production.
📝 Documentation [here](https://docs.analytical-platform.service.justice.gov.uk/documentation/runbooks/001-ingestion-maintenance.html#ingestion-maintenance)
PINNED: false
CLOSE_PREVIOUS: false
64 changes: 64 additions & 0 deletions .github/workflows/schedule-issue-jupyterlab.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
name: 📥 Maintenance - Create JupyterLab Issue

on:
schedule:
- cron: "0 8 1,15 * *" # UTC time: “At 08:00 on day-of-month 1 and 15.”

permissions: {}

jobs:
create-maintenance-issue:
name: Create Maintenance Issue
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Create Maintenance Issue
id: create_maintenance_issue
run: |
if [[ "${CLOSE_PREVIOUS}" == true ]]; then
previous_issue_number=$(gh issue list \
--label "$LABELS" \
--json number \
--jq '.[0].number')
if [[ -n $previous_issue_number ]]; then
gh issue close "$previous_issue_number"
gh issue unpin "$previous_issue_number"
fi
fi
new_issue_url=$(gh issue create \
--title "$TITLE" \
--assignee "$ASSIGNEES" \
--label "$LABELS" \
--body "$BODY")
if [[ $PINNED == true ]]; then
gh issue pin "$new_issue_url"
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
TITLE: 📥 Maintenance - Visual Studio Code
ASSIGNEES:
LABELS: maintenance
BODY: |
> [!CAUTION]
> JupyterLab is still in development. Confirm these updates should be made before proceeding. Delete this caution once JupiterLab is in production.
### User Story
As a… engineer on the Analytical Platform
I need/want/expect to… keep JupyterLab up to date
So that… security / best practice etc
### Definition of Done
- [ ] Merge any open dependabot Pull Requests in the JupyterLab [repository](https://github.com/ministryofjustice/analytical-platform-jupyterlab).
- [ ] Create new [release](https://github.com/ministryofjustice/analytical-platform-jupyterlab/releases).
- [ ] Update [guidance](https://user-guidance.analytical-platform.service.justice.gov.uk/tools/visual-studio-code/#visual-studio-code), if required.
- [ ] Create a new release in [development](https://controlpanel.services.dev.analytical-platform.service.justice.gov.uk/releases/).
- [ ] Test deployment in development.
- [ ] Create a new release in [production](https://controlpanel.services.analytical-platform.service.justice.gov.uk/releases/).
- [ ] Test deployment in production.
PINNED: false
CLOSE_PREVIOUS: false
64 changes: 64 additions & 0 deletions .github/workflows/schedule-issue-vscode.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
name: 📥 Maintenance - Create Visual Studio Code Issue

on:
schedule:
- cron: "0 8 1,15 * *" # UTC time: “At 08:00 on day-of-month 1 and 15.”

permissions: {}

jobs:
create-maintenance-issue:
name: Create Maintenance Issue
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Create Maintenance Issue
id: create_maintenance_issue
run: |
if [[ "${CLOSE_PREVIOUS}" == true ]]; then
previous_issue_number=$(gh issue list \
--label "$LABELS" \
--json number \
--jq '.[0].number')
if [[ -n $previous_issue_number ]]; then
gh issue close "$previous_issue_number"
gh issue unpin "$previous_issue_number"
fi
fi
new_issue_url=$(gh issue create \
--title "$TITLE" \
--assignee "$ASSIGNEES" \
--label "$LABELS" \
--body "$BODY")
if [[ $PINNED == true ]]; then
gh issue pin "$new_issue_url"
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
TITLE: 📥 Maintenance - Visual Studio Code
ASSIGNEES:
LABELS: maintenance
BODY: |
> [!NOTE]
> This issue is created by a scheduled workflow.
### User Story
As a… engineer on the Analytical Platform
I need/want/expect to… keep Visual Studio Code up to date
So that… security / best practice etc
### Definition of Done
- [ ] Merge any open dependabot Pull Requests in the Visual Studio Code [repository](https://github.com/ministryofjustice/analytical-platform-visual-studio-code).
- [ ] Create new [release](https://github.com/ministryofjustice/analytical-platform-visual-studio-code/releases).
- [ ] Update [guidance](https://user-guidance.analytical-platform.service.justice.gov.uk/tools/visual-studio-code/#visual-studio-code), if required.
- [ ] Create a new release in [development](https://controlpanel.services.dev.analytical-platform.service.justice.gov.uk/releases/).
- [ ] Test deployment in development.
- [ ] Create a new release in [production](https://controlpanel.services.analytical-platform.service.justice.gov.uk/releases/).
- [ ] Test deployment in production.
PINNED: false
CLOSE_PREVIOUS: false
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
owner_slack: "#analytical-platform-notifications"
title: Ingestion Mainentance
title: Ingestion Maintenance
last_reviewed_on: 2024-07-18
review_in: 1 months
---
Expand Down

0 comments on commit 82d6629

Please sign in to comment.