Skip to content

Commit fb9df1c

Browse files
authored
Merge pull request #218 from oqtopus-team/develop
release: 2025-07-04 15:13
2 parents 8b9056e + 3dbf393 commit fb9df1c

File tree

92 files changed

+5451
-716
lines changed

Some content is hidden

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

92 files changed

+5451
-716
lines changed

.editorconfig-checker.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"Exclude": [
3+
".*\\.md$",
4+
"backend/alembic/versions/.*\\.py$"
5+
]
6+
}

.github/workflows/actionlint.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Actionlint
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- ".github/workflows/**/*.yaml"
7+
- ".github/workflows/**/*.yml"
8+
9+
jobs:
10+
actionlint:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
checks: "write"
14+
contents: "read"
15+
pull-requests: "write"
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: reviewdog/[email protected]
19+
with:
20+
github_token: ${{ secrets.GITHUB_TOKEN }}
21+
fail_level: error
22+
filter_mode: nofilter
23+
level: error
24+
reporter: github-pr-review

.github/workflows/deployment.yaml

Lines changed: 18 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ jobs:
1010
deployment:
1111
runs-on: ubuntu-latest
1212
strategy:
13+
fail-fast: false
1314
matrix:
1415
deploy-target: [user, provider, admin, lambda_auth, user_signup]
1516

@@ -29,7 +30,7 @@ jobs:
2930
- name: Set AWS Profile
3031
run: |
3132
ACCOUNT_NAME=$(aws iam list-account-aliases --query "AccountAliases[0]" --output text)
32-
echo "PROFILE=$ACCOUNT_NAME" >> $GITHUB_ENV
33+
echo "PROFILE=$ACCOUNT_NAME" >> "$GITHUB_ENV"
3334
3435
- name: Set up Python
3536
uses: actions/setup-python@v5
@@ -39,14 +40,15 @@ jobs:
3940
- name: Install Poetry
4041
run: |
4142
pip install poetry poetry-plugin-export
42-
echo "$HOME/.local/bin" >> $GITHUB_PATH
43+
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
4344
4445
- name: Install poetry dependencies
4546
run: poetry install
4647

4748
- name: Install make
4849
run: sudo apt install make
4950

51+
5052
- name: Deploy
5153
working-directory: ./deployment/oqtopus-dev
5254
env:
@@ -57,111 +59,23 @@ jobs:
5759
5860
- name: On Success
5961
if: ${{ success() }}
60-
env:
61-
SLACK_API_TOKEN: ${{ secrets.SLACK_API_TOKEN }}
6262
run: |
63-
TIMESTAMP=$(date "+%Y-%m-%d %H:%M:%S")
64-
RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
65-
curl -s -o /dev/null -X POST https://slack.com/api/chat.postMessage \
66-
-H "Content-Type: application/json" \
67-
-H "Authorization: Bearer $SLACK_API_TOKEN" \
68-
--data @- <<EOF
69-
{
70-
"channel": "${{ secrets.SLACK_CHANNEL_NAME }}",
71-
"text": "✅ Deploy successful (${{ matrix.deploy-target }})",
72-
"attachments": [
73-
{
74-
"color": "#00dd00",
75-
"blocks": [
76-
{
77-
"type": "section",
78-
"text": {
79-
"type": "mrkdwn",
80-
"text": "*Log*"
81-
}
82-
},
83-
{
84-
"type": "section",
85-
"text": {
86-
"type": "mrkdwn",
87-
"text": "[${TIMESTAMP}] Deployed successfully!"
88-
}
89-
},
90-
{
91-
"type": "divider"
92-
},
93-
{
94-
"type": "section",
95-
"text": {
96-
"type": "mrkdwn",
97-
"text": "*Action*"
98-
}
99-
},
100-
{
101-
"type": "section",
102-
"text": {
103-
"type": "mrkdwn",
104-
"text": "${RUN_URL}"
105-
}
106-
}
107-
]
108-
}
109-
]
110-
}
111-
EOF
63+
echo "SUCCESS=1" >> "$GITHUB_ENV"
11264
11365
- name: On Failure
11466
if: ${{ failure() }}
67+
run: |
68+
echo "SUCCESS=0" >> "$GITHUB_ENV"
69+
70+
- name: On Exit
71+
if: ${{ always() }}
72+
run: |
73+
source .venv/bin/activate
74+
python3 ./scripts/build_slack_notification.py \
75+
--success="$SUCCESS" \
76+
--timestamp="$(date "+%Y-%m-%d %H:%M:%S")" \
77+
--run-url="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
78+
--deploy-target="${{ matrix.deploy-target }}"
11579
env:
11680
SLACK_API_TOKEN: ${{ secrets.SLACK_API_TOKEN }}
117-
run: |
118-
TIMESTAMP=$(date "+%Y-%m-%d %H:%M:%S")
119-
RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
120-
MESSAGE=$(cat error.log)
121-
curl -s -o /dev/null -X POST https://slack.com/api/chat.postMessage \
122-
-H "Content-Type: application/json" \
123-
-H "Authorization: Bearer $SLACK_API_TOKEN" \
124-
--data @- <<EOF
125-
{
126-
"channel": "${{ secrets.SLACK_CHANNEL_NAME }}",
127-
"text": "❌ Deploy failed (${{ matrix.deploy-target }})",
128-
"attachments": [
129-
{
130-
"color": "#dd0000",
131-
"blocks": [
132-
{
133-
"type": "section",
134-
"text": {
135-
"type": "mrkdwn",
136-
"text": "*Log*"
137-
}
138-
},
139-
{
140-
"type": "section",
141-
"text": {
142-
"type": "mrkdwn",
143-
"text": "[${TIMESTAMP}] Deploy failed!"
144-
}
145-
},
146-
{
147-
"type": "divider"
148-
},
149-
{
150-
"type": "section",
151-
"text": {
152-
"type": "mrkdwn",
153-
"text": "*Action*"
154-
}
155-
},
156-
{
157-
"type": "section",
158-
"text": {
159-
"type": "mrkdwn",
160-
"text": "${RUN_URL}"
161-
}
162-
}
163-
]
164-
}
165-
]
166-
}
167-
EOF
81+
SLACK_CHANNEL_NAME: ${{ secrets.SLACK_CHANNEL_NAME }}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Code review
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- develop
7+
8+
permissions:
9+
contents: read
10+
pull-requests: write
11+
12+
13+
jobs:
14+
review:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: check out
18+
uses: actions/checkout@v4
19+
20+
- name: Setup reviewdog
21+
uses: reviewdog/action-setup@v1
22+
with:
23+
reviewdog_version: latest
24+
25+
- name: Define envs
26+
run: |
27+
echo "OS=linux" >> "$GITHUB_ENV"
28+
echo "ARCH=amd64" >> "$GITHUB_ENV"
29+
30+
- name: Install editorconfig-checker
31+
run: |
32+
VERSION="v3.3.0"
33+
34+
curl -fsSL https://github.com/editorconfig-checker/editorconfig-checker/releases/download/${VERSION}/ec-${{ env.OS }}-${{ env.ARCH }}.tar.gz -o ec.tar.gz
35+
tar -xzf ec.tar.gz
36+
chmod -R +x bin
37+
38+
- name: Run editorconfig-checker with reviewdog
39+
run: |
40+
bin/ec-${{ env.OS }}-${{ env.ARCH }} -config .editorconfig-checker.json > output_ecc.txt || true
41+
python3 scripts/ecc_converter.py < output_ecc.txt > result_py.txt
42+
reviewdog -efm="%f:%l:%c: %m" -name="editorconfig-checker" -reporter=github-pr-review < result_py.txt
43+
env:
44+
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/labeler.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,19 @@ jobs:
6060
echo "$unique_labels"
6161
6262
# Set the output as a newline-separated string
63-
echo "labels<<EOF" >> $GITHUB_OUTPUT
64-
echo "$unique_labels" >> $GITHUB_OUTPUT
65-
echo "EOF" >> $GITHUB_OUTPUT
63+
{
64+
echo "labels<<EOF"
65+
echo "$unique_labels"
66+
echo "EOF"
67+
} >> "$GITHUB_OUTPUT"
6668
6769
- name: Add labels to PR
6870
uses: actions-ecosystem/action-add-labels@v1
6971
with:
7072
labels: ${{ steps.set-labels.outputs.labels }}
7173

7274
- name: Assign PR creator
73-
uses: actions/github-script@v6
75+
uses: actions/github-script@v7
7476
with:
7577
script: |
7678
await github.rest.issues.addAssignees({

.github/workflows/prod-cd.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- name: Set AWS Profile
2828
run: |
2929
ACCOUNT_NAME=$(aws iam list-account-aliases --query "AccountAliases[0]" --output text)
30-
echo "PROFILE=$ACCOUNT_NAME" >> $GITHUB_ENV
30+
echo "PROFILE=$ACCOUNT_NAME" >> "$GITHUB_ENV"
3131
3232
3333
- name: Set up Python
@@ -38,7 +38,7 @@ jobs:
3838
- name: Install Poetry
3939
run: |
4040
pip install poetry poetry-plugin-export
41-
echo "$HOME/.local/bin" >> $GITHUB_PATH
41+
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
4242
4343
- name: Install poetry dependencies
4444
run: poetry install
@@ -114,7 +114,6 @@ jobs:
114114
run: |
115115
TIMESTAMP=$(date "+%Y-%m-%d %H:%M:%S")
116116
RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
117-
MESSAGE=$(cat error.log)
118117
curl -s -o /dev/null -X POST https://slack.com/api/chat.postMessage \
119118
-H "Content-Type: application/json" \
120119
-H "Authorization: Bearer $SLACK_API_TOKEN" \

.github/workflows/tflint.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515

1616
steps:
1717
- name: Checkout repository
18-
uses: actions/checkout@v3
18+
uses: actions/checkout@v4
1919

2020
- name: Set up Aqua
2121
uses: aquaproj/[email protected]

.github/workflows/update-document.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
run: |
2727
git config --global user.name "github-actions[bot]"
2828
git config --global user.email "github-actions[bot]@users.noreply.github.com"
29-
29+
3030
- name: Set up Python
3131
uses: actions/setup-python@v5
3232
with:
@@ -35,7 +35,7 @@ jobs:
3535
- name: Install Poetry
3636
run: |
3737
pip install poetry poetry-plugin-export
38-
echo "$HOME/.local/bin" >> $GITHUB_PATH
38+
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
3939
4040
- name: Install poetry dependencies
4141
run: poetry install
@@ -54,8 +54,8 @@ jobs:
5454
- name: Create new branch and switch
5555
run: |
5656
BRANCH_NAME="chore/auto-update-docs-$(date +%Y%m%d-%H%M%S)"
57-
git checkout -b $BRANCH_NAME
58-
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
57+
git checkout -b "$BRANCH_NAME"
58+
echo "BRANCH_NAME=$BRANCH_NAME" >> "$GITHUB_ENV"
5959
6060
- name: Auto PR
6161
env:
@@ -67,9 +67,9 @@ jobs:
6767
exit 0
6868
fi
6969
git commit -m "Auto update document $(date +%Y%m%d-%H%M%S)" -a
70-
git push origin $BRANCH_NAME
70+
git push origin "$BRANCH_NAME"
7171
gh pr create --title "chore: [CI] Auto update document $(date +%Y%m%d-%H%M%S)" \
7272
--body "This PR was automatically generated.$TRIGGERED_PUSH_URL" \
7373
--base develop \
74-
--head $BRANCH_NAME \
74+
--head "$BRANCH_NAME" \
7575
--label documentation

.github/workflows/update-poetry-lock.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Install Poetry
2121
run: |
2222
pip install poetry poetry-plugin-export
23-
echo "$HOME/.local/bin" >> $GITHUB_PATH
23+
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
2424
2525
- name: Update poetry.lock
2626
run: |
@@ -44,9 +44,9 @@ jobs:
4444
exit 0
4545
fi
4646
git commit -m "Auto update poetry.lock $(date +%Y%m%d-%H%M%S)" -a
47-
git push origin $BRANCH_NAME
47+
git push origin "$BRANCH_NAME"
4848
gh pr create --title "chore: [CI] Auto update poetry.lock $(date +%Y%m%d-%H%M%S)" \
4949
--body "This PR was automatically generated: $TRIGGERED_PUSH_URL" \
5050
--base develop \
51-
--head $BRANCH_NAME \
51+
--head "$BRANCH_NAME" \
5252
--label ci

.github/workflows/update_version.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@ jobs:
1616

1717
- name: Extract version from comment
1818
id: extract_version
19+
env:
20+
COMMENT_BODY: ${{ github.event.comment.body }}
1921
run: |
20-
echo "Requested comment: ${{ github.event.comment.body }}"
21-
VERSION=$(echo "${{ github.event.comment.body }}" | sed 's/update-version=//')
22+
echo "Requested comment: $COMMENT_BODY"
23+
VERSION="${COMMENT_BODY//update-version=}"
2224
echo "VERSION: $VERSION"
23-
echo "::set-output name=version::$VERSION"
25+
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
2426
2527
- name: Set up Python
2628
uses: actions/setup-python@v5
@@ -30,7 +32,7 @@ jobs:
3032
- name: Install Poetry
3133
run: |
3234
pip install poetry poetry-plugin-export
33-
echo "$HOME/.local/bin" >> $GITHUB_PATH
35+
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
3436
3537
- name: Update version in pyproject.toml
3638
run: |

0 commit comments

Comments
 (0)