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

fix: FORMS-1776 remove role and permission routes #1587

Merged
merged 1 commit into from
Jan 28, 2025

Conversation

WalterMoar
Copy link
Collaborator

@WalterMoar WalterMoar commented Jan 24, 2025

Description

We have API endpoints that allow the creation and updating of roles and permissions. We do not use these endpoints to change the roles and permissions, though, as those actions are done through the Knex migrations (to maintain consistency between environments).

We should remove these API endpoints so that we no longer need to maintain the code.

Acceptance Criteria

  • The POST and PUT endpoints for permissions and roles are removed
  • The corresponding controller, service, and ORM functions are also removed
  • The OpenAPI documentation is removed

Type of Change

fix (a bug fix)

Checklist

  • I have read the CONTRIBUTING doc
  • I have checked that unit tests pass locally with my changes
  • I have run the npm script lint on the frontend and backend
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • I have approval from the product owner for the contribution in this pull request

Further comments

The acceptance criteria listed removing the ORM part of these routes, but it turns out that the database logic is actually in the service.

This comment has been minimized.

Copy link
Collaborator

@usingtechnology usingtechnology left a comment

Choose a reason for hiding this comment

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

Nice, that's a good clean up! Hopefully we can catch more of these "dead" APIs.

Are we ignoring duplicated line warnings? It passes the gates so I think it's ok? We can always have a (1/2) sprint later that is dedicated to clearing Sonar warnings... I'll leave it to you for your judgement on this one.

@WalterMoar WalterMoar force-pushed the fix/1776-remove-unused-routes branch from 79400a6 to 8024827 Compare January 28, 2025 23:19
The roles and permissions both have routes for create (POST) and update (PUT). We do not use these routes, and should not use these routes - changes to the roles and permissions should be done through Knex migrations to ensure consistency across environments.
@WalterMoar
Copy link
Collaborator Author

Are we ignoring duplicated line warnings? It passes the gates so I think it's ok? We can always have a (1/2) sprint later that is dedicated to clearing Sonar warnings... I'll leave it to you for your judgement on this one.

I guess we can ignore them for now and see how it works? It's a bit sensitive about duplications, as some of these duplicates were blank lines that I added between functions. Duplicates are tricky, maybe we need to look at them individually as decide case-by-case. And maybe what we think is OK duplication today is something we want to clean up in the future. Plenty of decisions to be made.

@WalterMoar WalterMoar merged commit 8052f72 into bcgov:main Jan 28, 2025
7 checks passed
@WalterMoar WalterMoar deleted the fix/1776-remove-unused-routes branch January 28, 2025 23:35

This comment has been minimized.

2 similar comments

This comment has been minimized.

This comment has been minimized.

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.

3 participants