Bug fixes and documentation improvements are welcome! If you want to contribute, I suggest you have a look at our Jira project and get in touch with us via Zulip chat.
PRs must be submitted to main branch and they should:
- state clearly what they do (see more here)
- point to associated Jira issue
- contain a test case, unless existing tests already verify the code added by the PR
- have a license header in all new files, with current year’s number
- pass CI
If your PR is incomplete, the reviewer might request you add the missing bits or add them for you if that is simple enough (for that to be possible, though, you need to check the Allow edits from maintainers box)
We expect all contributors and users to follow our Code of Conduct when communicating through project channels. These include, but are not limited to: chat, issues, code.
WildFly HTTP Client uses JIRA to manage issues. All issues can be found here.
To create a new issue, comment on an existing issue, or assign an issue to yourself, you'll need to first create a JIRA account.
If you want feedback, you can discuss your planned changes in any of the following ways:
- add comments to the issue ticket at the WEJBHTTP Jira
- Remoting Zulip chat.
- or simply create a draft PR and point in the PR description that you would like feedback on the proposal before getting to the final solution
PR reviewers will take into account the following aspects when reviewing your PR:
- correctness: the code must be correct
- performance impact: if there are negative performance impacts in the code, careful consideration must be taken whereas the impact could be eliminated and, in case it cannot, if the new code should be accepted
- code style: keep your code style consistent with the classes you are editing, such as variable names, ordering of methods, etc
- scope of the fix: this is a very important factor. Sometimes, the fix should be applied to a broader range of classes, such as a bug that repeats itself in other parts of the code. Other times, the PR solves a bug only partially, because the bug has a broader impact than initially evaluated.
- is the proposed fix the best approach for the Jira at hand?
- backwards compatibility: we must prevent any PR that breaks compatibility with previous versions. If the PR does so, it could still be okay, but this should be clearly documented it will probably be discussed by the project maintainers before being merged
- security impact: it is critical to evaluate if the PR has any sort of security impact, preventing the addition of exploitable flaws.
If this is your first time contributing to a GitHub project, you can follow the next steps to get up to speed when contributing to WildFly HTTP EJB. Regardless of your level of experience, though, we kindly ask you that PRs are always rebased before being submitted or updated.
If you don't have one already, head to https://github.com/
Fork https://github.com/wildlfy/wildfly-http-client into your GitHub account.
git clone [email protected]:[your username]/wildfly-http-client.git
cd wildfly-http-client
This makes it easy to pull down changes in the project over time
git remote add upstream git://github.com/wildfly/wildfly-http-client.git
This is the typical process you would follow to submit any changes to WildFly HTTP Client.
git pull --rebase upstream main
Note that --rebase will automatically move your local commits, if you have any, on top of the latest branch you pull from. If you don't have any commits it is safe to leave off, but for safety it doesn't hurt to use it each time just in case you have a commit you've forgotten about!
git checkout -b my_cool_feature
If you have a Jira number for the fix, having the Jira name in the branch is very useful to keep track of your changes:
git checkout -b WEJBHTTP-XXXX
or
git checkout -b WEJBHTTP-XXXX-my_cool_feature
Make whatever code changes, including new tests to verify your change, and make sure the project builds without errors:
mvn clean verify
If you're making non code changes, the above step is not required.
Add whichever files were changed into 'staging' before performing a commit:
git commit -v
The -v
parameter is advisable if you want to check when writing the commit message all the changes that are included in your
commit.
Once all your commits for the issue have been made against your local topic branch, we need to rebase it against branch main in upstream to ensure that your commits are added on top of the current state of main. This will make it easier to incorporate your changes into the main branch, especially if there has been any significant time passed since you rebased at the beginning.
git pull --rebase upstream main
Now that you've sync'd your topic branch with main, it's time to push it to your GitHub repo.
git push origin WEJBHTTP-XXXX-my_cool_feature
Now your updates are in your GitHub repo, you will need to notify the project that you have code/docs for inclusion.
- Send a pull request, by clicking the pull request link while in your repository fork
- After review a maintainer will merge your pull request, update/resolve associated issues, and reply when complete
- Lastly, switch back to branch main from your topic branch and pull the updates
git checkout main
git pull upstream main
- You may also choose to update your origin on GitHub as well
git push origin
After you get feedback from reviewers and the community, you might need to update your PR before it is merged. If the original commit is too big, you can do an incremental, new commit, to facilitate review of the changes in the PR.
However, if you want to edit your previous commit, you can easily do so by amending it:
git commit --amend -v
Don't forget to add the changes you want incorporated to your commit before amending it.
If your PR contains more than one commit and you need to edit a commit that is not the latest, it cannot be amended as above, but you can use the interactive magic rebase. The command below allows you to amend, merge, delete or simply reword the latest X commits in the current branch (replace X by the correct number for your case):
git rebase -i HEAD~X
Then just follow the instructions to indicate the changes you need to do.
It is a good practice to create a backup of your original branch in case you end up doing a mistake. That way, you can just reload your original fix (the GitHub remote origin account containing the PR can serve this purpose, as long as you don't overwrite it with a broken branch).
Once you are satisfied if your commits, run the tests again with mvn clean verify
. Finally, check the changes your are going
to push to origin are really okay with:
git log -p
Only then, you can push it to origin. If you edited a commit that was already in the PR, you will need to force the push with --force
:
git push origin --force WEJBHTTP-XXXX-my_cool_feature