Skip to content

Commit 6b7fb68

Browse files
sliedigmarcobuss
andcommitted
Unicorn approvals (#175)
* feat: add command to list the parameters in parameters store * refactor: renamed UnicornPropertiesNamespace to UnicornApprovalsNamespace in shared namespace definition * refactor: updated resolve:ssm references for UnicornPropertiesNamespace to UnicornApprovalsNamespace across multiple templates * refactor: rename unicorn properties to unicorn approvals * refactor: update event bus references from UnicornProperties to UnicornApprovals in subscriptions.yaml * refactor: update references from UnicornProperties to UnicornApprovals in dependabot configuration and unit test workflows * chore: upgrade actions/upload-artifact from v3 to v4 in GitHub workflow * fixed small issues * refactor: rename properties_service to approvals_service and update related handlers and configurations * chore: update Approvals readme * chore: updated contracts readme * chore: update web readme * chore: updated main readme * chore: upgrade actions/checkout and actions/github-script to v4 and v7 respectively in GitHub workflows * chore: update README to reflect new build workflow and correct image tag * chore: add GitHub Actions workflow for building Python services * chore: add ruff installation step to GitHub Actions build workflow * chore: modify GitHub Actions build workflow to use uv run for build and clean steps * chore: upgrade CodeQL action versions to v3 in GitHub workflows * chore: update cfn-lint installation step in GitHub Actions workflow to include serverless plugin * fix: allow cfn-lint command to continue on error in Makefile * some name changes to approvals. Moved example events to other folder for parity with TypeScript version and workshop description * fixing unint tests * downgrade cfn-lint serverless-rules because of an issue with v0.3.3 * Revert "downgrade cfn-lint serverless-rules because of an issue with v0.3.3" This reverts commit f383b3d. * chore: update architecture diagram * refactor: update event source and rule names to use 'unicorn.approvals' * refactor: renames ApprovalService to PublicationManagerService for handling publication approval requests and events * fix: remove error suppression for cfn-lint command. Removed uv build-system configuration for Approvals and Contracts * fix: update import path for request approval function to use PublicationManagerService * chore: minor update to readme file * chore: updated approvals readme * chore: updated bus name in test events * chore: updated readme and spelling mistakes * chore: bumped dependencies * fix: syncing templates --------- Co-authored-by: Marco Buss <[email protected]>
1 parent ff1ee9b commit 6b7fb68

File tree

99 files changed

+638
-509
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+638
-509
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ updates:
88
- package-ecosystem: "pip" # See documentation for possible values
99
directories:
1010
- "unicorn_contracts" # Location of package manifests
11-
- "unicorn_properties"
11+
- "unicorn_approvals"
1212
- "unicorn_web"
1313
schedule:
1414
interval: "weekly"

.github/workflows/auto_assign.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ jobs:
77
add-reviews:
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: kentaro-m/auto-assign-action@v1.2.5
10+
- uses: kentaro-m/auto-assign-action@v2.0.0

.github/workflows/build.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Build Python Services
2+
3+
on:
4+
push:
5+
branches: [develop, main]
6+
paths:
7+
- 'unicorn_contracts/**'
8+
- 'unicorn_approvals/**'
9+
- 'unicorn_web/**'
10+
pull_request:
11+
branches: [develop, main]
12+
paths:
13+
- 'unicorn_contracts/**'
14+
- 'unicorn_approvals/**'
15+
- 'unicorn_web/**'
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
strategy:
21+
matrix:
22+
service: [unicorn_contracts, unicorn_approvals, unicorn_web]
23+
include:
24+
- service: unicorn_contracts
25+
display_name: Unicorn Contracts Service
26+
- service: unicorn_approvals
27+
display_name: Unicorn Approvals Service
28+
- service: unicorn_web
29+
display_name: Unicorn Web Service
30+
31+
steps:
32+
- name: Checkout code
33+
uses: actions/checkout@v4
34+
35+
- name: Set up Python 3.12
36+
uses: actions/setup-python@v4
37+
with:
38+
python-version: 3.12
39+
40+
- name: Install uv
41+
uses: astral-sh/setup-uv@v5
42+
with:
43+
version: 0.7.8
44+
45+
- name: Install AWS SAM CLI
46+
uses: aws-actions/setup-sam@v2
47+
48+
- name: Install cfn-lint and plugins
49+
run: |
50+
pip install cfn-lint
51+
pip install cfn-lint-serverless
52+
53+
- name: Install yq
54+
run: |
55+
sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
56+
sudo chmod a+x /usr/local/bin/yq
57+
58+
- name: Initialize dependencies for ${{ matrix.display_name }}
59+
run: make ci_init
60+
working-directory: ./${{ matrix.service }}
61+
62+
- name: Build ${{ matrix.display_name }}
63+
run: |
64+
# Use uv run to ensure all commands run in the virtual environment
65+
uv run make build
66+
working-directory: ./${{ matrix.service }}
67+
env:
68+
DOCKER_OPTS: --use-container
69+
70+
- name: Upload build artifacts for ${{ matrix.display_name }}
71+
uses: actions/upload-artifact@v4
72+
with:
73+
name: ${{ matrix.service }}-build-artifacts
74+
path: ${{ matrix.service }}/.aws-sam/
75+
retention-days: 7
76+
77+
- name: Clean up ${{ matrix.display_name }}
78+
run: uv run make clean
79+
working-directory: ./${{ matrix.service }}
80+
if: always()

.github/workflows/codeql-analysis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,18 @@ jobs:
2525

2626
steps:
2727
- name: Checkout repository
28-
uses: actions/checkout@v3
28+
uses: actions/checkout@v4
2929

3030
# Initializes the CodeQL tools for scanning.
3131
- name: Initialize CodeQL
32-
uses: github/codeql-action/init@2ca79b6fa8d3ec278944088b4aa5f46912db5d63 #v2
32+
uses: github/codeql-action/init@v3
3333
with:
3434
languages: ${{ matrix.language }}
3535

3636
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
3737
# If this step fails, then you should remove it and run the build manually (see below)
3838
# - name: Autobuild
39-
# uses: github/codeql-action/autobuild@2ca79b6fa8d3ec278944088b4aa5f46912db5d63 #v2
39+
# uses: github/codeql-action/autobuild@v3
4040

4141
# ℹ️ Command-line programs to run using the OS shell.
4242
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -49,4 +49,4 @@ jobs:
4949
# ./location_of_script_within_repo/buildscript.sh
5050

5151
- name: Perform CodeQL Analysis
52-
uses: github/codeql-action/analyze@2ca79b6fa8d3ec278944088b4aa5f46912db5d63 #v2
52+
uses: github/codeql-action/analyze@v3

.github/workflows/label_pr_on_title.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ jobs:
2222
runs-on: ubuntu-latest
2323
steps:
2424
- name: Checkout repository
25-
uses: actions/checkout@v3
25+
uses: actions/checkout@v4
2626
- name: "Label PR based on title"
27-
uses: actions/github-script@v6
27+
uses: actions/github-script@v7
2828
env:
2929
PR_NUMBER: ${{ needs.get_pr_details.outputs.prNumber }}
3030
PR_TITLE: ${{ needs.get_pr_details.outputs.prTitle }}

.github/workflows/on_label_added.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ jobs:
2323
issues: write
2424
pull-requests: write
2525
steps:
26-
- uses: actions/checkout@v3
26+
- uses: actions/checkout@v4
2727
# Maintenance: Persist state per PR as an artifact to avoid spam on label add
2828
- name: "Suggest split large Pull Request"
29-
uses: actions/github-script@v6
29+
uses: actions/github-script@v7
3030
env:
3131
PR_NUMBER: ${{ needs.get_pr_details.outputs.prNumber }}
3232
PR_ACTION: ${{ needs.get_pr_details.outputs.prAction }}

.github/workflows/on_merged_pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ jobs:
2020
runs-on: ubuntu-latest
2121
if: needs.get_pr_details.outputs.prIsMerged == 'true'
2222
steps:
23-
- uses: actions/checkout@v3
23+
- uses: actions/checkout@v4
2424
- name: "Label PR related issue for release"
25-
uses: actions/github-script@v6
25+
uses: actions/github-script@v7
2626
env:
2727
PR_NUMBER: ${{ needs.get_pr_details.outputs.prNumber }}
2828
PR_BODY: ${{ needs.get_pr_details.outputs.prBody }}

.github/workflows/on_opened_pr.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ jobs:
1919
needs: get_pr_details
2020
runs-on: ubuntu-latest
2121
steps:
22-
- uses: actions/checkout@v3
22+
- uses: actions/checkout@v4
2323
- name: "Ensure related issue is present"
24-
uses: actions/github-script@v6
24+
uses: actions/github-script@v7
2525
env:
2626
PR_BODY: ${{ needs.get_pr_details.outputs.prBody }}
2727
PR_NUMBER: ${{ needs.get_pr_details.outputs.prNumber }}
@@ -36,9 +36,9 @@ jobs:
3636
needs: get_pr_details
3737
runs-on: ubuntu-latest
3838
steps:
39-
- uses: actions/checkout@v3
39+
- uses: actions/checkout@v4
4040
- name: "Ensure acknowledgement section is present"
41-
uses: actions/github-script@v6
41+
uses: actions/github-script@v7
4242
env:
4343
PR_BODY: ${{ needs.get_pr_details.outputs.prBody }}
4444
PR_NUMBER: ${{ needs.get_pr_details.outputs.prNumber }}

.github/workflows/record_pr.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ jobs:
99
runs-on: ubuntu-latest
1010

1111
steps:
12-
- uses: actions/checkout@v3
12+
- uses: actions/checkout@v4
1313
- name: "Extract PR details"
14-
uses: actions/github-script@v6
14+
uses: actions/github-script@v7
1515
with:
1616
script: |
1717
const script = require('.github/scripts/save_pr_details.js')
1818
await script({github, context, core})
19-
- uses: actions/upload-artifact@v3
19+
- uses: actions/upload-artifact@v4
2020
with:
2121
name: pr
2222
path: pr.txt

.github/workflows/reusable_export_pr_details.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ jobs:
5959
prIsMerged: ${{ steps.prIsMerged.outputs.prIsMerged }}
6060
steps:
6161
- name: Checkout repository # in case caller workflow doesn't checkout thus failing with file not found
62-
uses: actions/checkout@v3
62+
uses: actions/checkout@v4
6363
- name: "Download previously saved PR"
64-
uses: actions/github-script@v6
64+
uses: actions/github-script@v7
6565
env:
6666
WORKFLOW_ID: ${{ inputs.record_pr_workflow_id }}
6767
# For security, we only download artifacts tied to the successful PR recording workflow

0 commit comments

Comments
 (0)