-
Notifications
You must be signed in to change notification settings - Fork 10
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
Initial implementation #6
Conversation
Also refactored p.API dependencies into api.PluginAPI
- initial user.IsAvailable based on the calendar
- also `user [dis]qualify` now complete
Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.1.2 to 4.5.3. - [Release notes](https://github.com/wycats/handlebars.js/releases) - [Changelog](https://github.com/wycats/handlebars.js/blob/master/release-notes.md) - [Commits](handlebars-lang/handlebars.js@v4.1.2...v4.5.3) Signed-off-by: dependabot[bot] <[email protected]>
…bars-4.5.3 Bump handlebars from 4.1.2 to 4.5.3 in /webapp
Thanks @crspeller for the review, it's a lot of lines, appreciate it!
Noted, both structurally (command/flag set) and heuristically, like allowing just a space-separated rotation names and @usernames.
👍
Yes, I saw the same thing just before the demo. Likely de-randomized something in the last refactoring of the scheduler; adding tests should help.
👍 will add a
Right. One obvious improvement begging to be made is the concept of rotation admin(s) but sysadmin vs user would be a great step forward, agreed.
Let's file additional enhancement issues for the necessary APIs? |
Filed #11 and #12 filed to address some of the concerns. I could not reproduce the small rotation weirdness, will try again, will file as separate issues; also need more tests for @crspeller @cpoile I'm submitting the feedback as a separate PR, since it's quite massive. It can be re-pointed at master if it makes it easier (lots of refactoring there) |
* Refactored api file structure, api_ for wrappers * updated dependencies * PR Feedback: renamed event type other to personal * PR Feedback: ResolveRotationName to return ErrNotFound when no results * PR Feedback: nits and naming * PR Feedback: removed PostAction placeholder * Copyright (c) 2019-... * PR Feedback: comment in plugin/api.go * PR Feedback: nits * Refactored solar-lottery autofill, no tests yet * added weight tests * Added tests for solar-lottery needs, pickUser * test for fillOne, bunch of refactoring, fixes * More fillOne tests, fixes * Refactored MORE! * amend minor * amend minor * amend minor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is huge, I'm learning a lot.
These are notes I'm taking while working through the code.
It's interesting -- you're using fields on structs (like in api
) to carry parameters into methods, kind of like a context in a request... Yah, that is what you're doing. You're treating slash commands like http requests. Hah, nice. Once I figured that out it became a lot clearer. Maybe we can rename it to make this a bit more clear on first sight? What you're doing feels like it's overloading the meaning of an api
struct -- because in other places we've used just to hold api methods or helper methods. This is more like a context.
I'm using the demo code as examples -- if we're going to push to community we definitely need thorough explanations for the commands, and formatted examples. Like: Here are the steps to set up a team, set up an icebreaker event, set up a SET, give someone time off. The rotation commands are particularly difficult, I think.
Is there a way to specify a rotation that has randomness but makes sure that all eligible people are picked i
times before someone is picked for their i+1
th time? Because that's how I imagine the ice-breaker should work.
Guess will fail completely if it can't fill a rotation. Maybe it should try its best, because often we don't have a full icebreaker, or maybe SET is less one person.
Minor nits (todos):
- the box profile pic is Jira's
Co-Authored-By: Christopher Poile <[email protected]>
Co-Authored-By: Christopher Poile <[email protected]>
Co-Authored-By: Christopher Poile <[email protected]>
Co-Authored-By: Christopher Poile <[email protected]>
Thanks, I did myself in the process. Go is very different from C where it comes to packaging code.
My thinking - I'd like us to converge at some point in the future where there is a structure like
HTTP and Command interfaces really ought to become one at some point. I'd love for a senior community member/candidate to write an AST-based generator for these, with logging and all. With some creativity. I am also hesitant to do much there until the HTTP endpoints are actually written and used - we'll see the best packaging then? I don't like the use of gorilla/mux for instance; other things aside it necessitates playing games with
I filed #11 to create a README. I agree that the documentation and "template use cases" are needed. As far as improving the overall usability of the CLI, I suggest we wait until we gather experience on community. Having said that, there is one obvious improvement I'd like to make, and that is to rely on parameters (not flags) for rotation, user, and shift references, via a normalized syntax. Anything that is a FWIW, I have mixed feelings at best about pflag, but nothing specific yet.
No, but there is now separation of concern that should allow for an easy development of a queue Separately, the current
|
@cpoile @crspeller I think I addressed both of yours feedback. I took the liberty of resolving the threads that I felt were done, to keep the PR manageable, feel free to reopen as appropriate. I filed a bunch of follow up tickets, but the biggest obstacles to the community deployment in my mind are:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lots of little comments. The biggest thing is some architectural changes we chatted about. I tagged some of them with inline comments.
Lots of stuff to like in here! The server could use the expand semantics....
Will take another look after the big changes.
|
||
// Mandatory attributes | ||
Name string | ||
Period string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use time.Duration
for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is tricky. To start with, a "month" is not a duration. I am treating weeks like they are, but they really are not and all these should be treated similarly, by properly calculating start/end using the calendar math.
@crspeller, done.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the review last week, I can't see anything I would really want changed. We'll have to let it bake/shake-out on community for a bit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could nitpick on this forever. It's a lot of code, so let's get it merged and start iterating on it. Once we get some real feedback we can improve the design. I think the overall design is good and it's already staring to bleed into our other plugins :D
I'm going to merge to master as is, and log a PM review ticket for the community deployment milestone, specifically after there's a README. |
See https://github.com/mattermost/mattermost-plugin-solar-lottery/blob/dev/demo.md
To run the entire demo script on your local instance, type
/lotto demo all
, requirestest-data
./lotto info
for current info.