Skip to content

Commit 8f825ba

Browse files
authored
Implemented new workflows (#4)
* Reorganized workflows: added pre-production validation, staging & production deployment; removed old test report. Updated README with deployment instructions. * Removed deprecated deploy workflow and references; updated staging and production workflows to use the main deploy workflow path. * Updated Python version to 3.12 in staging-deploy and test-lint workflows * Migrated Python workflows to use Poetry for dependency management and streamlined lint/test commands. * Removed redundant FeedbackException handling in preview evaluation function. * Removed unused `build-file` and `build-context` inputs from staging and production workflows.
1 parent a1d67d5 commit 8f825ba

9 files changed

Lines changed: 280 additions & 137 deletions

File tree

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: "Release Request"
2+
description: "Request a deployment by specifying the evaluation function, changes, target commit/branch, and test confirmation."
3+
title: "Release Request"
4+
labels:
5+
- release
6+
- deployment
7+
assignees: []
8+
body:
9+
- type: textarea
10+
id: description_of_changes
11+
attributes:
12+
label: Description of changes
13+
description: "Summarize what is changing and why. Include links to PRs, issues, or changelogs."
14+
placeholder: |
15+
- What changed:
16+
- Why:
17+
- Related PRs/Issues: #123, #456
18+
render: markdown
19+
validations:
20+
required: true
21+
22+
- type: input
23+
id: branch_to_deploy
24+
attributes:
25+
label: Branch to deploy
26+
description: |
27+
Specify Branch name to deploy.
28+
placeholder: "e.g., release/2025-09-29"
29+
validations:
30+
required: true
31+
32+
- type: dropdown
33+
id: version-bump
34+
attributes:
35+
label: "🚀 What kind of update is this?"
36+
description: "Tell us how significant this change is. This helps us set the correct new version number."
37+
options:
38+
- "Patch: A small fix for a bug. It won't break anything for existing users. (e.g., 1.2.3 ➔ 1.2.4)"
39+
- "Minor: Adds a new feature, but doesn't change how existing ones work. A safe update. (e.g., 1.2.3 ➔ 1.3.0)"
40+
- "Major: A big change that alters existing features. Users may need to update their work to adapt. (e.g., 1.2.3 ➔ 2.0.0)"
41+
default: 0
42+
validations:
43+
required: true
44+
45+
- type: markdown
46+
attributes:
47+
value: |
48+
---
49+
### ⚡ Click the Link Below to Run the Workflow
50+
51+
Clicking the link will take you to the Actions page. You will need to click the **"Run workflow"** button there to start the process.
52+
53+
## [➡️ Go to Workflow Run Page](../actions/workflows/production-deploy.yml)

.github/workflows/deploy.yml

Lines changed: 0 additions & 105 deletions
This file was deleted.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Run Pre-Production Validation Tests
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
eval_function:
7+
type: string
8+
description: "The name of the evaluation function to test"
9+
required: true
10+
sql_limit:
11+
type: number
12+
description: "The maximum number of SQL test cases to run"
13+
required: false
14+
default: 500
15+
seed:
16+
type: string
17+
description: "Random seed for reproducible sampling (float in [-1.0, 1.0]). Leave blank to auto-generate."
18+
required: false
19+
default: ''
20+
request_delay:
21+
type: string
22+
description: "Delay (seconds) between dispatching requests"
23+
required: false
24+
default: '0'
25+
max_concurrency:
26+
type: string
27+
description: "Max concurrent requests (lower for GPT-backed functions)"
28+
required: false
29+
default: '5'
30+
31+
jobs:
32+
run-pre-production-tests:
33+
name: 🧪 Run Staging Validation Tests
34+
uses: lambda-feedback/Database-Testing/.github/workflows/test_evaluation_function.yml@main
35+
with:
36+
eval_function: ${{ inputs.eval_function }}
37+
sql_limit: ${{ inputs.sql_limit }}
38+
seed: ${{ inputs.seed }}
39+
request_delay: ${{ inputs.request_delay }}
40+
max_concurrency: ${{ inputs.max_concurrency }}
41+
secrets:
42+
TEST_API_ENDPOINT: ${{ secrets.TEST_API_ENDPOINT }}
43+
DB_USER: ${{ secrets.DB_USER }}
44+
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
45+
DB_HOST: ${{ secrets.DB_HOST }}
46+
DB_PORT: ${{ secrets.DB_PORT }}
47+
DB_NAME: ${{ secrets.DB_NAME }}
48+
GCP_SERVICE_ACCOUNT_KEY: ${{ secrets.GCP_DB_CREDS }}
49+
GCP_PROJECT_ID: ${{ secrets.GCP_DB_PROJECT_ID }}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Deploy to Production
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version-bump:
7+
description: 'Version bump type'
8+
required: true
9+
type: choice
10+
options:
11+
- patch
12+
- minor
13+
- major
14+
default: patch
15+
branch:
16+
description: 'Branch to release from'
17+
required: true
18+
type: string
19+
default: 'main'
20+
seed:
21+
description: 'Random seed for reproducible sampling (float in [-1.0, 1.0]). Leave blank to auto-generate.'
22+
required: false
23+
type: string
24+
default: ''
25+
request_delay:
26+
description: 'Delay (seconds) between dispatching requests'
27+
required: false
28+
type: string
29+
default: '0'
30+
max_concurrency:
31+
description: 'Max concurrent requests (lower for GPT-backed functions)'
32+
required: false
33+
type: string
34+
default: '5'
35+
jobs:
36+
deploy:
37+
uses: lambda-feedback/evaluation-function-workflows/.github/workflows/deploy.yml@main
38+
with:
39+
template-repository-name: 'lambda-feedback/evaluation-function-boilerplate-python'
40+
environment: "production"
41+
version-bump: ${{ inputs.version-bump }}
42+
branch: ${{ inputs.branch }}
43+
run-database-tests: false
44+
seed: ${{ inputs.seed }}
45+
request_delay: ${{ inputs.request_delay }}
46+
max_concurrency: ${{ inputs.max_concurrency }}
47+
48+
secrets:
49+
aws-key-id: ${{ secrets.LAMBDA_CONTAINER_PIPELINE_AWS_ID }}
50+
aws-secret-key: ${{ secrets.LAMBDA_CONTAINER_PIPELINE_AWS_SECRET}}
51+
function-admin-api-key: ${{ secrets.FUNCTION_ADMIN_API_KEY}}
52+
gcp_credentials: ${{ secrets.GCP_DEPLOY }}
53+
TEST_API_ENDPOINT: ${{ secrets.TEST_API_ENDPOINT }}
54+
DB_USER: ${{ secrets.DB_USER }}
55+
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
56+
DB_HOST: ${{ secrets.DB_HOST }}
57+
DB_PORT: ${{ secrets.DB_PORT }}
58+
DB_NAME: ${{ secrets.DB_NAME }}
59+
GCP_DB_CREDS: ${{ secrets.GCP_DB_CREDS }}
60+
GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Deploy to Staging
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
jobs:
10+
test:
11+
name: Test
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
actions: read
16+
checks: write
17+
pull-requests: write
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
python-version: ["3.12"]
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
- name: Set up Python ${{ matrix.python-version }}
26+
id: python-setup
27+
uses: actions/setup-python@v5
28+
with:
29+
python-version: ${{ matrix.python-version }}
30+
31+
- name: Install Poetry
32+
run: pip install poetry
33+
34+
- name: Install dependencies
35+
run: poetry install
36+
37+
- name: Lint with flake8
38+
run: |
39+
poetry run flake8 ./evaluation_function --count --select=E9,F63,F7,F82 --show-source --statistics
40+
poetry run flake8 ./evaluation_function --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
41+
42+
- name: Run tests
43+
if: always()
44+
run: poetry run pytest --junit-xml=./reports/pytest.xml --tb=auto -v
45+
46+
- name: Upload test results
47+
uses: actions/upload-artifact@v4
48+
if: always()
49+
with:
50+
name: test-results-${{ matrix.python-version }}
51+
path: ./reports/pytest.xml
52+
if-no-files-found: warn
53+
deploy:
54+
needs: test
55+
uses: lambda-feedback/evaluation-function-workflows/.github/workflows/deploy.yml@main
56+
with:
57+
template-repository-name: "lambda-feedback/evaluation-function-boilerplate-python"
58+
build-platforms: "aws"
59+
environment: "staging"
60+
lfs: false
61+
secrets:
62+
aws-key-id: ${{ secrets.LAMBDA_CONTAINER_PIPELINE_AWS_ID }}
63+
aws-secret-key: ${{ secrets.LAMBDA_CONTAINER_PIPELINE_AWS_SECRET}}
64+
function-admin-api-key: ${{ secrets.FUNCTION_ADMIN_API_KEY}}
65+
gcp_credentials: ${{ secrets.GCP_DEPLOY }}

.github/workflows/test-lint.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Test and Lint
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
test:
8+
name: Test
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
actions: read
13+
checks: write
14+
pull-requests: write
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
python-version: ["3.12"]
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
- name: Set up Python ${{ matrix.python-version }}
23+
id: python-setup
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
28+
- name: Install Poetry
29+
run: pip install poetry
30+
31+
- name: Install dependencies
32+
run: poetry install
33+
34+
- name: Lint with flake8
35+
run: |
36+
poetry run flake8 ./evaluation_function --count --select=E9,F63,F7,F82 --show-source --statistics
37+
poetry run flake8 ./evaluation_function --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
38+
39+
- name: Run tests
40+
if: always()
41+
run: poetry run pytest --junit-xml=./reports/pytest.xml --tb=auto -v
42+
43+
- name: Upload test results
44+
uses: actions/upload-artifact@v4
45+
if: always()
46+
with:
47+
name: test-results-${{ matrix.python-version }}
48+
path: ./reports/pytest.xml
49+
if-no-files-found: warn

0 commit comments

Comments
 (0)