Develop/v2.1.0 #5
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
このプルリクエストは、Google Apps Scriptプロジェクトにおける変更ログの登録と送信のワークフローをリファクタリングするものです。主な改善点は、変更ログを保存するロジックとGoogle Chatに送信するロジックを分離したことで、プロセスがより明確になり、保守性が向上しました。これらの変更を反映して、UIとメニューオプションも更新されています。
ワークフローとUIの改善点:
changesInput.htmlのサイドバーボタンと関連する関数名が「出版」から「保存」に変更され、呼び出される関数もsendChanges()からsaveChanges()に変更されました。ステータスメッセージとボタンラベルも、この用語に合わせて変更されています。([[1]](https://github.com/pasububook/g-spreadsheetPublishBot/pull/5/files#diff-61f13dd6377a4cd50953b461feff16185dc4a4147eaf6dd28219570df861dad0L54-R63)、[[2]](https://github.com/pasububook/g-spreadsheetPublishBot/pull/5/files#diff-61f13dd6377a4cd50953b461feff16185dc4a4147eaf6dd28219570df861dad0L80-R88)、[[3]](https://github.com/pasububook/g-spreadsheetPublishBot/pull/5/files#diff-61f13dd6377a4cd50953b461feff16185dc4a4147eaf6dd28219570df861dad0L97-R97))main.gsのカスタムメニューには、変更ログを保存するための「変更内容を登録」と、送信するための「Google Chatに送信」が追加され、それぞれに対応する関数がマッピングされています。 ([main.gsL1-R58](https://github.com/pasububook/g-spreadsheetPublishBot/pull/5/files#diff-327e5a22a4dcc64c0d73a6154a631ff95775b5d1596bc6f05725f36243e48511L1-R58))バックエンドロジックの変更点:
main.gsに新しく追加されたsaveCommitRevision関数は、変更ログエントリを.changelogシートに保存します。保存される情報には、タイムスタンプ、編集者のメールアドレス、変更内容、およびマージ済みフラグが含まれます。([main.gsL1-R58](https://github.com/pasububook/g-spreadsheetPublishBot/pull/5/files#diff-327e5a22a4dcc64c0d73a6154a631ff95775b5d1596bc6f05725f36243e48511L1-R58))getChangelogs関数は、.changelogシートからマージされていない変更ログを取得し、マージ状態を更新します。([main.gsL1-R58](https://github.com/pasububook/g-spreadsheetPublishBot/pull/5/files#diff-327e5a22a4dcc64c0d73a6154a631ff95775b5d1596bc6f05725f36243e48511L1-R58))mergeMain関数によって処理されるようになりました。この関数は、変更ログを取得し、.configファイルのバージョン番号を更新し、処理の一環としてキャッシュシートを削除します。 ([main.gsR71-R83](https://github.com/pasububook/g-spreadsheetPublishBot/pull/5/files#diff-327e5a22a4dcc64c0d73a6154a631ff95775b5d1596bc6f05725f36243e48511R71-R83))これらの変更により、責任範囲を明確に分離し、ユーザーインターフェースを改善することで、変更ログの登録と送信プロセスがより堅牢になり、メンテナンスも容易になります。