Skip to content

Commit

Permalink
feat: Release V2.1.0 (#243)
Browse files Browse the repository at this point in the history
* chore(deps-dev): bump typescript from 5.4.5 to 5.6.2

Bumps [typescript](https://github.com/microsoft/TypeScript) from 5.4.5 to 5.6.2.
- [Release notes](https://github.com/microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](microsoft/TypeScript@v5.4.5...v5.6.2)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

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

* feat: validate variables

* test: update lib

* test: mock libs

* test: mock libs

* fix: reuse dbconfig type

* fix: update test import paths

* build: update lib

* refactor: apply cache option environment variable split

* refactor: encapsulated the environment variables

* test: refactored units to accommodate encapsulation of environment variables

* refactor: update package lock file

* refactor: fix typo

* refactor: bump tazama libraries

* refactor: remove unused mocks

* refactor: bump lib version

* feat: updated Version of libraries to support multi-currency

* test(env): singular jest instance

* build: update libs (#241)

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

* ci: sync workflows from central-workflows (#242)

* ci: sync workflows from central-workflows Signed-off-by: Scott <[email protected]>

* ci: sync workflows from central-workflows Signed-off-by: Scott <[email protected]>

* ci: sync workflows from central-workflows Signed-off-by: Scott <[email protected]>

---------

Co-authored-by: github-actions <[email protected]>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: rtkay123 <[email protected]>
Co-authored-by: rtkay123 <[email protected]>
Co-authored-by: Justus Ortlepp <[email protected]>
Co-authored-by: cshezi <[email protected]>
Co-authored-by: Cebolenkosi Shezi <[email protected]>
Co-authored-by: Jean-Pierre <[email protected]>
Co-authored-by: Jean-Pierre Nell <[email protected]>
Co-authored-by: github-actions <[email protected]>
  • Loading branch information
10 people authored Dec 3, 2024
1 parent ed374c6 commit fc69bc7
Show file tree
Hide file tree
Showing 24 changed files with 1,624 additions and 1,341 deletions.
28 changes: 16 additions & 12 deletions .env.template
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
# SPDX-License-Identifier: Apache-2.0
FUNCTION_NAME="event-director"
NODE_ENV="dev"
REST_PORT=3000
CACHETTL=300
MAX_CPU=

LOGSTASH_HOST=my-release-logstash.frm-meshed
LOGSTASH_PORT=8080
LOGSTASH_LEVEL='info'

DATABASE_URL=http://0.0.0.0:8529
DATABASE_NAME=configuration
DATABASE_USER=root
DATABASE_PASSWORD=
DATABASE_CERT_PATH=
# DATABASE
CONFIGURATION_DATABASE_URL=http://0.0.0.0:8529
CONFIGURATION_DATABASE=configuration
CONFIGURATION_DATABASE_USER=root
CONFIGURATION_DATABASE_PASSWORD=
CONFIGURATION_DATABASE_CERT_PATH=

# REDIS
REDIS_DB=0
REDIS_DATABASE=0
REDIS_AUTH="exampleAuth"
REDIS_SERVERS='[{"host":"127.0.0.1", "port":6379}, {"host":"127.0.0.1", "port":6380}]'
REDIS_IS_CLUSTER=false
DISTRIBUTED_CACHETTL=300
DISTRIBUTED_CACHE_ENABLED=true

# Nats config
# NODE CACHE
LOCAL_CACHETTL=300
LOCAL_CACHE_ENABLED=true

# NATS
SERVER_URL=0.0.0.0:4222
STARTUP_TYPE=nats
PRODUCER_STREAM=RuleRequest
Expand All @@ -35,5 +37,7 @@ PRODUCER_RETENTION_POLICY=Workqueue
APM_ACTIVE=true
APM_URL=127.0.0.1:4857
APM_SECRET_TOKEN=secrettokenhere
APM_SERVICE_NAME=event-director

SIDECAR_HOST=
LOGSTASH_LEVEL='info'
11 changes: 7 additions & 4 deletions .github/workflows/codacy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@
# For more information on Codacy Analysis CLI in general, see
# https://github.com/codacy/codacy-analysis-cli.

# Please do not attempt to edit this flow without the direct consent from the DevOps team. This file is managed centrally.

name: Codacy Security Scan

on:
push:
branches: [ "main" ]
branches: [ "dev", "main" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main" ]
branches: [ "dev", "main" ]
schedule:
- cron: '17 0 * * 4'

Expand All @@ -29,6 +31,7 @@ permissions:

jobs:
codacy-security-scan:
if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
permissions:
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
Expand All @@ -42,7 +45,7 @@ jobs:

# Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis
- name: Run Codacy Analysis CLI
uses: codacy/codacy-analysis-cli-action@d840f886c4bd4edc059706d09c6a1586111c540b
uses: codacy/codacy-analysis-cli-action@3ff8e64eb4b714c4bee91b7b4eea31c6fc2c4f93
with:
# Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository
# You can also omit the token and run the tools that support default configurations
Expand All @@ -58,6 +61,6 @@ jobs:

# Upload the SARIF file generated in the previous step
- name: Upload SARIF results file
uses: github/codeql-action/upload-sarif@v2
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif
14 changes: 9 additions & 5 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,23 @@
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#

# Please do not attempt to edit this flow without the direct consent from the DevOps team. This file is managed centrally.

name: "CodeQL"

on:
push:
branches: [ "main" ]
branches: [ "dev", "main" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main" ]
branches: [ "dev", "main" ]
schedule:
- cron: '34 0 * * 4'

jobs:
analyze:
if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
name: Analyze
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
permissions:
Expand All @@ -46,7 +50,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -60,7 +64,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
Expand All @@ -73,6 +77,6 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
3 changes: 3 additions & 0 deletions .github/workflows/conventional-commits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

# This GitHub Actions workflow validates the title of pull requests (PRs) to ensure they follow conventional commit standards.

# Please do not attempt to edit this flow without the direct consent from the DevOps team. This file is managed centrally.

name: PR Conventional Commit Validation

on:
Expand All @@ -16,6 +18,7 @@ on:

jobs:
validate-pr-title:
if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
runs-on: ubuntu-latest # Use the latest Ubuntu runner for the job
steps:
- name: Checkout code
Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/dco-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# SPDX-License-Identifier: Apache-2.0

# This GitHub Actions workflow checks that all commits in a pull request (PR) have a "Signed-off-by" line to ensure Developer Certificate of Origin (DCO) compliance.

# Please do not attempt to edit this flow without the direct consent from the DevOps team. This file is managed centrally.

name: DCO

# Trigger the workflow on pull request events
on: [pull_request]

jobs:
dco:
if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
# Define the runner environment
runs-on: ubuntu-latest

steps:
# Step to check out the repository
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches to ensure complete commit history is available

- name: Set up environment variables
run: |
echo "BASE_BRANCH=${{ github.event.pull_request.base.ref }}" >> $GITHUB_ENV
echo "HEAD_BRANCH=${{ github.event.pull_request.head.ref }}" >> $GITHUB_ENV
# Step to check each commit in the pull request for a Signed-off-by line
- name: Check for DCO Sign-off
run: |
# Get the base branch and head branch of the pull request
base_branch=$BASE_BRANCH
head_branch=$HEAD_BRANCH
# Get the list of commit hashes between the head branch and base branch
commits=$(git log --pretty=format:%H origin/${head_branch}..origin/${base_branch})
non_compliant_commits=""
# Loop through each commit and check for the Signed-off-by line
for commit in $commits; do
# Check if the commit message contains the Signed-off-by line
if ! git show --quiet --format=%B $commit | grep -q "^Signed-off-by: "; then
# If not, add the commit hash to the list of non-compliant commits
non_compliant_commits="$non_compliant_commits $commit"
fi
done
# If there are any non-compliant commits, output their hashes and fail the job
if [ -n "$non_compliant_commits" ]; then
echo "The following commits do not have a Signed-off-by line:"
for commit in $non_compliant_commits; do
echo "- $commit"
done
exit 1
fi
shell: bash
6 changes: 5 additions & 1 deletion .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
#
# Source repository: https://github.com/actions/dependency-review-action
# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement


# Please do not attempt to edit this flow without the direct consent from the DevOps team. This file is managed centrally.

name: 'Dependency Review'
on: [pull_request]

Expand All @@ -19,4 +23,4 @@ jobs:
- name: 'Checkout Repository'
uses: actions/checkout@v4
- name: 'Dependency Review'
uses: actions/dependency-review-action@v3
uses: actions/dependency-review-action@v4
52 changes: 52 additions & 0 deletions .github/workflows/dockerfile-linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# SPDX-License-Identifier: Apache-2.0

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# hadoint is a Dockerfile linter written in Haskell
# that helps you build best practice Docker images.
# More details at https://github.com/hadolint/hadolint

# Please do not attempt to edit this flow without the direct consent from the DevOps team. This file is managed centrally.

name: Hadolint

on:
push:
branches: [ "dev", "main" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "dev" ]
schedule:
- cron: '17 13 * * 0'

permissions:
contents: read

jobs:
hadolint:
if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
name: Run hadolint scanning
runs-on: ubuntu-latest
permissions:
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Run hadolint
uses: hadolint/hadolint-action@f988afea3da57ee48710a9795b6bb677cc901183
with:
dockerfile: ./Dockerfile
format: sarif
output-file: hadolint-results.sarif
no-fail: true

- name: Upload analysis results to GitHub
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: hadolint-results.sarif
wait-for-processing: true
78 changes: 78 additions & 0 deletions .github/workflows/dockerhub-image-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# SPDX-License-Identifier: Apache-2.0

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.

# Please do not attempt to edit this flow without the direct consent from the DevOps team. This file is managed centrally.

name: Publish Docker image

on:
push:
branches: [ "main" ]

jobs:
push_to_registry:
if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
attestations: write
id-token: write
steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Set ENV variables
run: |
echo "REPO_NAME=${GITHUB_REPOSITORY#$GITHUB_REPOSITORY_OWNER/}" >> $GITHUB_ENV
- name: Use the custom ENV variable
run: |
echo $REPO_NAME
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: tazamaorg/${{ env.REPO_NAME }}
tags: |
type=raw,value=2.1.0
- name: Build and push Docker image
id: push
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: GH_TOKEN=${{ secrets.GH_TOKEN }}

- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-name: docker.io/tazamaorg/${{ env.REPO_NAME }}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: false

- name: Send Slack Notification
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
run: |
curl -X POST -H 'Content-type: application/json' --data '{"blocks": [{"type": "header","text": {"type": "plain_text","text": "New Dockerhub Image published :ship::ship:","emoji": true}},{"type": "section","fields": [{"type": "mrkdwn","text": "*Service:*\n${{ env.REPO_NAME }} "},{"type": "mrkdwn","text": "*Tazama Dockerhub:*\n<https://hub.docker.com/orgs/tazamaorg/repositories>"}]}]}' $SLACK_WEBHOOK_URL
Loading

0 comments on commit fc69bc7

Please sign in to comment.