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

TRUNK-5903: Switching from hibernate mappings to annotations-Role #4293

Closed
wants to merge 4 commits into from

Conversation

mherman22
Copy link
Member

@mherman22 mherman22 commented Apr 2, 2023

Description of what I changed

  • I have changed the role domain from using hibernate xml mappings to annotations.

  • Also ensured the role class extends the extends BaseOpenmrsObject but also implements the retireable and Auditable interfaces.

  • I made the name attribute transient so that it doesn't get persisted.

Issue I worked on

see https://issues.openmrs.org/browse/TRUNK-5903

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 and
    added 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

@tendomart
Copy link
Contributor

@mherman22 Got some failing tests at

Error: Tests run: 29, Failures: 0, Errors: 1, Skipped: 2, Time elapsed: 2.353 s <<< FAILURE! - in org.openmrs.hl7.HL7ServiceTest
Error: org.openmrs.hl7.HL7ServiceTest.resolveUserId_shouldReturnNullForAmbiguousUsersUsingFirstAndLastNameGivenUserIDIsNull Time elapsed: 0.06 s <<< ERROR!

@mherman22
Copy link
Member Author

@mherman22 Got some failing tests at

Error: Tests run: 29, Failures: 0, Errors: 1, Skipped: 2, Time elapsed: 2.353 s <<< FAILURE! - in org.openmrs.hl7.HL7ServiceTest Error: org.openmrs.hl7.HL7ServiceTest.resolveUserId_shouldReturnNullForAmbiguousUsersUsingFirstAndLastNameGivenUserIDIsNull Time elapsed: 0.06 s <<< ERROR!

@tendomart i am looking into that. Feel free to read through this talk post though -> https://talk.openmrs.org/t/switching-from-xml-mappings-to-annotations/39277/1

@mherman22 mherman22 force-pushed the TRUNK-5903 branch 3 times, most recently from 6bf1299 to b364c61 Compare April 5, 2023 14:59
Copy link
Member

@ibacher ibacher left a comment

Choose a reason for hiding this comment

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

Thanks @mherman22! A few small things, but this seems like the right direction...

api/src/main/java/org/openmrs/Role.java Show resolved Hide resolved
api/src/main/java/org/openmrs/Role.java Show resolved Hide resolved
@tendomart
Copy link
Contributor

Error:    VisitValidatorTest.validate_shouldFailIfTheStartDatetimeIsAfterAnyEncounter » StackOverflow
Error:    VisitValidatorTest.validate_shouldFailIfTheStopDatetimeIsBeforeAnyEncounter » StackOverflow

@mherman22
Copy link
Member Author

Error:    VisitValidatorTest.validate_shouldFailIfTheStartDatetimeIsAfterAnyEncounter » StackOverflow
Error:    VisitValidatorTest.validate_shouldFailIfTheStopDatetimeIsBeforeAnyEncounter » StackOverflow

looks to be a failure on the entire core as of this commit --> 7e9a3b6

@ibacher
Copy link
Member

ibacher commented Apr 12, 2023

It's a flaky test... Or at least, the commit you point to only updates the README.md file, so I'm not certain how that could change test results.

@mherman22
Copy link
Member Author

It's a flaky test... Or at least, the commit you point to only updates the README.md file, so I'm not certain how that could change test results.

This test passes when i build locally.

@mherman22 mherman22 force-pushed the TRUNK-5903 branch 2 times, most recently from 2d80f75 to e582a0f Compare April 18, 2023 11:27
@mherman22 mherman22 requested a review from ibacher April 30, 2023 21:31
@mherman22
Copy link
Member Author

@dkayiwa @ibacher am pinging you on this

@mherman22 mherman22 force-pushed the TRUNK-5903 branch 2 times, most recently from 0b7abab to 3bd5c51 Compare October 15, 2023 08:44
@mherman22 mherman22 changed the title Switching from hibernate mappings to annotations-Role TRUNK-5903: Switching from hibernate mappings to annotations-Role Jan 11, 2024
Comment on lines 54 to 56
@Transient
@Field
private String name;
Copy link
Member

Choose a reason for hiding this comment

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

So I'm still kind of curious why we need this?

Copy link
Member Author

Choose a reason for hiding this comment

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

so this was to make sure that the name field doesnot get persisted in the role table where we only require role,uuid and description.

Copy link
Member

Choose a reason for hiding this comment

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

Right, but Role now extends BaseOpenmrsObject which doesn't have that field any more right?

Copy link
Member

Choose a reason for hiding this comment

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

(I do think this should implement the OpenmrsMetadata interface, just with getName() and setName() modifying the role).

Copy link
Member Author

Choose a reason for hiding this comment

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

Right, but Role now extends BaseOpenmrsObject which doesn't have that field any more right?

oh yeah, my bad

(I do think this should implement the OpenmrsMetadata interface, just with getName() and setName() modifying the role).

remember this? -> https://talk.openmrs.org/t/switching-from-xml-mappings-to-annotations/39277/4?u=mherman22

Copy link
Member

Choose a reason for hiding this comment

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

Well, sure. What I actually care about is ensuring Role implements the Auditable and Retireable interfaces.

Copy link
Member Author

Choose a reason for hiding this comment

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

awesome, so what i gather here is that role should implement OpenmrsMetadata interface and that this ticket -> https://openmrs.atlassian.net/browse/RESTWS-910 is not required

@mherman22 mherman22 force-pushed the TRUNK-5903 branch 4 times, most recently from c5f4f28 to 0c9c811 Compare January 15, 2024 10:28
@mherman22 mherman22 requested a review from ibacher January 16, 2024 07:36
@dkayiwa
Copy link
Member

dkayiwa commented Jan 29, 2024

@mherman22 did you see the merge conflicts?

Copy link

tl;dr our action detected no activity on this PR and will close it in 30 days if the stale label is not removed.

OpenMRS welcomes your contribution! It means a lot to us that you want to contribute to equity in healthcare!

This PR has not seen any activity in the last 5 months. That is why we wanted to check whether you are still working on it or need assistance from our side.
Please note that this is an automated message and we might very well be the reason why there has not been any activity lately. We certainly do not want to discourage you from contributing. We do need to be honest in that OpenMRS has limited resources for reviewing PRs.

If you do not have time to continue the work or have moved on you don’t need to do anything. We will automatically close the PR in 30 days. We hope to see you back soon :)
If you would like to continue working on it or require help from us please remove the stale label and respond by commenting on the issue.

@github-actions github-actions bot added the Stale label Aug 29, 2024
Copy link

tl;dr closing this PR since it has not seen any activity in the last 6 months.

OpenMRS welcomes your contribution! It means a lot to us that you want to contribute to equity in healthcare! We certainly do not want to discourage you from contributing. We do need to be honest in that OpenMRS has limited resources for reviewing PRs. Your PR has not seen any activity in the last 6 months. This is why we have decided to close this PR for now. This allows us OpenMRS reviewers to focus our limited time to review all other PRs in a timely and professional manner.

Please feel free to reassign yourself to the issue you worked on in our JIRA when you have time to focus on it. After that reopen a new PR and we will be glad to work with you to get your contribution merged. Thank you very much for your help and understanding :)

@github-actions github-actions bot closed this Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants