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

Change RoleResource from extending the MetadataDelegatingCrudResource class #575

Closed
wants to merge 2 commits into from

Conversation

mherman22
Copy link
Member

@mherman22 mherman22 commented Apr 10, 2023

Description of what I changed

I changed the Role resource from extending the metadataDelegatingCrudResource class and instead created a class called RoleDelegatingCrudResource that extends the DelegatingCrudResource class. So i ensured the Role resource class extends RoleDelegatingCrudResource

Issue I worked on

see https://issues.openmrs.org/browse/RESTWS-910

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

* Subclass of {@link DelegatingCrudResource} with helper methods specific to
* {@link Role}
*
* @param <T>
Copy link
Member

Choose a reason for hiding this comment

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

What is the value of creating this new class?

Copy link
Member Author

@mherman22 mherman22 Apr 11, 2023

Choose a reason for hiding this comment

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

it didnt sit down well with me to for the RoleResource1_8 class extending directly from DelegatingCrudResource

Copy link
Member

Choose a reason for hiding this comment

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

But still, it does not mean that you should create a new class.

Copy link
Member Author

Choose a reason for hiding this comment

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

are you implying i should use DataDelegatingCrudResource instead? because thats the other option i had in mind.

or better yet, any suggestions of how i should go about it?

Copy link
Member Author

Choose a reason for hiding this comment

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

i realized DataDelegatingCrudResource doesn't work for this case and none of the other BaseDelegatingCrudResource implementation classes did so i went with DelegatingCrudResource

@mherman22 mherman22 requested a review from dkayiwa April 12, 2023 20:48
@dkayiwa
Copy link
Member

dkayiwa commented Apr 12, 2023

@mherman22 will this run well within a platform that has these changes? openmrs/openmrs-core#4293

@mherman22
Copy link
Member Author

mherman22 commented Apr 12, 2023

@mherman22 will this run well within a platform that has these changes? openmrs/openmrs-core#4293

@dkayiwa the above quoted pullrequest needs to first be merged in core first. So I guess your reviews over there are highly welcome before we have it merged and then I can comfortably finish this one as well.

Especially in regards to retirement of a role

@dkayiwa
Copy link
Member

dkayiwa commented Apr 12, 2023

Have you tried to run a local platform with those changes and then deployed the rest webservices module with the changes in this pull request?

@mherman22
Copy link
Member Author

Have you tried to run a local platform with those changes and then deployed the rest webservices module with the changes in this pull request?

i have deployed the two snapshots i got onto platform 2.6.0 and everything looks to be working in regards to requests Get role, Create role, Delete role and Update role. I think this is because some of the changes are still dependant on retire which is a metadata attribute

@dkayiwa
Copy link
Member

dkayiwa commented Apr 13, 2023

Have you tried to run a local platform with those changes and then deployed the rest webservices module with the changes in this pull request?

i have deployed the two snapshots i got onto platform 2.6.0 and everything looks to be working in regards to requests Get role, Create role, Delete role and Update role. I think this is because some of the changes are still dependant on retire which is a metadata attribute

@dkayiwa dkayiwa closed this Apr 13, 2023
@dkayiwa dkayiwa reopened this Apr 13, 2023
@dkayiwa
Copy link
Member

dkayiwa commented Apr 13, 2023

@mherman22 with the changes in this pull request openmrs/openmrs-core#4293 it will no longer be platform 2.6.0

@mherman22
Copy link
Member Author

@mherman22 with the changes in this pull request openmrs/openmrs-core#4293 it will no longer be platform 2.6.0

So how should i go about testing the two pull requests? FYI, these are distro.properties for the platform 2.6.0 local instance

#Thu Apr 13 13:49:28 EAT 2023
name=Platform
omod.fhir2=1.8.0
omod.owa=1.14.0
omod.webservices.rest=2.40.0-SNAPSHOT
owa.openmrs-owa-addonmanager=1.1.0
version=2.6.0
war.openmrs=2.7.0-SNAPSHOT

@dkayiwa
Copy link
Member

dkayiwa commented Apr 13, 2023

This is what i personally do. After making the changes in the platform, i simply go to the webapp folder and run mvn jetty:run

@mherman22
Copy link
Member Author

This is what i personally do. After making the changes in the platform, i simply go to the webapp folder and run mvn jetty:run

@dkayiwa so after running this, i should upload the webservices module having these changes? i.e omod.webservices.rest=2.40.0-SNAPSHOT

@dkayiwa
Copy link
Member

dkayiwa commented Apr 13, 2023

so after running this, i should upload the webservices module having these changes? i.e omod.webservices.rest=2.40.0-SNAPSHOT

True dat!

@mherman22
Copy link
Member Author

@mherman22 will this run well within a platform that has these changes? openmrs/openmrs-core#4293

@dkayiwa i have added a comment at https://talk.openmrs.org/t/switching-from-xml-mappings-to-annotations/39277/8?u=mherman22

@mherman22
Copy link
Member Author

@dkayiwa please look through again and hopefully have it merged

@mherman22 mherman22 force-pushed the RESTWS-910 branch 2 times, most recently from e8fa81e to e4e2ec0 Compare April 30, 2023 19:29
@mherman22
Copy link
Member Author

@dkayiwa pinging you on this!

@mherman22
Copy link
Member Author

closing this because of the discussion on openmrs/openmrs-core#4293 that has led me to believe this is no longer needed

@mherman22 mherman22 closed this Mar 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants