Skip to content
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

Improve subs logging #5908

Merged
merged 2 commits into from Aug 27, 2020
Merged

Conversation

Matt-Yorkley
Copy link
Contributor

@Matt-Yorkley Matt-Yorkley commented Aug 15, 2020

What? Why?

Related to #5743

Adds some minor improvements to subs logging, but the problems are not completely resolved yet. See issue notes.

What should we test?

  • PaperTrail records user ids in records for schedules and order cycles in the whodunnit field.
  • The Rails logs don't show a Unpermitted attribute: order_cycle_ids warning when creating/updating schedules.

Screenshot from 2020-08-15 19-26-13

Release notes

Improved PaperTrail logging for subscriptions

@Matt-Yorkley Matt-Yorkley self-assigned this Aug 15, 2020
@Matt-Yorkley Matt-Yorkley added the dev-test A dev need to test this one label Aug 15, 2020
Copy link
Contributor

@luisramos0 luisramos0 left a comment

Choose a reason for hiding this comment

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

nice 👍

Copy link
Member

@mkllnk mkllnk left a comment

Choose a reason for hiding this comment

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

🧻

@sauloperez
Copy link
Contributor

why not add a unit test to cover this? It's provided pretty critical to debug subs issues. I think it's worth it.

@sauloperez sauloperez added pr-staged-es pr-staged-fr staging.coopcircuits.fr and removed pr-staged-es labels Aug 27, 2020
@sauloperez sauloperez self-assigned this Aug 27, 2020
@sauloperez
Copy link
Contributor

This works

openfoodnetwork=> select * from versions order by id desc limit 5;
 id  | item_type  | item_id |  event  | whodunnit |                      object                      |         created_at         | custom_data 
-----+------------+---------+---------+-----------+--------------------------------------------------+----------------------------+-------------
 655 | Schedule   |      13 | create  | 1         |                                                  | 2020-08-27 14:20:04.590854 | []
 654 | OrderCycle |      90 | create  | 1         |                                                  | 2020-08-27 14:18:25.935542 | []
 653 | OrderCycle |      74 | update  |           | ---                                             +| 2020-08-25 08:38:45.651059 | [12]
     |            |         |         |           | id: 74                                          +|                            | 
     |            |         |         |           | name: OC July                                   +|                            | 
     |            |         |         |           | orders_open_at: 2020-07-31 22:00:00.000000000 Z +|                            | 
     |            |         |         |           | orders_close_at: 2020-09-15 22:00:00.000000000 Z+|                            | 
     |            |         |         |           | coordinator_id: 42                              +|                            | 
     |            |         |         |           | created_at: 2020-06-09 10:36:15.215751000 Z     +|                            | 
     |            |         |         |           | updated_at: 2020-08-25 08:38:30.233154000 Z     +|                            | 

The row prior to the deploy does not have whodunnit while new rows do.

@sauloperez sauloperez merged commit 06b41a8 into openfoodfoundation:master Aug 27, 2020
@sauloperez sauloperez removed the pr-staged-fr staging.coopcircuits.fr label Aug 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev-test A dev need to test this one
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants