Skip to content

feat: implement Presentation layer for User Login and introduce mago lint / ユーザーログインのPresentation層実装とmago lint導入#534

Merged
zigzagdev merged 9 commits into
feat/user-loginfrom
feat/user-login_presentation-layer
Jul 14, 2026
Merged

feat: implement Presentation layer for User Login and introduce mago lint / ユーザーログインのPresentation層実装とmago lint導入#534
zigzagdev merged 9 commits into
feat/user-loginfrom
feat/user-login_presentation-layer

Conversation

@zigzagdev

Copy link
Copy Markdown
Owner

Motivation / 目的

Implement the Presentation layer for the User Login API (#405) and introduce mago as a static analysis tool for CI.

ユーザーログインAPI(#405)のPresentation層を実装し、静的解析ツールとしてmago lintをCIに導入しました。

What I have done / 実施内容

Presentation layer

  • AuthController: POST /api/v1/user/login のアクションを実装
    • 正常時: 200 + { token, token_type: "Bearer" }
    • 認証失敗時: 401
    • その他エラー: 500
  • routes/api.php: /v1/user/login ルートを登録、Route::controller() でルートをグループ化

Static Analysis

  • mago.toml: lintベースの静的解析設定を追加
    • スコープ: app, config, database, routes
    • セキュリティ・バグ系ルールを有効化、スタイル系は無効化
  • .github/workflows/static_analysis.yml: PR時に mago lint を実行するCIワークフローを追加

Other

  • .gitignore: .composer を追加(Dockerコンテナが生成するキャッシュを除外)

Test Results / テスト結果

Integration tests hitting the real DB:

  • test_login_returns_200_with_token_on_valid_credentials
  • test_login_returns_401_when_user_not_found
  • test_login_returns_401_on_wrong_password

Closes #528

@codecov

codecov Bot commented Jul 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.64%. Comparing base (f382085) to head (16fc4df).
⚠️ Report is 10 commits behind head on feat/user-login.

Additional details and impacted files

Impacted file tree graph

@@                  Coverage Diff                  @@
##             feat/user-login     #534      +/-   ##
=====================================================
+ Coverage              61.22%   61.64%   +0.42%     
- Complexity              1569     1581      +12     
=====================================================
  Files                    129      131       +2     
  Lines                   8048     8138      +90     
=====================================================
+ Hits                    4927     5017      +90     
  Misses                  3121     3121              
Files with missing lines Coverage Δ
...ures/CommandUseCases/UseCase/User/LoginUseCase.php 100.00% <ø> (ø)
...pp/Packages/Features/Controller/AuthController.php 100.00% <100.00%> (ø)
src/app/Packages/Features/Tests/LoginTest.php 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

- Narrow source path to app/Packages only
- Disable false-positive rules: no-literal-password, no-empty, no-nested-ternary, prefer-first-class-callable, block-statement, class-name
- Raise cyclomatic-complexity threshold to 60, excessive-parameter-list to 25, too-many-methods to 30

@zigzagdev zigzagdev left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zigzagdev
zigzagdev merged commit 01ba6d8 into feat/user-login Jul 14, 2026
27 checks passed
@zigzagdev
zigzagdev deleted the feat/user-login_presentation-layer branch July 14, 2026 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: implement Presentation layer for User Login / ユーザーログインのPresentation層実装

1 participant