Skip to content

Commit

Permalink
update forked (#31)
Browse files Browse the repository at this point in the history
* fix: fixed typo for aws sqs (HO-CTO#196)

* feat: added sli value libraries for nginx generic approach (HO-CTO#201)

* feat: added sli value libraries for nginx generic approach

* feat: added generic mixin and new code that substitutes environment for .* regex in sli value when environment is generic

* fix: added selectors to metric

* fix: added gitkeep to output directory and updated gitignore (HO-CTO#204)

* 198 create promtool image (HO-CTO#199)

* feat: add promtool Dockerfile and promtool workflow

* github action

* Delete .dccache

* refactor: update library in dockerfile and rename workflow

* refactor: tag image with latest promtool version

Co-authored-by: Mahruf Iqbal <[email protected]>

* feat: run automation test by run mixin and validate the rules file vi… (HO-CTO#192)

* feat: run automation test by run mixin and validate the rules file via promtool

* refactor: add testing mixin

* refactor: added sre-promtool image reference to the promtool check step

* refactor: add sre-promtool docker image reference to the promtool check step

* feat: added new contributing.md file (HO-CTO#186)

* feat: added new contributing.md file which describes the file and objects which will be used by contributors

* docs: expanded the basic contribution information

* docs: added contribution guide for metric-types.libsonnet

* docs: added section on adding new SLI value libraries

* docs: added section on adding new detail dashboard elements

* docs: making changes for pr comments

* docs: adding section on alert payload

* 202 update all sli value libraries and alerts for generic poc (HO-CTO#205)

* feat: updated all sli values and burn rate rules to work for generic approach

* docs: added comment explaining weird recording rule syntax

* refactor: all recording rules now expose consistent set of dynamic labels

* feat: generic dashboards now work

* fix: added ~ to regex selectors and multi choice to environment and product templates

* fix: added missing ~

* feat: add additional slis to generic mixin

Co-authored-by: Michael Pearson <[email protected]>

* 206 update summary dashboard (HO-CTO#207)

* fix: updated summary dashboard

* fix: added new sli types

* fix: updated summary dashboard

* fix: added new sli types

* feat: added multichoice to environment template

* fix: combine snyk container scans into one stage (HO-CTO#211)

* 185 document monitoring as code features (HO-CTO#214)

* feat: add structure for features content

* feat: add feature documententation

* fix: update get-started global config docs

* feat: add Hadolint Dockerfile linting tool (HO-CTO#219)

* bug: update snyk docker action to snyk cli (HO-CTO#241)

* chore(deps): Bump actions/setup-node from 2 to 3 (HO-CTO#242)

Bumps [actions/setup-node](https://github.com/actions/setup-node) from 2 to 3.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](actions/setup-node@v2...v3)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): Bump golang in /monitoring-as-code (HO-CTO#216)

Bumps golang from 1.19.0-alpine3.16 to 1.19.1-alpine3.16.

---
updated-dependencies:
- dependency-name: golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* 202 journey view redesign (HO-CTO#224) (HO-CTO#230)

* 202 journey view redesign (HO-CTO#224)

* feat: sliTypes are grouped under one sli for journey view

* Show all SLI types combined under each SLI row

* Fix title of panel row

* Fix titles and refactor the code.

* Fix comments in code.

* Nothing to see here

Co-authored-by: Samiwel Thomas <[email protected]>
Co-authored-by: samiwelthomasHO <[email protected]>

* refactor: amend title of journey stat panel

Co-authored-by: arifulhaqueHO <[email protected]>
Co-authored-by: Samiwel Thomas <[email protected]>
Co-authored-by: samiwelthomasHO <[email protected]>
Co-authored-by: Michael Pearson <[email protected]>

* feat: Product View Redesign

Fixes HO-CTO#213

* Add jsonnetfmt check into pipeline. (HO-CTO#228) (HO-CTO#234)

* Add jsonnetfmt check into pipeline. (HO-CTO#228)

* Add jsonnetfmt check into pipeline.

* Use the go-jsonnet version of jsonnetfmt and jsonnet.

* Fix issue with path

Co-authored-by: Samiwel Thomas <[email protected]>

* Use go version of Jsonnet fmt (HO-CTO#235)

* Add jsonnetfmt check into pipeline.

* Use the go-jsonnet version of jsonnetfmt and jsonnet.

* Fix issue with path

Co-authored-by: Samiwel Thomas <[email protected]>

* Format Files

Co-authored-by: arifulhaqueHO <[email protected]>
Co-authored-by: Samiwel Thomas <[email protected]>
Co-authored-by: Ariful Haque <[email protected]>

* 229 jsonnet lint (HO-CTO#236) (HO-CTO#248)

* 229 jsonnet lint (HO-CTO#236)

* Add linter check to Github workflow.

* Fix empty import issue

* Remove unused variable.

* Remove unused variable.

* Update docker-build-branch.yml

* Update detail-dashboard-elements-template.libsonnet

* Update sli-value-library-template.libsonnet

* Update sli-value-library-template.libsonnet

* Update sli-value-library-template.libsonnet

Co-authored-by: Samiwel Thomas <[email protected]>

* Removes combined sli list as its no longer used

* Super Step of installing jsonnet and tools

* Fix .yml file

* Update docker-build-branch.yml

Co-authored-by: arifulhaqueHO <[email protected]>
Co-authored-by: Samiwel Thomas <[email protected]>
Co-authored-by: Ariful Haque <[email protected]>

* 244 summary view redesign fired alerts (HO-CTO#245)

* refractor: add alert metric to summary view update after review

* refractor: add alert metric to summary view update after review

* refractor: formatted using go version of jsonnetfmt and jsonnet-lint

* refractor: changed to be based on style guide

* feat: Add debug utility function (HO-CTO#225) (HO-CTO#232)

Fixes HO-CTO#221 

* Add debug utility function (HO-CTO#225)

* Add debug utility

* Add some documentation into contributing.md

* Fix formatting issue.

Co-authored-by: samiwelthomasHO <[email protected]>
Co-authored-by: Samiwel Thomas <[email protected]>

* fix: correct git clone repo url (HO-CTO#251)

* fix: correct git clone repo url

* Update readme with correct git url

Co-authored-by: arifulhaqueHO <[email protected]>

* Fix: Update gemfile with haml ver 5.x to fix deploy-docs (HO-CTO#247)

Resolves HO-CTO#246

* 252 containerising jsonnet tools (HO-CTO#253)

* Create workflow and Docker Container

* Add sh files

* feat: add product view navigation to summary screen (HO-CTO#259)

* feat: add product view navigation to summary screen

* feat: add product view navigation changed from breadcrumb to dropdown list

* refactor: update workflow to use jsonnet fmt/lint container image (HO-CTO#263)

* refactor: update workflow to use jsonnet fmt/lint container image

* refactor: add fmt/lint version

* 264 freshness sli value denominator using wrong function (HO-CTO#265)

* bug: Changed Sum by to count by

* bug: also changed sum to count in prometheus for consistency

* bug: rename stanza to journey1 in testing mixin (HO-CTO#261)

* bug: rename stanza to journey1 in testing mixin

* refactor: add error handling to avoid naming journey testing or test

* refactor: update the logic to compare product and journey name

* refactor: update error message

* add read latency sli for rds (HO-CTO#256)

* feat: aws rds latency

* feat: aws rds latency - read

* feat: aws rds latency - read

* feat: aws rds latency - read and write

* feat: aws rds latency - read and write

* feat: aws rds latency - read and write

* feat: s latency - read and write

* feat: aws rds latency - read and write

* feat: aws rds latency - read and write added graph

* feat: aws rds latency -avg  added graph

* feat: aws rds latency -avg  added graph - tidyup

* feat: aws rds latency -avg  added graph - tidyup sum to count

* feat: aws rds latency -avg  added graph - tidyup sum to count

* feat: aws rds latency - fix to NaN avaerage when NaN is scraped into promethesus

* feat: modify sli for opensearch availability and latency (HO-CTO#271)

* feat: modify sli for opensearch availability and latency

* refactor: update aws_es sli mixin def to include latencyTarget

* refactor: update testing mixin

* Add docs for run fmt and lint on save. (HO-CTO#269)

* Add docs for run fmt and lint on save.

* Add fmt and lint pre-commit hook

* Add some docs to the contributing guide.

* Revert change.

* Add .vscode to gitignore

Co-authored-by: Ariful Haque <[email protected]>

* feat: add environment grouping to table panels (HO-CTO#275)

* feat: add environment grouping to table panels

* refactor: apply jsonnet fmt changes

* Add support for custom metrics via config (HO-CTO#267)

* Add custom metrics

* Removing changes that are no longer required.

* Add some initial documentation about adding custom metric types.

* Fix formatting issue.

* Ensure custom metric types supplied at runtime.

* Fix formatting.

* Fix typo.

* chore(deps): Bump golang in /monitoring-as-code (HO-CTO#277)

Bumps golang from 1.19.1-alpine3.16 to 1.19.2-alpine3.16.

---
updated-dependencies:
- dependency-name: golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* 278 slitype refactoring to support distinct objects and consistent dominations 1 (HO-CTO#280)

* feat: add support for distinct sli type objects

* refactor: update subset of sli libraries to use counter seconds target

* refactor: update example mixin files to use distinct sli type objects

* refactor: update docs to reference new SLI schema

* bug: remove redundant latency percentile and target references

* refactor: correct old journey references

* 281 summary view redesign add traffic (HO-CTO#283)

* feat: Add traffic volume to summary view

* feat: Add traffic volume to summary view

* feat: Add traffic volume to summary view with unit locale for adding comma to number format

* feat: Add traffic volume to summary view with unit locale for adding comma to number format

* Add Java and NodeJS example apps into the repo (HO-CTO#286)

* Add Java example app into the repo.

* Add NodeJS example app into the repo.

* Document metrics exported by Java application.

* Document metrics exported by NodeJS application.

* Add hadolint into git pre-commit hooks (HO-CTO#273)

* Add docker lint pre-commit using hadolint

* Only lint dockerfiles that change in the commit.

* feat: add shellcheck into pre-commit tooling

Co-authored-by: Ariful Haque <[email protected]>

* fix: change config docs to documentation (HO-CTO#292)

* Release 1.4.0 (HO-CTO#290)

* Fix issue introduced by rebase.

* 1.4.0

* feat: update deploy docs workflow to use official github actions (HO-CTO#294)

* 293 spell checker for public facing docs (HO-CTO#295)

* Add spellchecking to pre commit hooks

* Add dictionary for spellchecker

* Update prehook with single file checking

* Update spellchecked readme files

* Add spell checker tool pipeline

* Change prehook to use ghcr image

* Change workflow and and readme.md

* Fix: git add bug (HO-CTO#300)

* Fix git add bug

* Amend fix

* Fix: yml file (HO-CTO#303)

* Fix: spellchecker yml file (HO-CTO#305)

* chore(deps): Bump docker/login-action from 2.0.0 to 2.1.0 (HO-CTO#307)

Bumps [docker/login-action](https://github.com/docker/login-action) from 2.0.0 to 2.1.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](docker/login-action@v2.0.0...v2.1.0)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat: Add docker compose configuration for example apps. (HO-CTO#309)

Can run the commands as such
docker-compose --profile nodejs up
docker-compose --profile java up

* refractor: Product view sli title (HO-CTO#299)

* refractor: Product view sli title

* refactor: Product view sli title and validation

* refactor: fix testing mixing char limit

* refactor: fix testing/monitor mixing char limit

* refactor: made sliTitleCharLimit a variable

* refactor: made sliTitleCharLimit a variable

* refactor: made sliTitleCharLimit a variable

* refactor: linter errors

* feat: update deploy docs workflow to use official github actions (HO-CTO#294)

* 293 spell checker for public facing docs (HO-CTO#295)

* Add spellchecking to pre commit hooks

* Add dictionary for spellchecker

* Update prehook with single file checking

* Update spellchecked readme files

* Add spell checker tool pipeline

* Change prehook to use ghcr image

* Change workflow and and readme.md

* Fix: git add bug (HO-CTO#300)

* Fix git add bug

* Amend fix

* Revert "Fix: git add bug (HO-CTO#300)"

This reverts commit a517ba8.

* Revert "Revert "Fix: git add bug (HO-CTO#300)""

This reverts commit 337c7ff.

* GOG remove

* refactor: generic mixing title length

* refractor: mixing def

Co-authored-by: Mike Pearson <[email protected]>
Co-authored-by: arifulhaqueHO <[email protected]>

* Add LocalStack integration with MaC (HO-CTO#306)

* Add inital docker compose file

* WIP

* Add inital docker compose file

* Initial documentation about LocalStack.

* Add some basic syntax highlighting.

* Make pre-commit hook executable.

* Update diagram.

* Update README.md

* Update README.md

* Update README.md

* Update diagram.

* Add static config to YACE.

* Add pre-requisite step for network creation.

Co-authored-by: Ariful Haque <[email protected]>

* Add trufflehog workflow to secret scan (HO-CTO#313)

* Add trufflehog workflow to secret scan

* Add pre-push git hook to scan code with trufflehog.

* Make pre-commit hook executable.

* Pin to version 3.14.0

Co-authored-by: Ariful Haque <[email protected]>

* Update git version in Docker image. (HO-CTO#319)

* Separate the example apps UI from their backend API (HO-CTO#312)

* Seperate ui from apis

* Update nodejs app to seperate ui

* Some cleanup of Node and Vue apps.

* Update the Java example app.

* Dockerise frontend app

* Consistent Functions

* Update readme to include docker compose file and other code consistency updates

* Update ports. F:4000 B:4001

* Refactor: ports and click method

Co-authored-by: samiwelthomasHO <[email protected]>

* Fix: Java json request

* Make the design a bit nicer.

* Add version and clean up UI

* Update README.md

* Update README.md

* Update README.md

Co-authored-by: Ariful Haque <[email protected]>
Co-authored-by: samiwelthomasHO <[email protected]>

* 315 dashboard titles (HO-CTO#316)

* feat: update dashboard titles, uids and filenames

* refactor: correct mac prefix

* refactor: update shell scripts based on new artefact prefixes

* docs: spelling corrections

* refactor: add new words to dictionary

* docs: correct useage heading

* docs: correct installation headings

* fix: add mixin var to dashboard for loop

* refactor: add sre mac prefix to dashboard uris and alert names

* Add LocalStack integration with MaC (HO-CTO#306)

* Add inital docker compose file

* WIP

* Add inital docker compose file

* Initial documentation about LocalStack.

* Add some basic syntax highlighting.

* Make pre-commit hook executable.

* Update diagram.

* Update README.md

* Update README.md

* Update README.md

* Update diagram.

* Add static config to YACE.

* Add pre-requisite step for network creation.

Co-authored-by: Ariful Haque <[email protected]>

* Add trufflehog workflow to secret scan (HO-CTO#313)

* Add trufflehog workflow to secret scan

* Add pre-push git hook to scan code with trufflehog.

* Make pre-commit hook executable.

* Pin to version 3.14.0

Co-authored-by: Ariful Haque <[email protected]>

* Update git version in Docker image. (HO-CTO#319)

* fix: correct product dashboard uri

Co-authored-by: samiwelthomasHO <[email protected]>
Co-authored-by: Ariful Haque <[email protected]>

* 274 add metric types label (HO-CTO#323)

* feat: filter by metric type in view

* fix: yace sqs localstack

* fix: yace sqs localstack

* 326 generic product view template filtering (HO-CTO#327)

* fix: generic view product page filtering

* fix: generic view product page filtering on product by metricType

* Add workflow dispatch trigger (HO-CTO#321)

* Fix issues with YACE configuration (HO-CTO#325)

* Fixing issues with YACE configuration.

* Removing dimensions config.

* refactor: update workflow into different jobs (HO-CTO#329)

* chore(deps): Bump trufflesecurity/trufflehog from 3.14.0 to 3.15.0 (HO-CTO#332)

Bumps [trufflesecurity/trufflehog](https://github.com/trufflesecurity/trufflehog) from 3.14.0 to 3.15.0.
- [Release notes](https://github.com/trufflesecurity/trufflehog/releases)
- [Changelog](https://github.com/trufflesecurity/trufflehog/blob/main/.goreleaser.yml)
- [Commits](trufflesecurity/trufflehog@v3.14.0...v3.15.0)

---
updated-dependencies:
- dependency-name: trufflesecurity/trufflehog
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Remove platform specific references. (HO-CTO#334)

* Remove platform specific references.

* Rename platform-templates file.

* Rename platform config.

* 335 improve mixin metric type docs (HO-CTO#338)

* Added documentation about supported sli types.

* Adding links to getting started docs

* Start of custom metrics documentation

* Add documentation for the metric type fields.

* Update docs with better order of information

Co-authored-by: Samiwel Thomas <[email protected]>

* chore(deps): Bump trufflesecurity/trufflehog from 3.15.0 to 3.15.1 (HO-CTO#337)

Bumps [trufflesecurity/trufflehog](https://github.com/trufflesecurity/trufflehog) from 3.15.0 to 3.15.1.
- [Release notes](https://github.com/trufflesecurity/trufflehog/releases)
- [Changelog](https://github.com/trufflesecurity/trufflehog/blob/main/.goreleaser.yml)
- [Commits](trufflesecurity/trufflehog@v3.15.0...v3.15.1)

---
updated-dependencies:
- dependency-name: trufflesecurity/trufflehog
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix: change traffic duration (HO-CTO#341)

* fix: change traffic duration

* fix: change traffic duration

* Add support for additional metric types in example apps. (HO-CTO#331)

Co-authored-by: samiwelthomasHO <[email protected]>
Co-authored-by: Ariful Haque <[email protected]>

* chore(deps): Bump trufflesecurity/trufflehog from 3.15.1 to 3.16.0 (HO-CTO#344)

Bumps [trufflesecurity/trufflehog](https://github.com/trufflesecurity/trufflehog) from 3.15.1 to 3.16.0.
- [Release notes](https://github.com/trufflesecurity/trufflehog/releases)
- [Changelog](https://github.com/trufflesecurity/trufflehog/blob/main/.goreleaser.yml)
- [Commits](trufflesecurity/trufflehog@v3.15.1...v3.16.0)

---
updated-dependencies:
- dependency-name: trufflesecurity/trufflehog
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* 345 change panel colour when there is no sli data (HO-CTO#347)

* fix: change traffic duration

* feat: change base/default colour to grey when no values

* feat: change base/default colour to grey when no values

* feat: change colour to red if =>0 and green if => sli_target

* feat: change colour to red below sli target , orange slit traget and green 2% above sli target

* feat: change colour to red 0, orange is sli_traget and green 2% above sli target

* feat: add-grafana-latency-and-sum-metrics and sli (HO-CTO#349)

* feat: add-grafana-latency-and-sum-metrics and sli

* feat: added latency sliType to testing sli

* Update Java example to support Gauge and Histogram metrics (HO-CTO#346)

* Implement counter API.

* Clean unused code.

* Fix gauge API.

* Get frontend working against Java app.

* Amend the NodeJS api to work with label maps.

* Fix some linting errors.

* Reformat code.

* Fix Dockerfile to use jdk17

* Change frontend to use npm run build and nginx as a web server

Co-authored-by: Ariful Haque <[email protected]>

* fix: grafana detail view latency (HO-CTO#352)

* chore(deps): Bump trufflesecurity/trufflehog from 3.16.0 to 3.16.1 (HO-CTO#353)

Bumps [trufflesecurity/trufflehog](https://github.com/trufflesecurity/trufflehog) from 3.16.0 to 3.16.1.
- [Release notes](https://github.com/trufflesecurity/trufflehog/releases)
- [Changelog](https://github.com/trufflesecurity/trufflehog/blob/main/.goreleaser.yml)
- [Commits](trufflesecurity/trufflehog@v3.16.0...v3.16.1)

---
updated-dependencies:
- dependency-name: trufflesecurity/trufflehog
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* refactor: update workflow into different jobs (HO-CTO#343)

* Remove references to queue_type. (HO-CTO#355)

* chore(deps): Bump golang in /monitoring-as-code (HO-CTO#360)

Bumps golang from 1.19.2-alpine3.16 to 1.19.3-alpine3.16.

---
updated-dependencies:
- dependency-name: golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): Bump trufflesecurity/trufflehog from 3.16.1 to 3.16.3 (HO-CTO#359)

* chore(deps): Bump trufflesecurity/trufflehog from 3.16.1 to 3.16.3

Bumps [trufflesecurity/trufflehog](https://github.com/trufflesecurity/trufflehog) from 3.16.1 to 3.16.3.
- [Release notes](https://github.com/trufflesecurity/trufflehog/releases)
- [Changelog](https://github.com/trufflesecurity/trufflehog/blob/main/.goreleaser.yml)
- [Commits](trufflesecurity/trufflehog@v3.16.1...v3.16.3)

---
updated-dependencies:
- dependency-name: trufflesecurity/trufflehog
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* Remove extra arg

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: arifulhaqueHO <[email protected]>

* feat: add new label to recording rules (HO-CTO#357)

* feat: add new label to recording rules

* refactor: jsonnet fmt update

* feat: add documentation panel to dashboards (HO-CTO#362)

* feat: add documentation panel to dashboards

* docs: update to variable comments

* 363 refresh dashboard design principles (HO-CTO#364)

* feat: add new word to dictionary

* refactor: dashboard design principles

* fix: add words to dictionary

* fix: add words to dictionary

* fix: reinstate responding to alerts pages

* fix: add words to dictionary

* fix: table issues

* Documentation: Change phase and header link (HO-CTO#366)

* Add health metric. (HO-CTO#368)

* 369 render diagrams (HO-CTO#370)

* feat: add render diagrams stage to deploy docs workflow

* feat: add path filter to deploy docs workflow

* docs: add diagram section to readme

* docs: add diagram docs as code example

* docs: remove duplicate word

* docs: switch links from branch to main

* Release 1.6.0 (HO-CTO#377)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: finlaymccormickHO <[email protected]>
Co-authored-by: Humayun Alam <[email protected]>
Co-authored-by: Mahruf Iqbal <[email protected]>
Co-authored-by: Michael Pearson <[email protected]>
Co-authored-by: Mike Pearson <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: arifulhaqueHO <[email protected]>
Co-authored-by: Samiwel Thomas <[email protected]>
Co-authored-by: samiwelthomasHO <[email protected]>
Co-authored-by: Ariful Haque <[email protected]>
Co-authored-by: samiwelthomasHO <[email protected]>
  • Loading branch information
12 people authored Nov 8, 2022
1 parent 6c3833d commit 7750cc1
Show file tree
Hide file tree
Showing 176 changed files with 13,917 additions and 1,266 deletions.
40 changes: 40 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash

set -e

JSONNET_FILES_CHANGED=$(git --no-pager diff --cached --name-only --diff-filter=ACM | grep "sonnet" | wc -l)
DOCKERFILE_CHANGED=$(git --no-pager diff --cached --name-only --diff-filter=ACM | grep "Dockerfile" | wc -l)
SHELL_FILE_CHANGED=$(git --no-pager diff --cached --name-only --diff-filter=ACM | grep -E ".sh$" | wc -l)
MD_FILES_CHANGED=$(git --no-pager diff --cached --name-only --diff-filter=ACM | grep -E ".md|.md.erb" | wc -l)

REPO_ROOT_DIR=$(git rev-parse --show-toplevel)

if [ "$JSONNET_FILES_CHANGED" -gt "0" ]; then
$REPO_ROOT_DIR/monitoring-as-code/fmt.sh
$REPO_ROOT_DIR/monitoring-as-code/lint.sh
git add $(git diff --name-only --cached)
fi

if [ "$DOCKERFILE_CHANGED" -gt "0" ]; then
dockerfiles_changed=$(git --no-pager diff --cached --name-only --diff-filter=ACM | grep "Dockerfile")
for dockerfile in $dockerfiles_changed
do
echo $dockerfile && docker run --rm -i ghcr.io/hadolint/hadolint < $dockerfile
done
fi

if [ "$SHELL_FILE_CHANGED" -gt "0" ]; then
shell_files=$(git --no-pager diff --cached --name-only --diff-filter=ACM | grep -E ".sh$")
for shell_file in $shell_files
do
echo $shell_file | xargs docker run --rm -v "$REPO_ROOT_DIR:/mnt" koalaman/shellcheck:stable
done
fi

if [ "$MD_FILES_CHANGED" -gt "0" ]; then
md_files_changed=$(git --no-pager diff --cached --name-only --diff-filter=ACM | grep -E ".md|.md.erb")
for md_file in $md_files_changed
do
echo $md_file | docker run --rm -v "$REPO_ROOT_DIR:/app/MaC" ghcr.io/ho-cto/sre-spellchecker spellchecker --files "MaC/$md_file"
done
fi
5 changes: 5 additions & 0 deletions .githooks/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

REPO_ROOT_DIR=$(git rev-parse --show-toplevel)

docker run --rm -v "$REPO_ROOT_DIR:/app" trufflesecurity/trufflehog:3.14.0 git file:///app --only-verified --no-update --fail
2 changes: 1 addition & 1 deletion .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ categories:
- 'test'
- 'refactor'
- 'style'
- 'docs'
- 'documentation'
- 'dependencies'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
Expand Down
64 changes: 54 additions & 10 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,78 @@ on:
push:
branches:
- main
paths:
- 'docs/**'

permissions:
contents: read
pages: write
deployments: write
id-token: write

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
deploy-docs:
render-diagrams:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Export drawio files to png files
uses: rlespinasse/[email protected]
with:
path: docs
format: png
transparent: true
output: source/images
- name: Upload artifact
uses: actions/[email protected]
with:
name: images
path: ./docs/source/images

build-docs:
runs-on: ubuntu-latest
concurrency: ci-${{ github.ref }}
permissions:
contents: write
needs: render-diagrams
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/docs/Gemfile

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Download images from render-diagrams
uses: actions/download-artifact@v3
with:
name: images
path: ./docs/source/images
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1
bundler-cache: true

- name: Build 'public' folder ready for deployment
working-directory: ./docs
run: bundle exec middleman build
- name: Publish
uses: actions/upload-pages-artifact@v1
with:
PATH: ./public

deploy:
runs-on: ubuntu-latest
needs: build-docs
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy
uses: JamesIves/[email protected]
uses: actions/deploy-pages@v1
id: deployment
with:
branch: docs
folder: public
TOKEN: ${{ secrets.GITHUB_TOKEN }}
149 changes: 101 additions & 48 deletions .github/workflows/docker-build-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,43 @@ on:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
REPO_NAME: ${{ github.event.repository.name }}
PROMTOOL_IMAGE_NAME: sre-promtool
PROMTOOL_VERSION: 2.38.0
USER: ho-cto

jobs:
publish:
name: 'Branch Publish'
permissions:
contents: read
packages: write
security-events: write
code-quality:
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'smoketest') == true
steps:
#Checks-out our repository under $GITHUB_WORKSPACE, so our workflow can access it.
- name: Checkout
uses: actions/checkout@v3

#Logs into Github registry
- name: Login to GitHub Container Registry
uses: docker/[email protected]
uses: actions/[email protected]
- name: Hadolint Dockerfile
uses: hadolint/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
dockerfile: ./monitoring-as-code/Dockerfile
- name: Jsonnet format check
run: sh ${{ github.workspace }}/monitoring-as-code/fmt.sh && git diff --exit-code --color
- name: Jsonnet lint check
run: sh ${{ github.workspace }}/monitoring-as-code/lint.sh

container-image-build:
needs: code-quality
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Calculate metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=${{ github.event.pull_request.head.sha }}
- name: Build container
uses: docker/build-push-action@v3
uses: docker/build-push-action@v3.2.0
with:
context: ./monitoring-as-code
file: ./monitoring-as-code/Dockerfile
Expand All @@ -49,46 +53,95 @@ jobs:
build-args: |
PACKAGE_TOKEN=${{secrets.GITHUB_TOKEN}}
MAC_VERSION='#${{ github.event.number }}'
outputs: type=docker,dest=/tmp/${{ env.REPO_NAME }}.tar
- name: Upload artifact
uses: actions/[email protected]
with:
name: ${{ env.REPO_NAME }}
path: /tmp/${{ env.REPO_NAME }}.tar

# Snyk security scan of Docker file only
- name: Run Snyk to check Docker file for vulnerabilities
id: snyk-dockerfile
continue-on-error: true
uses: snyk/actions/[email protected]
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
code-test:
needs: container-image-build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
- name: Download artifact
uses: actions/[email protected]
with:
image: ${{ steps.meta.outputs.tags }}
args: |
--file=./monitoring-as-code/Dockerfile
--severity-threshold=medium
--sarif-file-output=snyk.sarif
name: ${{ env.REPO_NAME }}
path: /tmp
- name: Load Docker image
run: |
docker load --input /tmp/${{ env.REPO_NAME }}.tar
echo "IMAGE_TAG=$(docker image ls --format '{{.Repository}}:{{.Tag}}' | grep sre-monitoring-as-code)" >> $GITHUB_ENV
- name: Run monitoring mixin
run: docker run -v ${{ github.workspace }}/monitoring-as-code:${{ github.workspace }}/data -t ${{ env.IMAGE_TAG }} -m monitoring -rd -i ${{ github.workspace }}/data/mixin-defs -o ${{ github.workspace }}/data/output
- name: Run testing mixin
run: docker run -v ${{ github.workspace }}/monitoring-as-code:${{ github.workspace }}/data -t ${{ env.IMAGE_TAG }} -m testing -rd -i ${{ github.workspace }}/data/mixin-defs -o ${{ github.workspace }}/data/output
- name: Run promtool checks
run: for FILE in ${{ github.workspace }}/monitoring-as-code/output/prometheus-rules/*-rules.yaml; do docker run -v ${{ github.workspace }}/monitoring-as-code:${{ github.workspace }}/data ${{env.REGISTRY}}/${{env.USER}}/${{env.PROMTOOL_IMAGE_NAME}}:${{env.PROMTOOL_VERSION}} check rules ${{ github.workspace }}/data/output/prometheus-rules/$(basename $FILE); if [ $? -ne 0 ]; then echo "Validation of rules files failed for $(basename $FILE) - exiting"; exit 1; fi done

container-image-test:
needs: container-image-build
permissions:
security-events: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
- name: Download artifact
uses: actions/[email protected]
with:
name: ${{ env.REPO_NAME }}
path: /tmp
- name: Load Docker image
run: |
docker load --input /tmp/${{ env.REPO_NAME }}.tar
echo "IMAGE_TAG=$(docker image ls --format '{{.Repository}}:{{.Tag}}' | grep sre-monitoring-as-code)" >> $GITHUB_ENV
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18.10.0
- name: Setup Snyk
run: |
npm install snyk -g
snyk auth ${{secrets.SNYK_TOKEN}}
- name: Snyk Container Scan
id: snyk-dockerfile
run: |
snyk container test --file=./monitoring-as-code/Dockerfile --sarif-file-output=snyk.sarif --app-vulns --severity-threshold=medium ${{ env.IMAGE_TAG }}
continue-on-error: true
- name: Upload result to GitHub Code Scanning
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: snyk.sarif

- name: Check on failures
if: steps.snyk-dockerfile.outcome != 'success'
run: exit 1

# Snyk security scan of Built Docker Image and unmanaged dependencies
- name: Run Snyk to check Docker image for vulnerabilities
id: snyk-image
continue-on-error: true
uses: snyk/actions/[email protected]
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
container-image-push:
needs: [code-test, container-image-test]
permissions:
packages: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
- name: Download artifact
uses: actions/[email protected]
with:
image: ${{ steps.meta.outputs.tags }}
args: |
--app-vulns
--severity-threshold=medium
- name: Check on failures
if: steps.snyk-image.outcome != 'success'
run: exit 1

name: ${{ env.REPO_NAME }}
path: /tmp
- name: Load Docker image
run: |
docker load --input /tmp/${{ env.REPO_NAME }}.tar
echo "IMAGE_TAG=$(docker image ls --format '{{.Repository}}:{{.Tag}}' | grep sre-monitoring-as-code)" >> $GITHUB_ENV
- name: Login to GitHub Container Registry
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push image to GitHub Container Registry
run: docker push ${{ steps.meta.outputs.tags }}
run: docker push ${{ env.IMAGE_TAG }}
Loading

0 comments on commit 7750cc1

Please sign in to comment.