Skip to content

Commit

Permalink
🧹 Housekeeping (#145)
Browse files Browse the repository at this point in the history
Signed-off-by: Jacob Woffenden <jacob.woffenden@justice.gov.uk>
  • Loading branch information
jacobwoffenden authored Nov 5, 2024
1 parent a7221a3 commit f668866
Show file tree
Hide file tree
Showing 26 changed files with 193 additions and 103 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,16 @@ updates:
commit-message:
prefix: ":dependabot: github-actions"
include: "scope"
labels:
- "dependabot"
- "github-actions"
- package-ecosystem: "devcontainers"
directory: "/"
schedule:
interval: "daily"
commit-message:
prefix: ":dependabot: devcontainers"
include: "scope"
labels:
- "dependabot"
- "devcontainers"
9 changes: 0 additions & 9 deletions .github/linters/.jscpd.json

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Dependency Review
name: 🔍 Dependency Review

on:
pull_request:
Expand Down
94 changes: 94 additions & 0 deletions .github/workflows/github-project-issue-type.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
---
name: 🐙 GitHub Project Issue Type

on:
issues:
types: [opened]

permissions: {}

env:
PROJECT_ID: "PVT_kwDOACGfts4AVFPo" # gh api graphql -f 'query=query{organization(login:"ministryofjustice"){projectV2(number: 44){id}}}' | jq -r '.data.organization.projectV2.id'
FIELD_ID: "PVTSSF_lADOACGfts4AVFPozgU4CJs" # gh project field-list 44 --owner ministryofjustice --format json | jq -r '.fields[] | select(.name=="Issue Type") .id'

jobs:
update-github-projects-issue-type:
runs-on: ubuntu-latest
name: Update GitHub Projects Issue Type
steps:
- name: Check Labels
id: check_labels
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
github-token: ${{ secrets.OBSERVABILITY_PLATFORM_BOT_TOKEN }}
script: |
const issue = context.issue;
const labels = context.payload.issue.labels.map(label => label.name);
// fieldOptionId is the ID of the field option that corresponds to the issue type
// this can be obtained from the GitHub API by running
// gh project field-list 44 --owner ministryofjustice --format json | jq -r '.fields[] | select(.name=="Type") .options'
let type;
if (labels.includes("bug")) {
type = "bug";
fieldOptionId = "911c9508";
} else if (labels.includes("epic")) {
type = "epic";
fieldOptionId = "ae8af2c4";
} else if (labels.includes("feature-request")) {
type = "feature-request";
fieldOptionId = "92b9573d";
} else if (labels.includes("story")) {
type = "story";
fieldOptionId = "9d14e00a";
} else if (labels.includes("spike")) {
type = "spike";
fieldOptionId = "2baf6f13";
}
if (type) {
console.log(`Issue is a ${type}`);
return fieldOptionId;
} else {
console.log("Issue is not a bug, epic, feature-request, or story");
return null;
}
- name: Add to GitHub Project # Even though GitHub Project automation can do this, we need to do it again to get the item ID
id: add_to_project
env:
GITHUB_TOKEN: ${{ secrets.OBSERVABILITY_PLATFORM_BOT_TOKEN }}
uses: octokit/graphql-action@8ad880e4d437783ea2ab17010324de1075228110 # v2.3.2
with:
query: |
mutation AddIssueToProject($project_id: ID!, $content_id: ID!) {
addProjectV2ItemById(input: { projectId: $project_id, contentId: $content_id }) {
item {
id
}
}
}
variables: |
project_id: ${{ env.PROJECT_ID }}
content_id: ${{ github.event.issue.node_id }}
- name: Update Issue Type
id: update_issue_type
if: steps.check_labels.outputs.result != null
env:
GITHUB_TOKEN: ${{ secrets.OBSERVABILITY_PLATFORM_BOT_TOKEN }}
uses: octokit/graphql-action@8ad880e4d437783ea2ab17010324de1075228110 # v2.3.2
with:
query: |
mutation UpdateIssueType($item_id: ID!, $project_id: ID!, $field_id: ID!, $field_option_id: String) {
updateProjectV2ItemFieldValue(
input: { itemId: $item_id, projectId: $project_id, fieldId: $field_id, value: { singleSelectOptionId: $field_option_id } }) {
clientMutationId
}
}
variables: |
item_id: ${{ fromJSON(steps.add_to_project.outputs.data).addProjectV2ItemById.item.id }}
project_id: ${{ env.PROJECT_ID }}
field_id: ${{ env.FIELD_ID }}
field_option_id: ${{ steps.check_labels.outputs.result }}
2 changes: 1 addition & 1 deletion .github/workflows/openssf-scorecard.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: OpenSSF Scorecard
name: 🛡️ OpenSSF Scorecard

on:
branch_protection_rule:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Build and Publish
name: 🚀 Publish

on:
push:
Expand All @@ -17,7 +17,7 @@ jobs:
name: Build
runs-on: ubuntu-latest
container:
image: docker.io/ministryofjustice/tech-docs-github-pages-publisher@sha256:cd3513beca3fcaf5dd34cbe81a33b3ff30337d8ada5869b40a6454c21d6f7684 # v4.0.0
image: ghcr.io/ministryofjustice/tech-docs-github-pages-publisher@sha256:35699473dbeefeeb8b597de024125a241277ee03587d5fe8e72545e4b27b33f8 # v5.0.0
permissions:
contents: read
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/super-linter.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Super-Linter
name: 🦝 Super-Linter

on:
pull_request:
Expand Down Expand Up @@ -32,5 +32,5 @@ jobs:
uses: super-linter/super-linter/slim@b92721f792f381cedc002ecdbb9847a15ece5bb8 # v7.1.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEFAULT_BRANCH: main
VALIDATE_CSS: false
VALIDATE_JSCPD: false
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Build and Test
name: 🧪 Test

on:
pull_request:
Expand All @@ -13,7 +13,7 @@ jobs:
name: Build
runs-on: ubuntu-latest
container:
image: docker.io/ministryofjustice/tech-docs-github-pages-publisher@sha256:cd3513beca3fcaf5dd34cbe81a33b3ff30337d8ada5869b40a6454c21d6f7684 # v4.0.0
image: ghcr.io/ministryofjustice/tech-docs-github-pages-publisher@sha256:35699473dbeefeeb8b597de024125a241277ee03587d5fe8e72545e4b27b33f8 # v5.0.0
permissions:
contents: read
steps:
Expand All @@ -26,8 +26,8 @@ jobs:
run: |
/usr/local/bin/package
test:
name: Test
link-checker:
name: Link Checker
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down
21 changes: 21 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.PHONY: package preview

IMAGE_NAME ?= ghcr.io/ministryofjustice/tech-docs-github-pages-publisher
IMAGE_SHA ?= sha256:35699473dbeefeeb8b597de024125a241277ee03587d5fe8e72545e4b27b33f8

package:
docker run --rm \
--name tech-docs-github-pages-publisher \
--volume $(PWD)/config:/tech-docs-github-pages-publisher/config \
--volume $(PWD)/source:/tech-docs-github-pages-publisher/source \
$(IMAGE_NAME)@$(IMAGE_SHA) \
/usr/local/bin/package

preview:
docker run -it --rm \
--name tech-docs-github-pages-publisher-preview \
--volume $(PWD)/config:/tech-docs-github-pages-publisher/config \
--volume $(PWD)/source:/tech-docs-github-pages-publisher/source \
--publish 4567:4567 \
$(IMAGE_NAME)@$(IMAGE_SHA) \
/usr/local/bin/preview
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

[![repo standards badge](https://img.shields.io/endpoint?labelColor=231f20&color=005ea5&style=for-the-badge&label=MoJ%20Compliant&url=https%3A%2F%2Foperations-engineering-reports.cloud-platform.service.justice.gov.uk%2Fapi%2Fv1%2Fcompliant_public_repositories%2Fendpoint%2Fobservability-platform&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAABmJLR0QA/wD/AP+gvaeTAAAHJElEQVRYhe2YeYyW1RWHnzuMCzCIglBQlhSV2gICKlHiUhVBEAsxGqmVxCUUIV1i61YxadEoal1SWttUaKJNWrQUsRRc6tLGNlCXWGyoUkCJ4uCCSCOiwlTm6R/nfPjyMeDY8lfjSSZz3/fee87vnnPu75z3g8/kM2mfqMPVH6mf35t6G/ZgcJ/836Gdug4FjgO67UFn70+FDmjcw9xZaiegWX29lLLmE3QV4Glg8x7WbFfHlFIebS/ANj2o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KA30IPoH7cQXdArwCOllFX/i53P5P9a/gNkKpsCMFRuFAAAAABJRU5ErkJggg==)](https://operations-engineering-reports.cloud-platform.service.justice.gov.uk/public-report/observability-platform)

[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/ministryofjustice/observability-platform)

> [!IMPORTANT]
> The service is currently in discovery phase and subject to change.
> The service is currently in discovery and subject to change.
## About this repository

Expand All @@ -14,10 +16,10 @@ This is the Ministry of Justice Observability Platform team's repository for doc
To add an ADR call the `create-adr.sh` script and respond to the queries:

```bash
./scripts/create-adr.sh
bash scripts/create-adr.sh
```

## Other Observability Platform repositories
## Other Observability Platform Repositories

| Name | Description |
|:---:|:---:|
Expand Down
2 changes: 1 addition & 1 deletion config/tech-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ header_links:
host: https://observability-platform.service.justice.gov.uk
max_toc_heading_level: 3
owner_slack_workspace: mojdt
phase: internal
phase: INTERNAL
prevent_indexing: true
service_link: /
service_name: Observability Platform
Expand Down
4 changes: 2 additions & 2 deletions scripts/create-adr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Directories
scripts_dir="$(dirname "$0")"
adr_directory="${scripts_dir}/../source/documentation/architecture-decision-records"
adr_directory="${scripts_dir}/../source/architecture-decision-records"

# Ensure the ADR directory exists
if [ ! -d "$adr_directory" ]; then
Expand Down Expand Up @@ -55,7 +55,7 @@ echo "$modified_content" >"$filename"
echo "Template created: $filename"

# Construct the new line for the ADR log
new_adr_log_entry="| [${formatted_next_adr_number}](/documentation/architecture-decision-records/${formatted_next_adr_number}-${slugified_title}.html) | ${adr_title} | 🤔 Proposed |"
new_adr_log_entry="| [${formatted_next_adr_number}](/architecture-decision-records/${formatted_next_adr_number}-${slugified_title}.html) | ${adr_title} | 🤔 Proposed |"

# File path for the ADR log index
adr_log_index="${adr_directory}/index.html.md.erb"
Expand Down
27 changes: 0 additions & 27 deletions scripts/local.sh

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
---
title: Architecture Decision Records
last_reviewed_on: 2024-04-04
last_reviewed_on: 2024-11-04
review_in: 3 months
weight: 0
---
# <%= current_page.data.title %>

This is our architecture decision log, made during the design and build of the Observability Platform.

## Log
| ADR | Name | Status |
|:--------------------------------------------------------------------------------------------:|:-----------------------------:|:-----------:|
| [0001](/documentation/architecture-decision-records/0001-record-architecture-decisions.html) | Record Architecture Decisions | ✅ Accepted |
| [0002](/documentation/architecture-decision-records/0002-use-amazon-managed-grafana.html) | Use Amazon Managed Grafana | 🤔 Proposed |
| [0003](/documentation/architecture-decision-records/0003-use-modernisation-platform.html) | Use Modernisation Platform | 🤔 Proposed |
| [0001](/architecture-decision-records/0001-record-architecture-decisions.html) | Record Architecture Decisions | ✅ Accepted |
| [0002](/architecture-decision-records/0002-use-amazon-managed-grafana.html) | Use Amazon Managed Grafana | 🤔 Proposed |
| [0003](/architecture-decision-records/0003-use-modernisation-platform.html) | Use Modernisation Platform | 🤔 Proposed |

## Statuses
- ✅ Accepted
Expand Down
38 changes: 38 additions & 0 deletions source/architecture/index.html.md.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
title: Architecture
last_reviewed_on: 2024-11-04
review_in: 3 months
weight: 0
---

# <%= current_page.data.title %>

At its core, the Observability Platform is [Amazon Managed Grafana](https://aws.amazon.com/grafana/), which offers a fully managed, single pane of glass view of onboarded accounts' [Amazon CloudWatch](https://aws.amazon.com/cloudwatch/), as well as other SaaS services that offer integration, such as GitHub or Sentry.

Additionally, the Observability Platform also offers:

- Integration with [Amazon Managed Service for Prometheus](https://aws.amazon.com/prometheus/)

- Integration with [AWS X-Ray](https://aws.amazon.com/xray/)

- Alerting with PagerDuty and Slack

## High Level Diagram

![Observability Platform](./src/architecture.svg)

## Environments

The Observability Platform has two environments:

- `development`

- `production` (also known as `alpha`)

The `development` environment is used for platform development and testing.

The `alpha` environment is where all the Observability Platform tenants are onboarded.

## Deployment

Observability Platform is deployed to the [Modernisation Platform](https://user-guide.modernisation-platform.service.justice.gov.uk/), and the source is available [here](https://github.com/ministryofjustice/modernisation-platform-environments/tree/main/terraform/environments/observability-platform).
File renamed without changes
38 changes: 0 additions & 38 deletions source/documentation/platform-architecture/index.html.md.erb

This file was deleted.

Loading

0 comments on commit f668866

Please sign in to comment.