p2-inc / keycloak-orgs

Single realm, multi-tenancy for SaaS apps
Other
361 stars 65 forks source link

[Discussion] Contribution Guidelines #220

Open MGLL opened 2 months ago

MGLL commented 2 months ago

Hello,

I wanted to know if there are some contribution guidelines somewhere or if there are any plans to add them.

Globally, I try to look around the codebase and align, but I think some guidelines on your way of working or your best practices could help a bit.

Also, regarding the tests, I was a bit surprised to see long and complex test in 1 file (OrganizationResourceTest). Nonetheless I have aligned there too, but I wanted to know if it was part of your internal guidelines.

Best regards,

xgp commented 2 months ago

Thanks for the idea. We haven't published anything. Let's start something here, and then I can add a file to the top level of the repo.

I think your point on tests is a good one. I think it was more out of haste that everything got put in one huge test. Those could be refactored.


(partially pulled from Keycloak)

  1. Create an issue to propose a bugfix or enhancement. Take your time to write a proper issue including a good summary and description.
  2. Implementation. (need some more detail about compatibility and style). Do not format or refactor code that is not directly related to your contribution.
  3. Testing. Separate code into logical, readable classes. Do not add mock frameworks or other testing frameworks that are not already part of the testsuite. Please write tests in the same way as we have written our tests.
  4. Documentation. We require contributions to include relevant documentation both in the source code as javadoc and as functional documentation in or linked from the README.
  5. PR. Provide a good description commit message, with a link to the issue.
  6. Developer's Certificate of Origin. Any contributions to Phase Two open source projects must only contain code that can legally be contributed to Phase Two, and which the Phase Two project can distribute under its license. Prior to contributing to Keycloak please read the Developer's Certificate of Origin and sign-off all commits with the --signoff option provided by git commit.