-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
OMRS-131: Detailed Audit Logging (Updated) #4668
Conversation
Can we rename the |
Can you raise a pull request with medication_dispense such that i see the failure on github? I have so far failed to reproduce it locally. |
@@ -9,13 +9,16 @@ | |||
*/ | |||
package org.openmrs.scheduler; | |||
|
|||
import org.hibernate.envers.Audited; |
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.
Are we using this anywhere?
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 are auditing Schedule entity
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.
Where in the codebase are we using that entity?
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.
I added auditing to it because it is used here:
openmrs-core/api/src/main/resources/org/openmrs/scheduler/db/hibernate/Schedule.hbm.xml
Line 16 in 3a7925a
<hibernate-mapping package="org.openmrs.scheduler"> |
However, I couldn't find any scheduler_schedule tables in the database.
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.
Looks like it may be time to get rid of it. 😊
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.
should I delete both the class and hbm?
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.
Yes, but in a separate pull request.
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.
I created a PR for this: #4670
@dkayiwa I updated the revision entity name. |
I created a new PR for this: #4669 |
@@ -22,6 +23,7 @@ | |||
*/ | |||
@RevisionEntity(OpenMRSRevisionEntityListener.class) | |||
@Entity | |||
@Table(name = "openmrs_revision_entity") |
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.
Do we need the openmrs_
prefix?
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.
I updated the PR.
@@ -22,6 +23,7 @@ | |||
*/ | |||
@RevisionEntity(OpenMRSRevisionEntityListener.class) | |||
@Entity | |||
@Table(name = "revision_entity") | |||
public class OpenMRSRevisionEntity extends DefaultRevisionEntity { |
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.
And i think our naming convention has been Openmrs
instead of OpenMRS
. Not so? 😊
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.
I updated the class name.
@wikumChamith can we fix these merge conflicts? |
Enabled logging to the tables that we did not include in last PR.
Enabled logging to the tables that we did not include in last PR.
Description of what I changed
I have enabled logging for tables that were omitted in the last PR. To identify these tables, I used the following SQL script to detect which tables lack corresponding audit tables:
Here are the tables currently without audit tables:
Issue I worked on
see https://openmrs.atlassian.net/browse/OMRS-131
Checklist: I completed these to help reviewers :)
My IDE is configured to follow the code style of this project.
No? Unsure? -> configure your IDE, format the code and add the changes with
git add . && git commit --amend
I have added tests to cover my changes. (If you refactored
existing code that was well tested you do not have to add tests)
No? -> write tests and add them to this commit
git add . && git commit --amend
I ran
mvn clean package
right before creating this pull request andadded all formatting changes to my commit.
No? -> execute above command
All new and existing tests passed.
No? -> figure out why and add the fix to your commit. It is your responsibility to make sure your code works.
My pull request is based on the latest changes of the master branch.
No? Unsure? -> execute command
git pull --rebase upstream master