Skip to content

Conversation

@NMai-source
Copy link
Collaborator

@NMai-source NMai-source commented Oct 26, 2021

  • 対応する Issue が Linked Issues に設定されていることを確認してください

対応内容

ライブラリ OneTimePassword の仕様検証
アルゴリズム、OTP桁数、タイムステップ数が変更できることの確認

スクリーンショット

before after
simulator_screenshot_D0F25097-0852-466E-95E7-6F20C702E273 simulator_screenshot_6AF1B2B5-D58D-4B7F-B643-237CFE4A532E

Closes #2

@ykws ykws added the enhancement New feature or request label Oct 26, 2021
@ykws
Copy link
Owner

ykws commented Oct 26, 2021

@NMai-source まだ作業中かもしれませんが、今後その場合は Draft として作成できるのでそのようにしてください。

レビューする前に、コンフリクトしているのでこれを解消する必要があります。
まずコミットの数が PR の内容に合っていないので、以下のいずれかの対応を試してみてください。

  1. この PR のマージ先を ykws:main ではなく ykws:feature/settings にする
  2. Feature/settings #7 の PR を main にマージする

これにより、 #7 の差分はこの PR の差分としては除外される想定になります。

@NMai-source
Copy link
Collaborator Author

@ykws
2の対応について、この場合のmainは自分のリポジトリのmainのことですか?
それともykws:mainにマージできるような操作方法がありますか?

@ykws
Copy link
Owner

ykws commented Oct 26, 2021

@NMai-source 失念していました。私のリポジトリなので、 #7 の PR に Merge ボタン表示されてなかったですよね?

Screen Shot 2021-10-27 at 0 01 36

今 Collaborator としてこのリポジトリに招待したので後ほど承認をお願いします。
先行して #7 はこちらでマージしました。

しかし、依然コンフリクトが残っているのとコミット数が多いので rebase をする必要がありそうです。

remote branch に upstream を追加してもらっていれば、 git fetch upstream && git rebase upstream/main できれいになる想定です。
#1 (comment)

@ykws
Copy link
Owner

ykws commented Oct 27, 2021

スクリーンショットの Markdown はこのように書くと視認性が高いです

| before | after |
|-------|------|
| ![image](https://user-images.githubusercontent.com/84489601/138899650-d98e4bd1-188f-436b-bc69-0819bb2a9015.png) | ![image](https://user-images.githubusercontent.com/84489601/138899342-597213bb-43c6-4ae2-8f71-c424a438563a.png) |
before after
image image

また Simulator のカメラアイコン(赤矢印)でスクリーンショットを撮影することができ、こちらだとスクリーンのみのキャプチャができます。
ショートカットキーは ⌘S です。 ⌘R で録画も開始できます。

Macのスクショ機能 Simulatorのスクショ機能
Screen Shot 2021-10-27 at 22 28 38 Simulator Screen Shot - iPhone 13 - 2021-10-27 at 22 28 40

@NMai-source
Copy link
Collaborator Author

リポジトリへの招待とマージありがとうございます。
git fetch upstream && git rebase upstream/mainを実行し、コンフリクトなくマージはできたのですが、
肝心の#2対応の修正部位のコミットがなくなってしまったので、確認し直します。
git histでログを見ていた際はコミットが残っているように見えたので、見逃してしまいました)

@NMai-source
Copy link
Collaborator Author

PRコメントについて、書き方を教えて頂きありがとうございます。
修正しました。

@ykws
Copy link
Owner

ykws commented Oct 28, 2021

肝心の#2対応の修正部位のコミットがなくなってしまったので、確認し直します。

確かに消えてますね。
NMai-source 側の main を rebase して feature-#2 として git push -f してしまえば良い気がします。
@NMai-source

@NMai-source
Copy link
Collaborator Author

NMai-source commented Oct 29, 2021

@ykws

NMai-source 側の main を rebase して feature-#2 として git push -f してしまえば良い気がします。

こちらの対応で修正分を盛り込んだ形でrebaseできました。

Copy link
Owner

@ykws ykws left a comment

Choose a reason for hiding this comment

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

must-badge

  • rename
  • アルゴリズム変更の反映
  • タイムステップ数変更の描画反映

next-badge

  • PR のタイトルは適切な内容で設定してほしいです。
  • 設定画面に戻ると毎回設定がリセットされてしまい使いづらいので、TOP画面と設定画面では同じ値を参照するようにして欲しいです。
    設定値はローカルに保存してしまっても良いと思います。

@NMai-source NMai-source changed the title Feature #2 アルゴリズム、OTP桁数、タイムステップ数が変更できることの確認対応 Nov 9, 2021
@NMai-source
Copy link
Collaborator Author

@ykws
お疲れ様です。
以下の指摘について、対応が完了しました。

rename
アルゴリズム変更の反映
タイムステップ数変更の描画反映
PR のタイトルは適切な内容で設定してほしいです。

以下の指摘についてはこれから修正予定です。

設定画面に戻ると毎回設定がリセットされてしまい使いづらいので、TOP画面と設定画面では同じ値を参照するようにして欲しいです。
設定値はローカルに保存してしまっても良いと思います。

Copy link
Owner

@ykws ykws left a comment

Choose a reason for hiding this comment

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

指摘事項対応されていることを確認できました!

LGTM

next-badge

コミットメッセージに以下のような記載は避けるようにしましょう。

PR指摘事項対応

後からログを見た時に PR を知らないでも変更の意図がわかるようになっているのが望ましいです。

if (_test1 != nil) {
self.token.algorithm = _test1;
self.scheduledTimerWithTimeInterval = 0.03f;
if (_algorithm != nil) {
Copy link
Owner

Choose a reason for hiding this comment

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

next-badge

元がそうなのですが、なるべく self を使うと良いです。


#import "ViewController.h"
#import "OneTimePassword.h"
#import "SettingController.h"
Copy link
Owner

Choose a reason for hiding this comment

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

nits-badge

ViewController から SettingController は見てないので、 import しなくて良いはずです。

self.token = [OTPToken tokenWithType:OTPTokenTypeTimer secret:secretData name:name issuer:issuer];
self.scheduledTimerWithTimeInterval = 0.03f;
if (_algorithm != nil) {
NSArray *OTPAlgorithmStrings = @[@"SHA1", @"SHA256", @"SHA512"];
Copy link
Owner

Choose a reason for hiding this comment

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

next-badge

この辺りは、 SettingController と冗長なので Model を利用して表現できると良いです。


_localProgress = newProgress;
[self.oneTimePasswordProgressView setProgress:_localProgress animated:NO];

Copy link
Owner

Choose a reason for hiding this comment

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

nits-badge

余計な空行はなるべく増やさないでおきましょう。


@implementation ViewController


Copy link
Owner

Choose a reason for hiding this comment

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

nits-badge

余計な空行はなるべく増やさないでおきましょう。


@property (nonatomic, assign) CGFloat localProgress;

@property (nonatomic) float scheduledTimerWithTimeInterval;
Copy link
Owner

Choose a reason for hiding this comment

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

nits-badge

逆に意図して入れてある空行は残しておくと良いです。


@property (weak, nonatomic) IBOutlet UILabel *oneTimePasswordLabel;
@property (weak, nonatomic) IBOutlet UAProgressView *oneTimePasswordProgressView;

Copy link
Owner

Choose a reason for hiding this comment

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

nits-badge

逆に意図して入れてある空行は残しておくと良いです。

#import <UIKit/UIKit.h>

@interface ViewController : UIViewController

Copy link
Owner

Choose a reason for hiding this comment

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

nits-badge

逆に意図して入れてある空行は残しておくと良いです。

self.token = [OTPToken tokenWithType:OTPTokenTypeTimer secret:secretData name:name issuer:issuer ];
self.token = [OTPToken tokenWithType:OTPTokenTypeTimer secret:secretData name:name issuer:issuer];
self.scheduledTimerWithTimeInterval = 0.03f;
if (_algorithm != nil) {
Copy link
Owner

Choose a reason for hiding this comment

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

また nil のケースは考慮したくないので、デフォルト値で初期化できておくと良いと思います。

Comment on lines +54 to +56
if([_period isEqualToString:@"60"]) {
self.scheduledTimerWithTimeInterval = 0.06f;
}
Copy link
Owner

Choose a reason for hiding this comment

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

imo-badge

文字列よりも intValue から算出可能なので、以下のように求めつつ、プロパティにせずに直接 NSTimer に渡しても良さそうです。

Suggested change
if([_period isEqualToString:@"60"]) {
self.scheduledTimerWithTimeInterval = 0.06f;
}
self.scheduledTimerWithTimeInterval = self.token.period / 1000;

@NMai-source NMai-source merged commit 57545f8 into ykws:main Nov 10, 2021
@ykws
Copy link
Owner

ykws commented Nov 11, 2021

@NMai-source f9456f5 マージコミットが含まれてしまっているので、可能ならこのタイミングで rebase をするとログがより見やすくなります。

練習用のリポジトリを用意したので、この辺りの感覚を掴んでもらえると嬉しいです。

https://github.com/ykws/git-rebase-example

@NMai-source
Copy link
Collaborator Author

@ykws
マージコミットについて承知いたしました。
練習用のリポジトリについて、練習してみようと思ってできていないので、
issueを進めるのと並行してやろうと思います。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ライブラリ OneTimePassword の仕様検証

2 participants