Skip to content

Commit 306a866

Browse files
authored
✨ Boilerplate first pass (#1)
* Add boiler plate code, readme and infra * update infra readme * remove unnecessary github workflow * rename github workflow yaml to yml
1 parent 645fb90 commit 306a866

Some content is hidden

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

52 files changed

+4386
-0
lines changed

.github/pull_request_template.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# What was changed?
2+
[RC-XXXX]
3+
- If you worked on Notion tickets. Provide the ticket number here and give
4+
a short description of what you did for each ticket.
5+
6+
# How to QA?
7+
Provide a way for the reviewer to QA your ticket. This must contain the name of
8+
the theme containing all your changes.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Validate bicep scripts
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'backend-integration/**'
9+
10+
# Use concurrency to ensure that only a single job or workflow using the same concurrency group will run at a time
11+
concurrency:
12+
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
13+
cancel-in-progress: true # Cancel previously queued jobs and run the latest
14+
15+
16+
jobs:
17+
build:
18+
timeout-minutes: 10
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v2
23+
24+
- name: Azure CLI script
25+
uses: azure/[email protected]
26+
with:
27+
inlineScript: az config set bicep.use_binary_from_path=false && az bicep build -f backend-integration/infra/main.bicep
28+
29+
- name: Log in with Azure (Federated Credentials)
30+
if: ${{ env.AZURE_CLIENT_ID != '' }}
31+
run: |
32+
azd auth login \
33+
--client-id "$AZURE_CLIENT_ID" \
34+
--federated-credential-provider "github" \
35+
--tenant-id "$AZURE_TENANT_ID"
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: Deploy Backend Integration to Azure
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
paths:
9+
- 'backend-integration/**'
10+
11+
# GitHub Actions workflow to deploy to Azure using azd
12+
# To configure required secrets for connecting to Azure, simply run `azd pipeline config`
13+
14+
# Set up permissions for deploying with secretless Azure federated credentials
15+
# https://learn.microsoft.com/en-us/azure/developer/github/connect-from-azure?tabs=azure-portal%2Clinux#set-up-azure-login-with-openid-connect-authentication
16+
permissions:
17+
id-token: write
18+
contents: read
19+
20+
# Use concurrency to ensure that only a single job or workflow using the same concurrency group will run at a time
21+
concurrency:
22+
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
23+
cancel-in-progress: true # Cancel previously queued jobs and run the latest
24+
25+
26+
jobs:
27+
self-hosted-status:
28+
runs-on: ubuntu-latest
29+
timeout-minutes: 5
30+
outputs:
31+
runner-status: ${{ steps.runnerstatus.outputs.status }}
32+
steps:
33+
- name: Check runner status
34+
id: runnerstatus
35+
uses: SatelCreative/[email protected]
36+
with:
37+
github-runner-token: ${{ secrets.SELF_HOSTED_RUNNER_TOKEN }} #Should have access to manage runner
38+
org-name: SatelCreative
39+
build:
40+
needs: [self-hosted-status]
41+
timeout-minutes: 10
42+
runs-on: ${{ contains(needs.self-hosted-status.outputs.runner-status, 'online') && 'self-hosted' || 'ubuntu-latest' }}
43+
environment: dev
44+
env:
45+
AZURE_CLIENT_ID: ${{ vars.BACKEND_INTEGRATION_CLIENT_ID }}
46+
AZURE_TENANT_ID: ${{ vars.BACKEND_INTEGRATION_TENANT_ID }}
47+
AZURE_SUBSCRIPTION_ID: ${{ vars.BACKEND_INTEGRATION_SUBSCRIPTION_ID }}
48+
AZURE_CREDENTIALS: ${{ secrets.BACKEND_INTEGRATION_CREDENTIALS }}
49+
steps:
50+
- name: Checkout
51+
uses: actions/checkout@v4
52+
53+
- name: Install azd
54+
uses: Azure/[email protected]
55+
56+
- name: Log in with Azure (Federated Credentials)
57+
if: ${{ env.AZURE_CLIENT_ID != '' }}
58+
run: |
59+
azd auth login \
60+
--client-id "$AZURE_CLIENT_ID" \
61+
--federated-credential-provider "github" \
62+
--tenant-id "$AZURE_TENANT_ID"
63+
64+
65+
- name: Log in with Azure (Client Credentials)
66+
if: ${{ env.AZURE_CREDENTIALS != '' }}
67+
run: |
68+
$info = $Env:AZURE_CREDENTIALS | ConvertFrom-Json -AsHashtable;
69+
Write-Host "::add-mask::$($info.clientSecret)"
70+
71+
azd auth login \
72+
--client-id "$($info.clientId)" \
73+
--client-secret "$($info.clientSecret)" \
74+
--tenant-id "$($info.tenantId)"
75+
76+
env:
77+
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }}
78+
79+
# Commented out to preserve existing application settings
80+
# Uncomment when infrastructure changes are needed
81+
#- name: Provision Infrastructure
82+
# run: |
83+
# cd backend-integration
84+
# azd provision --no-prompt
85+
# env:
86+
# AZURE_ENV_NAME: ${{ vars.AZURE_ENV_NAME }}
87+
# AZURE_LOCATION: ${{ vars.AZURE_LOCATION }}
88+
# AZURE_SUBSCRIPTION_ID: ${{ vars.AZURE_SUBSCRIPTION_ID }}
89+
90+
- name: Deploy Application
91+
run:
92+
|
93+
cd backend-integration
94+
azd deploy --no-prompt
95+
env:
96+
AZURE_ENV_NAME: ${{ vars.AZURE_ENV_NAME }}
97+
AZURE_LOCATION: ${{ vars.AZURE_LOCATION }}
98+
AZURE_SUBSCRIPTION_ID: ${{ vars.AZURE_SUBSCRIPTION_ID }}
99+

.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,3 +205,18 @@ cython_debug/
205205
marimo/_static/
206206
marimo/_lsp/
207207
__marimo__/
208+
209+
210+
# Azure Functions artifacts
211+
bin
212+
obj
213+
appsettings.json
214+
local.settings.json
215+
216+
# Azurite artifacts
217+
__blobstorage__
218+
__queuestorage__
219+
__azurite_db*__.json
220+
.python_packages
221+
.azure
222+
AzuriteConfig

backend-integration/.funcignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.git*
2+
.vscode
3+
local.settings.json
4+
test
5+
tests/*
6+
.venv
7+
pyproject.toml
8+
poetry.lock
9+
config.sh.example
10+
azure.yaml
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
repos:
2+
# Secret detection - lightweight and fast
3+
- repo: https://github.com/Yelp/detect-secrets
4+
rev: v1.5.0
5+
hooks:
6+
- id: detect-secrets
7+
args: ['--baseline', 'backend-integration/.secrets.baseline']
8+
files: ^backend-integration/.*\.py$
9+
10+
# Check-only hooks (no file modifications)
11+
- repo: https://github.com/pre-commit/pre-commit-hooks
12+
rev: v5.0.0
13+
hooks:
14+
- id: check-yaml
15+
- id: check-added-large-files
16+
- id: check-merge-conflict
17+
- id: debug-statements
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
{
2+
"version": "1.5.0",
3+
"plugins_used": [
4+
{
5+
"name": "ArtifactoryDetector"
6+
},
7+
{
8+
"name": "AWSKeyDetector"
9+
},
10+
{
11+
"name": "AzureStorageKeyDetector"
12+
},
13+
{
14+
"name": "Base64HighEntropyString",
15+
"limit": 4.5
16+
},
17+
{
18+
"name": "BasicAuthDetector"
19+
},
20+
{
21+
"name": "CloudantDetector"
22+
},
23+
{
24+
"name": "DiscordBotTokenDetector"
25+
},
26+
{
27+
"name": "GitHubTokenDetector"
28+
},
29+
{
30+
"name": "HexHighEntropyString",
31+
"limit": 3.0
32+
},
33+
{
34+
"name": "IbmCloudIamDetector"
35+
},
36+
{
37+
"name": "IbmCosHmacDetector"
38+
},
39+
{
40+
"name": "JwtTokenDetector"
41+
},
42+
{
43+
"name": "KeywordDetector",
44+
"keyword_exclude": ""
45+
},
46+
{
47+
"name": "MailchimpDetector"
48+
},
49+
{
50+
"name": "NpmDetector"
51+
},
52+
{
53+
"name": "PrivateKeyDetector"
54+
},
55+
{
56+
"name": "SendGridDetector"
57+
},
58+
{
59+
"name": "SlackDetector"
60+
},
61+
{
62+
"name": "SoftlayerDetector"
63+
},
64+
{
65+
"name": "SquareOAuthDetector"
66+
},
67+
{
68+
"name": "StripeDetector"
69+
},
70+
{
71+
"name": "TwilioKeyDetector"
72+
}
73+
],
74+
"filters_used": [
75+
{
76+
"path": "detect_secrets.filters.allowlist.is_line_allowlisted"
77+
},
78+
{
79+
"path": "detect_secrets.filters.common.is_ignored_due_to_verification_policies",
80+
"min_level": 2
81+
},
82+
{
83+
"path": "detect_secrets.filters.heuristic.is_indirect_reference"
84+
},
85+
{
86+
"path": "detect_secrets.filters.heuristic.is_likely_id_string"
87+
},
88+
{
89+
"path": "detect_secrets.filters.heuristic.is_lock_file"
90+
},
91+
{
92+
"path": "detect_secrets.filters.heuristic.is_not_alphanumeric_string"
93+
},
94+
{
95+
"path": "detect_secrets.filters.heuristic.is_potential_uuid"
96+
},
97+
{
98+
"path": "detect_secrets.filters.heuristic.is_prefixed_with_dollar_sign"
99+
},
100+
{
101+
"path": "detect_secrets.filters.heuristic.is_sequential_string"
102+
},
103+
{
104+
"path": "detect_secrets.filters.heuristic.is_swagger_file"
105+
},
106+
{
107+
"path": "detect_secrets.filters.heuristic.is_templated_secret"
108+
}
109+
],
110+
"results": {},
111+
"generated_at": "2025-01-27T00:00:00Z"
112+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"recommendations": [
3+
"ms-azuretools.vscode-azurefunctions",
4+
"ms-python.python"
5+
]
6+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Attach to Python Functions",
6+
"type": "debugpy",
7+
"request": "attach",
8+
"connect": {
9+
"port": 7071
10+
},
11+
"preLaunchTask": "func: host start"
12+
}
13+
]
14+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"azureFunctions.deploySubpath": ".",
3+
"azureFunctions.scmDoBuildDuringDeployment": true,
4+
"azureFunctions.pythonVenv": ".venv",
5+
"azureFunctions.projectLanguage": "Python",
6+
"azureFunctions.projectRuntime": "~4",
7+
"debug.internalConsoleOptions": "neverOpen"
8+
}

0 commit comments

Comments
 (0)