unee-t / bugzilla-customisation

Unee-T's customisation on top of Bugzilla
https://hub.docker.com/r/uneet/bugzilla-customisation/
GNU Affero General Public License v3.0
5 stars 7 forks source link

Process invitations via a Lambda hook to automate / speed up invites #46

Closed kaihendry closed 6 years ago

kaihendry commented 6 years ago

Before sending out the invitation, a process on Bugzilla needs to be performed which I am unclear about.

Once it's done, I know I send the invitation off with http://localhost:3000/api/pending-invitations/done?accessToken=blablabla...

franck-boullier commented 6 years ago

yep, I need to do that: there are a few scripts in the bz-database repo that we need to run. There are a lot of comment inside the scripts which should be a good start to understand what need to happen. I need to create an overview and connect all the dots though, this would be needed when we automate the invitation process (hopefully soon...)

kaihendry commented 6 years ago

Any updates on this? This is quite important for testing the new signup flow.

franck-boullier commented 6 years ago

Will work on that over the WE, sorry for the delay

franck-boullier commented 6 years ago

@kaihendry Let me know if you have questions on this explanation.

kaihendry commented 6 years ago

So next step is to implement https://github.com/unee-t/bugzilla-customisation/wiki/Process-Invitations-in-the-BZ-database as an automated function right? I could do that.

franck-boullier commented 6 years ago

Yes Next step is to automate that and that'll be great if you can do that!

kaihendry commented 6 years ago

Made a video about how I setup my dev environment for this: https://s.natalian.org/2018-04-10/setup-demo.mp4

kaihendry commented 6 years ago

Created a new repo to address this issue. https://github.com/unee-t/processInvitations

It's a Apex Up style lambda function.

franck-boullier commented 6 years ago

The database schema version that will allow this to work will be v3.0 https://github.com/unee-t/bz-database/milestone/2

franck-boullier commented 6 years ago

Created a new repo to address this issue. https://github.com/unee-t/processInvitations

@kaihendry can you setup this repo so that it post to Slack when updated too?

kaihendry commented 6 years ago

Slack integration is done. Are https://github.com/unee-t/bz-database/commit/76274ec91bdf56e1b6465fded5a1da94e185129e the scripts I need to exec after the INSERT?

franck-boullier commented 6 years ago

not yet, I need to test them first... I'll do that now Once my tests are passed, I'll merge into the master and point you to the script you need to run

franck-boullier commented 6 years ago

also these scripts will only work on a BZ DB which run the v3.0 of the Unee-T BZ DB schema so I also need to test and do that update too first.

franck-boullier commented 6 years ago

Waiting for https://github.com/unee-t/bz-database/issues/30 to be done so we can update the Schema of the BZ database to v3.0

kaihendry commented 6 years ago

But we have Aurora running in staging, so we shouldn't be blocked by a Prod DB migration, should we?

franck-boullier commented 6 years ago

But we have Aurora running in staging, so we shouldn't be blocked by a Prod DB migration, should we?

To do the tests in the DEV/Staging of course not To move all this in prod once all the tests are done we need to make sure that both environments (DEV/Staging and prod) are similar. This is why I feel this is important: the ultimate goal is to do that in prod...

franck-boullier commented 6 years ago

Summary of what needs to happen:

1- A user creates an invitation in the MEFE

2- A record with all the information about the invitation is inserted in the BZ DB table 'ut_invitation_api_data'

3- The script 'process_one_invitation_all_scenario_v3.0.sql' (https://github.com/unee-t/bz-database/blob/master/scripts/process_one_invitation_all_scenario_v3.0.sql) is triggered. This script needs 2 variables:

4- Once the script has ran with no error MEFE is notified that the invitation has been processed in the BZ database and sends the email notification to the invitee.

5- Once the invitation has been sent to the invitee by the MEFE, a script 'MEFE_invitation_sent_v3.0.sql' (NOT created yet) is triggered. This script needs 2 variables:

This script will:

6- Move to the next invitation to process and start over from step 2.

Error handling:

At this point we need to have a notification sent to a human if there was an error during this procedure. The message should mention:

Status:

In the DEV/Staging for the BZ database, all the objects needed until step 4 are created.

The missing parts:

For the BZ database: