-
Notifications
You must be signed in to change notification settings - Fork 45
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
editoast: log stdcm requests #9873
Conversation
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## dev #9873 +/- ##
========================================
Coverage 79.85% 79.86%
========================================
Files 1048 1048
Lines 105086 105214 +128
Branches 756 756
========================================
+ Hits 83921 84033 +112
- Misses 21124 21140 +16
Partials 41 41
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
cd61269
to
aaf0574
Compare
aaf0574
to
a1541d9
Compare
a1541d9
to
e2d76fe
Compare
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.
Cursory review, I'll test later if this isn't merged beforehand.
I know the list of fields has been discussed in the refinement, but I can think of at least two other columns that could prove useful IMO:
- the date time of the request, allowing us to sort requests by recentness
- the user that performed the request
With these we'd be easily able to provide a feature like "replay my most recent request". Wdyt? (ping @ everyone)
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.
Were you able to test if the trace_id
in the entrypoint of editoast
is the same than the one you log? I'm wondering if it just generates a new one or not 🤷
9ba80cd
to
7d91e9d
Compare
3dd6355
to
ea2b2c7
Compare
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.
Thanks for the changes! A few more comments below:
b396089
to
cf11718
Compare
cf11718
to
5a83e23
Compare
159b927
to
e37b50e
Compare
e9e81aa
to
2e01cb6
Compare
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.
Just tested. Works great when authenticated, but the log entry isn't created when authorization is disabled. Probably a unique nulls
missing somewhere.
To keep the repo history clean, I suggest merging @woshilapin PR into yours instead of cherry-picking, and he should probably be Co-Author as well.
If authentication is disabled, the superuser profile is granted to everyone: if disable_authorization {
return Ok(Authentication::Authenticated(Authorizer::new_superuser(
PgAuthDriver::<BuiltinRole>::new(db_pool),
)));
} In the code, we assign pub fn new_superuser(storage_driver: S) -> Self {
Self {
user: UserInfo {
identity: "superuser".to_string(),
name: "Super User".to_string(),
},
user_id: -1,
user_roles: HashSet::from([S::BuiltinRole::superuser()]),
storage: storage_driver,
}
} This leads to an issue when trying to store the log, because it results in a foreign key error. |
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.
2e01cb6
to
be5fcf9
Compare
be5fcf9
to
6a99e1f
Compare
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.
LGTM. Thanks @hamz2a @woshilapin for the changes!
Co-authored-by: Jean SIMARD <[email protected]> Signed-off-by: hamz2a <[email protected]>
6a99e1f
to
63990f2
Compare
Part of #9724
trace_id
,request
,response
,created
anduser_id
.