georepublic / miyamoto Goto Github PK
View Code? Open in Web Editor NEWThis project forked from masuidrive/miyamoto
Google Apps Scriptで書かれたSlack用勤怠管理Botの「みやもとさん」
This project forked from masuidrive/miyamoto
Google Apps Scriptで書かれたSlack用勤怠管理Botの「みやもとさん」
Display alert when the working time exceeds a certain time than regular working time on the working time report.
Is your feature request related to a problem? Please describe.
Daily notification remains for the members who left Georepublic already. (thibault, iosefa, leo and marc)
Describe the solution you'd like
Change setting? I cannot find the list of username
.
Describe alternatives you've considered
none
Additional context
none
The columns for start and end times and break times can be better formatted. Right now I am manually formatting them to time
and duration
. This makes it easier to perform calculations, like the number of hours and minutes worked in a day.
The previous timesheet had a column called I worked today on [projects,tasks]
.
Current bot not support that kind of function.
Currently, break XX mins
overwrite existence break time, but always accumulating past values (in a head) is a bit difficult, and I like declarative break times than accumulated ones, so it may be better to support default accumulative break times.
Here is my idea.
# Initial break
break 10 mins
> @foo I changed break time to 10 mins
# Accumulate break times
break 20 mins
> @foo I changed break time to 30 mins
# Overwrite break times by "set" keyword
break 120 mins set
> @foo I changed break time to 120 mins
Mentioned by iosefa.
hmm… is there a way to start and stop the timer multiple times during a day? It seems that you can only start the timer once and then stop it once for the day. I will often work for a few hours, then take a break, then work for more hours … I sometimes cannot accurately anticipate how long my breaks will be. I.e. a pause feature would be nice
Describe the bug
Deploy CI failed during make upload
with SyntaxError: Unexpected token < in JSON at position 0
error from #57 commit.
https://github.com/Georepublic/miyamoto/actions/runs/4201622444/jobs/7288808913
To Reproduce
Run make upload
.
Expected behavior
The error should not be happen and Google App Script should be updated.
Slack does not recommend to use Outgoing/Incoming webhooks. It is a legacy method.
You can see additional information here.
https://api.slack.com/legacy/custom-integrations/outgoing-webhooks
It is good to use toLowerCase() before checking.
I find it nice to be able to manually trigger the timer to pause and resume. To this end, we could add pause
and resume
commands. For example, a command flow could look like:
morning
: starts the timer for the day (at the current time)
pause
: pauses the timer (the beginning of a break)
resume
: resumes the timer (the end of a break)
bye
: stops the timer for the day (at the current time.
This can be done with the option to specify breaks as well (or automatically including them --> see #21 ).
The bot doesn't work if the end
time exceeds midnight.
Some of the data contain logical errors for example:
It is good to send warnings from the bot once a day.
The previous time tracking sheet had a column named How was your day?
to track people's feelings.
It sas a good idea but this bot doesn't support such function.
For calculating over working time fee.
Describe the bug
:curry:
emoji is detected as “bye”. (Reported by @madmaid)
To Reproduce
Type break 30 mins (:curry:)
in Slack.
Expected behavior
:curry:
emoji should not be detected as “bye”.
We need to create a summary of each staffs tracked time.
I am thinking to use Google BigQuery.
Is your feature request related to a problem? Please describe.
From the following GitHub Actions workflow, Node.js v12 seems to be assumed to be used,
https://github.com/Georepublic/miyamoto/blob/master/.github/workflows/nodejs.yml
but v12 security support was already ended at 2022-04-30.
https://endoflife.date/nodejs
v16 security support will be ended at 2023-09-11, so supporting v18 is preferable to avoid security risk.
Describe the solution you'd like
Upgrade Node.js from v12 to v18 with CI.
it seems the work_time doesn't contain break_time.
Currently, the following Miyamoto-san's notices are posted at 11:50 JST everyday, but it may be good to hide such maintenance notices.
最新のみやもとさんの準備ができました!
https://github.com/masuidrive/miyamoto/blob/master/UPDATE.md を読んでください。
# 私の成長記録
## 20141027.0
- アップデートメッセージが消えない問題が直りました。ごめんなさい。
## 20141022.0
- アップデートチェックが直りました。
- アップデート内容をお伝えします!
## 20141021.0
- 日付がよく分からなくなっていたのですが、ちゃんと勉強しました。
## 20141019.0
- migrateを修正
- 一般公開
## 20141016.1
- テストの為にバージョンアップ
## 20141016.0
− テスト公開
We have to think about non-full time workers.
It's good to get the URL of the spreadsheet in easy way.
By saying spreadsheet
, bot should return the URL of the spreadsheet.
There may be time sheet inconsistencies at times. For example:
Work start: 14:00 24/02/2020
Work end: 13:30 24/02/2020
Highlighting these in the Excel sheet may be useful. Or just preventing this in the first place.
Describe the bug
Some "timesheets - Timesheets" tests fail in Node.js 12, 16 and 18 environments.
(The following is Node.js v16 case output.)
% make test
node testrunner.js
(node:11113) Warning: Accessing non-existent property 'VERSION' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:11115) Warning: Accessing non-existent property 'VERSION' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:11114) Warning: Accessing non-existent property 'VERSION' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:11116) Warning: Accessing non-existent property 'VERSION' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
Assertions:
┌────────────────┬────────────────────────┬──────────────────────────┬────────┐
│ Module │ Test │ Assertion │ Result │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ event_listener │ EventListener │ │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ date_utils │ DateUtils.parseTime │ 13:01 │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ 2:02pm │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ 午後4:3 │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ 5pm │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ 5:1pm │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ 18時 │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ 19 : 20 │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ 午後8 │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ お昼 │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ DateUtils.parseMinutes │ 90分 │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ 90 minutes │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ 90 mins │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ 1 minute │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ 90 mins │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ 1.5時間 │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ 1時間 │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ 1 hour │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ 60分 │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ 2 hours │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ 2時間15分 │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ DateUtils.parseDate │ 12/1 │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ 1/1 │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ 2月3日 │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ 2020/1/1 │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ 1976年2月8日 │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ 昨日 │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ 今日 │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ 明日 │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ 1/1 │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ 昨日 │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ 今日 │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ 明日 │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ 3日後 │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ DateUtils.parseWday │ 水曜日 │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ Wed │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ あ │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ 月日 │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ timesheets │ Timesheets │ test1:おはよう │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ test1:おはよう 4:56 │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ test1:おはよう 4:56 2/3 │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ test1:おはよう │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ test1:おはよう 4:56 │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ test1:おつ │ fail │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ test1:お疲れさま 14:56 │ fail │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ test1:お疲れさま 16:23 12/3 │ fail │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ test1:おつ │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ test1:お疲れさま 14:56 │ fail │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ test1:おつ │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ test1:お疲れさま 14:56 │ fail │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ test1:休憩 30分 │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ test1:休憩 30分 │ fail │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ test1:お休み │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ test1:今日はお休み │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ test1:明日はお休み │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ test1:12/3はお休みでした │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ test1:お休みしません │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ test1:今日はお休みしません │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ test1:明日はお休みしません │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ test1:誰がいる? │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ test1:誰がいる? │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ test1:誰がいる? │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ test1:誰がいる? │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ test1:誰がいる? │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ test1:誰がお休み? │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ test1:誰がお休み? │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ test1:誰がお休み? │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ test1:誰がお休み? │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ test1:誰がお休み? │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ test1:__confirmSignIn__ │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ test1:__confirmSignIn__ │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ test1:__confirmSignIn__ │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ test1:__confirmSignOut__ │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ test1:__confirmSignOut__ │ ok │
├────────────────┼────────────────────────┼──────────────────────────┼────────┤
│ │ │ test1:__confirmSignOut__ │ ok │
└────────────────┴────────────────────────┴──────────────────────────┴────────┘
Summary:
┌────────────────────────────────────────────────────┬────────┬────────┬───────┬─────────┐
│ File │ Failed │ Passed │ Total │ Runtime │
├────────────────────────────────────────────────────┼────────┼────────┼───────┼─────────┤
│ ...republic/git/miyamoto/scripts/event_listener.js │ 0 │ 3 │ 3 │ 87 │
├────────────────────────────────────────────────────┼────────┼────────┼───────┼─────────┤
│ .../georepublic/git/miyamoto/scripts/timesheets.js │ 6 │ 31 │ 37 │ 91 │
├────────────────────────────────────────────────────┼────────┼────────┼───────┼─────────┤
│ .../georepublic/git/miyamoto/scripts/date_utils.js │ 0 │ 37 │ 37 │ 90 │
└────────────────────────────────────────────────────┴────────┴────────┴───────┴─────────┘
Errors:
Module: timesheets Test: Timesheets
test1:おつ
at msgTest (/Users/sanak/Projects/georepublic/git/miyamoto/tests/timesheets_test.js:78:12)
at /Users/sanak/Projects/georepublic/git/miyamoto/tests/timesheets_test.js:84:7
at /Users/sanak/Projects/georepublic/git/miyamoto/tests/timesheets_test.js:125:5
at storageTest (/Users/sanak/Projects/georepublic/git/miyamoto/tests/timesheets_test.js:82:5)
at Object.<anonymous> (/Users/sanak/Projects/georepublic/git/miyamoto/tests/timesheets_test.js:124:3)
Module: timesheets Test: Timesheets
test1:お疲れさま 14:56
at msgTest (/Users/sanak/Projects/georepublic/git/miyamoto/tests/timesheets_test.js:78:12)
at /Users/sanak/Projects/georepublic/git/miyamoto/tests/timesheets_test.js:84:7
at /Users/sanak/Projects/georepublic/git/miyamoto/tests/timesheets_test.js:126:5
at storageTest (/Users/sanak/Projects/georepublic/git/miyamoto/tests/timesheets_test.js:82:5)
at Object.<anonymous> (/Users/sanak/Projects/georepublic/git/miyamoto/tests/timesheets_test.js:124:3)
Module: timesheets Test: Timesheets
test1:お疲れさま 16:23 12/3
at msgTest (/Users/sanak/Projects/georepublic/git/miyamoto/tests/timesheets_test.js:78:12)
at /Users/sanak/Projects/georepublic/git/miyamoto/tests/timesheets_test.js:84:7
at /Users/sanak/Projects/georepublic/git/miyamoto/tests/timesheets_test.js:127:5
at storageTest (/Users/sanak/Projects/georepublic/git/miyamoto/tests/timesheets_test.js:82:5)
at Object.<anonymous> (/Users/sanak/Projects/georepublic/git/miyamoto/tests/timesheets_test.js:124:3)
Module: timesheets Test: Timesheets
test1:お疲れさま 14:56
at msgTest (/Users/sanak/Projects/georepublic/git/miyamoto/tests/timesheets_test.js:78:12)
at /Users/sanak/Projects/georepublic/git/miyamoto/tests/timesheets_test.js:84:7
at /Users/sanak/Projects/georepublic/git/miyamoto/tests/timesheets_test.js:135:5
at storageTest (/Users/sanak/Projects/georepublic/git/miyamoto/tests/timesheets_test.js:82:5)
at Object.<anonymous> (/Users/sanak/Projects/georepublic/git/miyamoto/tests/timesheets_test.js:133:3)
Module: timesheets Test: Timesheets
test1:お疲れさま 14:56
at msgTest (/Users/sanak/Projects/georepublic/git/miyamoto/tests/timesheets_test.js:78:12)
at /Users/sanak/Projects/georepublic/git/miyamoto/tests/timesheets_test.js:84:7
at /Users/sanak/Projects/georepublic/git/miyamoto/tests/timesheets_test.js:143:5
at storageTest (/Users/sanak/Projects/georepublic/git/miyamoto/tests/timesheets_test.js:82:5)
at Object.<anonymous> (/Users/sanak/Projects/georepublic/git/miyamoto/tests/timesheets_test.js:141:3)
Module: timesheets Test: Timesheets
test1:休憩 30分
at msgTest (/Users/sanak/Projects/georepublic/git/miyamoto/tests/timesheets_test.js:78:12)
at /Users/sanak/Projects/georepublic/git/miyamoto/tests/timesheets_test.js:84:7
at /Users/sanak/Projects/georepublic/git/miyamoto/tests/timesheets_test.js:157:5
at storageTest (/Users/sanak/Projects/georepublic/git/miyamoto/tests/timesheets_test.js:82:5)
at Object.<anonymous> (/Users/sanak/Projects/georepublic/git/miyamoto/tests/timesheets_test.js:156:3)
{
files: 3,
assertions: 77,
failed: 6,
passed: 71,
runtime: 268,
tests: 6,
coverage: {
files: 0,
statements: { covered: 0, total: 0 },
branches: { covered: 0, total: 0 },
functions: { covered: 0, total: 0 },
lines: { covered: 0, total: 0 }
}
}
To Reproduce
Run make test
after executing npm install
.
Expected behavior
All tests should pass.
Is your feature request related to a problem? Please describe.
Currently, break xx (mins|hours)
doesn't detect specific day, although hi
and bye
support it.
Describe the solution you'd like
Support break time at specific day. (ex: bye 30 mins 2/27
)
This is related with #10 (Time zone support), but sometimes, specifying break at specific day is necessary, so I am thinking to support this before #10.
Describe the bug
doPost
can not handle the Slack's Event Subscriptions
because of invalid api request to get user information.
To Reproduce
Setup Event Subscriptions
on Slack and say something to bot.
Expected behavior
Handle the Event Subscriptions
event correctly.
This bot is very simple. Just tracking start/end time of working.
So there is no concept of break time now.
We need to discuss how we can track the break time.
break 1 hour
and set the value on the sheet.Any thoughts?
It is annoying I have to record break time.
Is it good to add 60 mins break automatically when the working time exceeds 5 hours?
There are no adjustments of time differences. I'm not sure how it affects so far.
Currently, the calculation ignores date value from the end_time
because if people enter the time manually, the datetime becomes 1899/12/30 11:00:00 .
For enabling the over-night work, change the calculation method to see date value if the end_time
contains corrct date.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.