Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

楽観同時実行制御・認可を行うサンプルアプリ(Dressca Admin)を追加する #1741

Merged
merged 43 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
76801df
Dressca管理アプリ(バックエンド)の作成 (#1580)
kenjiyoshid-a Nov 20, 2024
07f910d
Merge branch 'main' into develop/admin/dressca-admin-main
KentaHizume Nov 25, 2024
36cea6c
PagedListOfCatalogItemResponseのフィールドに総ページ数、前ページの有無、後ページの有無を追加 (#1610)
kenjiyoshid-a Dec 16, 2024
f689341
管理アプリ(バックエンド)を策定したAPI仕様に沿って修正 (#1594)
kenjiyoshid-a Dec 18, 2024
0a56ce9
Dresscaに管理アプリ(フロントエンド)を追加する (#1582)
KentaHizume Dec 18, 2024
1c60362
アプリケーションサービス内の存在チェックをドメインサービスに移動する (#1720)
kenjiyoshid-a Dec 19, 2024
06347c8
(Dressca)Open API 仕様書の更新に追従する (#1721)
KentaHizume Dec 20, 2024
66f551e
Merge branch 'main' into develop/admin/dressca-admin-main
kenjiyoshid-a Dec 23, 2024
5aac1e2
dependabot.ymlの不要なバージョン更新検索を削除
kenjiyoshid-a Dec 23, 2024
1f2d916
登録用のカタログアイテムを作成するメソッドを追加
kenjiyoshid-a Dec 23, 2024
88139ee
WebApplicationTestのcontextLoadsクラスにDisplayNameを追記
kenjiyoshid-a Dec 25, 2024
a9a2f7c
DisplayNameのimport文を追記
kenjiyoshid-a Dec 25, 2024
1011279
web-adminとweb-consumerの不要なテストクラスを削除
kenjiyoshid-a Dec 25, 2024
1e745f5
モックのHTTPステータスコードについてaxiosから提供されるEnumを使用するように修正
KentaHizume Dec 26, 2024
ce747a5
フロントエンドの自動テストスイートを改善して[email protected]にアップデート
KentaHizume Dec 26, 2024
c808006
APIクライアントのステータスコードをEnumに修正
KentaHizume Dec 26, 2024
273f26d
自動生成された不要なREADMEファイルを削除
KentaHizume Dec 26, 2024
2de8cb2
CatalogApplicationServiceのカタログアイテムの一覧取得メソッドの命名をbyからforに変更
kenjiyoshid-a Dec 26, 2024
6f11d19
例外のmessageの抜けを修正
kenjiyoshid-a Dec 26, 2024
bfaf778
samples/web-csr/dressca-frontend/consumer/src/api-client/index.ts の競合を解決
KentaHizume Dec 26, 2024
51a4946
package-lock.jsonの競合を解決
KentaHizume Dec 26, 2024
8f61ec8
Revert "package-lock.jsonの競合を解決"
KentaHizume Dec 26, 2024
12d4125
Revert "samples/web-csr/dressca-frontend/consumer/src/api-client/inde…
KentaHizume Dec 26, 2024
501fb96
マージしたい対象をマージ元のブランチからcheckout
KentaHizume Dec 26, 2024
6366b27
競合を解決
KentaHizume Dec 26, 2024
393ffb1
競合を解決
KentaHizume Dec 26, 2024
42b196d
Revert "競合を解決"
KentaHizume Dec 26, 2024
1adc30f
Revert "競合を解決"
KentaHizume Dec 26, 2024
cd5fae3
Revert "マージしたい対象をマージ元のブランチからcheckout"
KentaHizume Dec 26, 2024
a36b8cb
Adminでは使っていないため、すべてのカテゴリ・ブランドを表すレコードを追加する処理を削除。
KentaHizume Dec 26, 2024
892d13f
コメントの誤りを修正
KentaHizume Dec 26, 2024
29de45a
Merge branch 'main' into develop/admin/dressca-admin-main
kenjiyoshid-a Dec 27, 2024
6b77165
メッセージ管理方針の変更をadminに取り込み
kenjiyoshid-a Dec 27, 2024
8ca1cf8
API クライアントの設定ファイルの競合箇所を main から checkout して再修正
KentaHizume Dec 27, 2024
f390085
一度 main のpackage-lock.json をcheckoutして戻します。
KentaHizume Dec 27, 2024
e3883ef
admin 分のパッケージをpackage-lock.jsonに記録します
KentaHizume Dec 27, 2024
0eacdba
ログメッセージの誤記を修正
KentaHizume Dec 27, 2024
00cda51
Javaファイルの不要な空行を削除
kenjiyoshid-a Jan 6, 2025
ae31f26
AssetsControllerの不要な空行を削除
kenjiyoshid-a Jan 6, 2025
352b632
ログ出力のフォーマットが崩れている部分の修正
kenjiyoshid-a Jan 6, 2025
40c9435
Merge branch 'main' into develop/admin/dressca-admin-main
kenjiyoshid-a Jan 7, 2025
f47b44e
管理アプリにconsumerの変更を反映
kenjiyoshid-a Jan 7, 2025
d56519a
管理アプリのフロントエンドのCIについて明示的に権限を付与するように修正
kenjiyoshid-a Jan 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 2 additions & 74 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,67 +51,7 @@ updates:
interval: "daily"
open-pull-requests-limit: 20
commit-message:
prefix: "gradle-root"
labels:
- "target: Dressca"
- "gradle"
- "dependencies"

- package-ecosystem: "gradle"
directory: "/samples/web-csr/dressca-backend/application-core"
schedule:
interval: "daily"
open-pull-requests-limit: 20
commit-message:
prefix: "gradle-application-core"
labels:
- "target: Dressca"
- "gradle"
- "dependencies"

- package-ecosystem: "gradle"
directory: "/samples/web-csr/dressca-backend/batch"
schedule:
interval: "daily"
open-pull-requests-limit: 20
commit-message:
prefix: "gradle-batch"
labels:
- "target: Dressca"
- "gradle"
- "dependencies"

- package-ecosystem: "gradle"
directory: "/samples/web-csr/dressca-backend/infrastructure"
schedule:
interval: "daily"
open-pull-requests-limit: 20
commit-message:
prefix: "gradle-infrastructure"
labels:
- "target: Dressca"
- "gradle"
- "dependencies"

- package-ecosystem: "gradle"
directory: "/samples/web-csr/dressca-backend/system-common"
schedule:
interval: "daily"
open-pull-requests-limit: 20
commit-message:
prefix: "gradle-system-common"
labels:
- "target: Dressca"
- "gradle"
- "dependencies"

- package-ecosystem: "gradle"
directory: "/samples/web-csr/dressca-backend/web"
schedule:
interval: "daily"
open-pull-requests-limit: 20
commit-message:
prefix: "gradle-web"
prefix: "gradle-dressca-backend"
labels:
- "target: Dressca"
- "gradle"
Expand All @@ -136,19 +76,7 @@ updates:
interval: "daily"
open-pull-requests-limit: 20
commit-message:
prefix: "gradle-auth-root"
labels:
- "target: Azure AD B2C Auth"
- "gradle"
- "dependencies"

- package-ecosystem: "gradle"
directory: "/samples/azure-ad-b2c-sample/auth-backend/web"
schedule:
interval: "daily"
open-pull-requests-limit: 20
commit-message:
prefix: "gradle-auth-web"
prefix: "gradle-auth-backend"
labels:
- "target: Azure AD B2C Auth"
- "gradle"
Expand Down
80 changes: 64 additions & 16 deletions .github/workflows/check-openapi-generator-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,27 +38,38 @@ jobs:
- name: 現在のOpenAPI Generatorのバージョン取得
id: get-current-openapi-generator-version
run: |
echo "current-version=$(jq -r '.["generator-cli"].version' ./samples/web-csr/dressca-frontend/consumer/openapitools.json)" >> $GITHUB_OUTPUT
echo "current-version-consumer=$(jq -r '.["generator-cli"].version' ./samples/web-csr/dressca-frontend/consumer/openapitools.json)" >> $GITHUB_OUTPUT
echo "current-version-admin=$(jq -r '.["generator-cli"].version' ./samples/web-csr/dressca-frontend/admin/openapitools.json)" >> $GITHUB_OUTPUT

- name: アップデート要否を判定
id: check-version-update
run: |
if [[ ${{ steps.get-latest-openapi-generator-version.outputs.latest-version }} == ${{ steps.get-current-openapi-generator-version.outputs.current-version }} ]]; then
echo "update-required=false" >> $GITHUB_OUTPUT
if [[ ${{ steps.get-latest-openapi-generator-version.outputs.latest-version }} == ${{ steps.get-current-openapi-generator-version.outputs.current-version-consumer }} ]]; then
echo "update-required-consumer=false" >> $GITHUB_OUTPUT
else
echo "update-required=true" >> $GITHUB_OUTPUT
echo "update-required-consumer=true" >> $GITHUB_OUTPUT
fi
if [[ ${{ steps.get-latest-openapi-generator-version.outputs.latest-version }} == ${{ steps.get-current-openapi-generator-version.outputs.current-version-admin }} ]]; then
echo "update-required-admin=false" >> $GITHUB_OUTPUT
else
echo "update-required-admin=true" >> $GITHUB_OUTPUT
fi

- name: サマリに出力
run: |
echo "# 確認結果" >> $GITHUB_STEP_SUMMARY
echo "openapi-generator のバージョンは ${{ steps.get-latest-openapi-generator-version.outputs.latest-version }} です。" >> $GITHUB_STEP_SUMMARY
echo "openapitools.json の openapi-generator のバージョンは ${{ steps.get-current-openapi-generator-version.outputs.current-version }} です。" >> $GITHUB_STEP_SUMMARY
echo "アップデート要否の判定結果は ${{ steps.check-version-update.outputs.update-required }} です。">> $GITHUB_STEP_SUMMARY
echo "## Dressca-Consumer" >> $GITHUB_STEP_SUMMARY
Fixed Show fixed Hide fixed
echo "openapitools.json の openapi-generator のバージョンは ${{ steps.get-current-openapi-generator-version.outputs.current-version-consumer }} です。" >> $GITHUB_STEP_SUMMARY
echo "アップデート要否の判定結果は ${{ steps.check-version-update.outputs.update-required-consumer }} です。">> $GITHUB_STEP_SUMMARY
echo "## Dressca-Admin" >> $GITHUB_STEP_SUMMARY
echo "openapitools.json の openapi-generator のバージョンは ${{ steps.get-current-openapi-generator-version.outputs.current-version-admin }} です。" >> $GITHUB_STEP_SUMMARY
echo "アップデート要否の判定結果は ${{ steps.check-version-update.outputs.update-required-admin }} です。">> $GITHUB_STEP_SUMMARY

- name: issue を作成
id: create-issue
if: ${{ steps.check-version-update.outputs.update-required == 'true' }}

- name: issue を作成(Dressca-Consumer)
id: create-issue-consumer
if: ${{ steps.check-version-update.outputs.update-required-consumer == 'true' }}
uses: Wandalen/wretry.action@master
with:
action: dblock/create-a-github-issue@v3
Expand All @@ -72,17 +83,17 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TARGET_APP_NAME: "Dressca-Consumer"
LATEST_VERSION: ${{ steps.get-latest-openapi-generator-version.outputs.latest-version }}
CURRENT_VERSION: ${{ steps.get-current-openapi-generator-version.outputs.current-version }}
CURRENT_VERSION: ${{ steps.get-current-openapi-generator-version.outputs.current-version-consumer }}


- name: issue の情報を出力
if: ${{ steps.check-version-update.outputs.update-required == 'true' }}
- name: issue の情報を出力(Dressca-Consumer)
if: ${{ steps.check-version-update.outputs.update-required-consumer == 'true' }}
env:
STATUS: ${{ steps.create-issue.outputs.outputs && fromJson(steps.create-issue.outputs.outputs).status }}
ISSUE_NUMBER: ${{ steps.create-issue.outputs.outputs && fromJson(steps.create-issue.outputs.outputs).number }}
ISSUE_URL: ${{ steps.create-issue.outputs.outputs && fromJson(steps.create-issue.outputs.outputs).url }}
STATUS: ${{ steps.create-issue-consumer.outputs.outputs && fromJson(steps.create-issue-consumer.outputs.outputs).status }}
ISSUE_NUMBER: ${{ steps.create-issue-consumer.outputs.outputs && fromJson(steps.create-issue-consumer.outputs.outputs).number }}
ISSUE_URL: ${{ steps.create-issue-consumer.outputs.outputs && fromJson(steps.create-issue-consumer.outputs.outputs).url }}
run: |
echo "# issue の作成結果" >> $GITHUB_STEP_SUMMARY
echo "# issue の作成結果(Dressca-Consumer)" >> $GITHUB_STEP_SUMMARY
if [ $STATUS = 'created' ]; then
echo "issue を新規作成しました。" >> $GITHUB_STEP_SUMMARY
elif [ $STATUS = 'updated' ]; then
Expand All @@ -93,3 +104,40 @@ jobs:
echo issue number: $ISSUE_NUMBER >> $GITHUB_STEP_SUMMARY
echo status: $STATUS >> $GITHUB_STEP_SUMMARY
echo - $ISSUE_URL >> $GITHUB_STEP_SUMMARY

- name: issue を作成(Dressca-Admin)
id: create-issue-admin
if: ${{ steps.check-version-update.outputs.update-required-admin == 'true' }}
uses: Wandalen/wretry.action@master
Fixed Show fixed Hide fixed
with:
action: dblock/create-a-github-issue@v3
with: |
filename: ./.github/ISSUE_TEMPLATE/99-openapi-generator-update-issue.md
update_existing: true
search_existing: open
attempt_limit: 3
attempt_delay: 300000
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TARGET_APP_NAME: "Dressca-Admin"
LATEST_VERSION: ${{ steps.get-latest-openapi-generator-version.outputs.latest-version }}
CURRENT_VERSION: ${{ steps.get-current-openapi-generator-version.outputs.current-version-admin }}

- name: issue の情報を出力(Dressca-Admin)
if: ${{ steps.check-version-update.outputs.update-required-admin == 'true' }}
env:
STATUS: ${{ steps.create-issue-admin.outputs.outputs && fromJson(steps.create-issue-admin.outputs.outputs).status }}
ISSUE_NUMBER: ${{ steps.create-issue-admin.outputs.outputs && fromJson(steps.create-issue-admin.outputs.outputs).number }}
ISSUE_URL: ${{ steps.create-issue-admin.outputs.outputs && fromJson(steps.create-issue-admin.outputs.outputs).url }}
run: |
echo "# issue の作成結果(Dressca-Admin)" >> $GITHUB_STEP_SUMMARY
if [ $STATUS = 'created' ]; then
echo "issue を新規作成しました。" >> $GITHUB_STEP_SUMMARY
elif [ $STATUS = 'updated' ]; then
echo "同名の issue が存在するため、更新のみ行いました。" >> $GITHUB_STEP_SUMMARY
else
echo "ステータスの値が不正です。" >> $GITHUB_STEP_SUMMARY
tsuna-can-se marked this conversation as resolved.
Show resolved Hide resolved
fi
echo issue number: $ISSUE_NUMBER >> $GITHUB_STEP_SUMMARY
echo status: $STATUS >> $GITHUB_STEP_SUMMARY
echo - $ISSUE_URL >> $GITHUB_STEP_SUMMARY
93 changes: 93 additions & 0 deletions .github/workflows/samples-dressca-admin-frontend.ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
---

name: dressca-admin-frontend CI

on:
pull_request:
branches: [main]
paths:
- 'samples/web-csr/dressca-frontend/*.*'
- 'samples/web-csr/dressca-frontend/admin/**'
- '.github/workflows/samples-dressca-admin-frontend.ci.yml'
workflow_dispatch:

defaults:
run:
working-directory: samples/web-csr/dressca-frontend/

jobs:
build:
name: Dressca 管理のフロントエンドアプリケーションのビルド
runs-on: ubuntu-latest
env:
NO_COLOR: "1" # 文字化け防止のためカラーコードを出力しない
strategy:
matrix:
node-version: [20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- uses: actions/cache@v4
id: node_modules_cache_id
env:
cache-name: cache-node-modules
with:
path: '**/node_modules'
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}

- name: node パッケージのキャッシュ確認
run: echo '${{ toJSON(steps.node_modules_cache_id.outputs) }}'

- name: node パッケージのインストール
if: ${{ steps.node_modules_cache_id.outputs.cache-hit != 'true' }}
run: npm ci

- id: run-lint
name: lintの実行
run: npm run lint:ci:admin >> /var/tmp/lint-result.txt 2>&1

- id: run-type-check
name: TypeScript の型チェック
run: npm run type-check:admin >> /var/tmp/type-check-result.txt 2>&1

- id: application-build
name: アプリケーションのビルド
run: npm run build-only:dev:admin >> /var/tmp/build-result.txt 2>&1

- id: run-unit-tests
name: 単体テストの実行
run: npm run test:unit:admin >> /var/tmp/unit-test-result.txt 2>&1

- name: lintの結果出力
if: ${{ success() || (failure() && steps.run-lint.conclusion == 'failure') }}
uses: ./.github/workflows/file-to-summary
with:
body: /var/tmp/lint-result.txt
header: 'lintの結果 :pen:'

- name: 型チェックの結果出力
if: ${{ success() || (failure() && steps.run-type-check.conclusion == 'failure') }}
uses: ./.github/workflows/file-to-summary
with:
body: /var/tmp/type-check-result.txt
header: '型チェックの結果 :pencil2:'

- name: ビルドの結果出力
if: ${{ success() || (failure() && steps.application-build.conclusion == 'failure') }}
uses: ./.github/workflows/file-to-summary
with:
body: /var/tmp/build-result.txt
header: 'ビルドの結果 :gear:'

- name: 単体テストの結果出力
if: ${{ success() || (failure() && steps.run-unit-tests.conclusion == 'failure') }}
uses: ./.github/workflows/file-to-summary
with:
body: /var/tmp/unit-test-result.txt
header: '単体テストの結果 :memo:'
Fixed Show fixed Hide fixed
17 changes: 14 additions & 3 deletions samples/web-csr/dressca-backend/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,23 @@
"configurations": [
{
"type": "java",
"name": "Spring Boot-WebApplication<web>",
"name": "Spring Boot-WebApplication<consumer>",
"request": "launch",
"cwd": "${workspaceFolder}",
"console": "internalConsole",
"mainClass": "com.dressca.web.WebApplication",
"projectName": "web",
"mainClass": "com.dressca.web.consumer.WebApplication",
"projectName": "web-consumer",
"args": "",
"envFile": "${workspaceFolder}/.env"
},
{
"type": "java",
"name": "Spring Boot-WebApplication<admin>",
"request": "launch",
"cwd": "${workspaceFolder}",
"console": "internalConsole",
"mainClass": "com.dressca.web.admin.WebApplication",
"projectName": "web-admin",
"args": "",
"envFile": "${workspaceFolder}/.env"
},
Expand Down
Loading
Loading