Skip to content

Commit 889edbd

Browse files
authored
Merge branch 'develop' into tuning-local-test
2 parents 25b13bf + e805e31 commit 889edbd

File tree

7 files changed

+36
-6
lines changed

7 files changed

+36
-6
lines changed

.circleci/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ jobs:
2727
# Download and cache dependencies
2828
- restore_cache:
2929
keys:
30-
- v1-dependencies-{{ checksum "requirements.txt" }}
31-
- v1-dependencies-
30+
- v2-dependencies-{{ checksum "requirements.txt" }}
31+
- v2-dependencies-
3232

3333
- run:
3434
name: install dependencies
@@ -41,7 +41,7 @@ jobs:
4141
- save_cache:
4242
paths:
4343
- ./venv
44-
key: v1-dependencies-{{ checksum "requirements.txt" }}
44+
key: v2-dependencies-{{ checksum "requirements.txt" }}
4545

4646
- run:
4747
name: run checkstyle for python code

.envrc.sample

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
## すべてのサブシステムで同じ値を使う必要がある
55
export ALIS_APP_ID=foobar
66

7+
# CloudFormationで生成されたAPI GatewayのAPI ID
8+
# スクリプトから各APIに事後処理を行うために使用する
9+
# 現状、SAMがIAM認証をサポートしていないため
10+
# TODO: SAMがIAM認証をサポートしたらteplate.yamlに集約してこの値とスクリプトを除却する
11+
# - see: https://github.com/awslabs/serverless-application-model/issues/248
12+
export SERVERLESS_REST_API_ID=pe6odilrre
13+
714
# --- AWS ---
815

916
## aws-cli

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,12 @@ Specify generated Cognito User Pool ARN to SSM.
111111
./deploy.sh api
112112
python elasticsearch-setup.py YourGlobalIP
113113
```
114+
115+
### Fix API settings via a script
116+
117+
```bash
118+
# Set SERVERLESS_REST_API_ID to .envrc
119+
direnv edit
120+
121+
./fix_api.sh
122+
```

exec_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def copy_required_files(path):
2626
test_dir = path[:path.rfind('/')]
2727

2828
# テスト対象ソースを複製(対象ソースは tests 配下と同一構造の src ディレクトリ配下が対象)
29-
copy_tree(re.sub('^\./tmp_tests', './src', test_dir), test_dir)
29+
copy_tree(re.sub(r'^\./tmp_tests', './src', test_dir), test_dir)
3030

3131
# 共通ライブラリを複製
3232
copy_tree('./src/common', test_dir)

fix_api.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
3+
# Delete unnecessary Stage "Stage"
4+
# SAM's bug? https://github.com/awslabs/serverless-application-model/issues/168
5+
aws apigateway delete-stage --rest-api-id ${SERVERLESS_REST_API_ID} --stage-name Stage
6+
7+
# ---
8+
9+
# Enable logs
10+
aws apigateway update-stage --rest-api-id ${SERVERLESS_REST_API_ID} --stage-name 'api' --patch-operations op=replace,path=/*/*/logging/dataTrace,value=true
11+
aws apigateway update-stage --rest-api-id ${SERVERLESS_REST_API_ID} --stage-name 'api' --patch-operations op=replace,path=/*/*/logging/loglevel,value=INFO
12+
aws apigateway update-stage --rest-api-id ${SERVERLESS_REST_API_ID} --stage-name 'api' --patch-operations op=replace,path=/*/*/metrics/enabled,value=true

src/common/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
'type': 'string',
1414
'minLength': 3,
1515
'maxLength': 30,
16-
'pattern': '^(?!.*--)[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]$'
16+
'pattern': r'^(?!.*--)[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]$'
1717
},
1818
'phone_number': {
1919
'type': 'string',
2020
'minLength': 13,
2121
'maxLength': 13,
22-
'pattern': '^\+81[6-9]0\d{8}$'
22+
'pattern': r'^\+81[6-9]0\d{8}$'
2323
},
2424
'icon_image': {
2525
'type': 'string',

tests/handlers/me/articles/comments/create/test_me_articles_comments_create.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ def setUp(self):
1313
TestsUtil.set_all_tables_name_to_env()
1414
TestsUtil.delete_all_tables(self.dynamodb)
1515

16+
os.environ['SALT_FOR_ARTICLE_ID'] = 'test_salt'
17+
1618
self.article_info_table = self.dynamodb.Table(os.environ['ARTICLE_INFO_TABLE_NAME'])
1719
self.article_info_table_items = [
1820
{

0 commit comments

Comments
 (0)