...
If you are unclear whether a change you are proposing requires a design document, feel free ask us through our mailing list!
Style
Please read this page for coding style suggestions.
Tests
Please read this page for running various tests in Samza.
Contributor Workflow
Setup
Samza’s code is in an Apache Git repository located here.
...
Code Block | ||
---|---|---|
| ||
git clone http://git-wip-us.apache.org/repos/asf/samza.git |
Style
Please read this page for coding style suggestions.
Tests
Please read this page for running various tests in Samza.
Website
The Samza website is built by Jekyll from the markdown files found in the docs
subdirectory.
Contribute using Pull Requests
We use Pull Requests to review and discuss your contributions. In order to contribute code, please do the following:
- If you are working on a big new feature, follow the steps outlined above regarding design documents page
- If there is no JIRA for your work, please open a JIRA before creating a Pull Request. If it is a trivial fix (such as typo, doc fix etc), you may skip the JIRA creation.
- Creating Pull Request
- Fork the Github repository at http://github.com/apache/samza if you haven’t already
- Create a new branch in your repository and push your changes to that branch
- Make sure you have observed the recommendations in the coding guide and testing
- Open a Pull Request against the “master” branch of apache/samza
- Make sure that the Pull Request title is of the format “SAMZA-<JiraNumber> : <JiraTitle>”
- Make sure that your patch cleanly applies against the master branch. If not, rebase before creating the Pull Request
- Change the status of the JIRA to “Patch Available” so that it notifies the committers of the patch being available
- Nag us if we don’t follow up on your JIRA in a timely fashion.
- If your Pull Request is approved, it will automatically be closed, with any associated JIRA when a committer merges your changes.
- If your Pull Request is not approved and requires changes based on reviews, please make changes to your patch.
- While making the changes, kindly update the JIRA status from “Patch Available” to “In Progress”.
- Make sure that you have rebased your branch to latest in the master branch before updating the Pull Request. This will help avoid conflicts during the merge. We cannot commit patches that have merge conflicts!
- If your Pull Request is rejected for whatever reason, please close it promptly because committers cannot close your Pull Requests!
Committer Workflow
If you are a committer you need to use https instead of http to check in, otherwise you will get an error regarding an inability to acquire a lock. Note that older versions of git may also give this error even when the repo was cloned with https; if you experience this try a newer version of git.
Prepare to merge a Pull Request (PR) by setting up the following:
- Setup JIRA on your host
- Install Jira packages -
sudo pip install jira
- Set the
JIRA_USERNAME
andJIRA_PASSWORD
environment variables with the appropriate credentials for interacting with Jira. This is required to correctly close the JIRA associated with the PR
- Install Jira packages -
- Setup aliases for the remote repositories:(Samza Github repo and Apache Samza Repo)
- Add ASF git repo for committing the PR
git remote add samza-apache https://gitwipus.apache.org/repos/asf/samza.git
- Add Github repo for fetching the patch from the PR
git remote add samza-github https://github.com/apache/samza.git
- Add ASF git repo for committing the PR
- Set up API tokens for Git
- Create an OAuth key for making requests to the GitHub API. If this is not defined, then requests will be unauthenticated and you can’t access the API. An OAuth key for the API can be created at https://github.com/settings/tokens
- Set the created OAuth key as
GITHUB_OAUTH_KEY
environment variable.
Merging a Pull Request
...
Enabling merging through GitHub
- Prerequisites
- Apache ID (should have been set up in the initial committer onboarding process)
- You should be added as a committer to the Samza project (should have been set up in the initial committer onboarding process)
- Github account
- Join Apache Github organization
- Open https://id.apache.org/ and log into your Apache account.
- Fill in your GitHub username and save your change:
- An organization invitation email will be sent (usually in 30min, may up to few hours)
- Accept the invitation.
- An email confirming to add you as Samza committer will be sent (usually in 30min, may up to few hours) .
- Enable 2FA on Github
- This page (https://help.github.com/en/articles/configuring-two-factor-authentication) might be helpful for that.
- Link Apache and Github account
- Authorize Apache by clicking "Start ASF Oauth"
- Authorize GitHub Account
- Once your writer access is granted, you will see
- Congratulations! Now you have write access to Apache Samza Project!
Merging a pull request (PR)
- Make sure the PR can be cleanly merged (GitHub should report if it can be cleanly merged).
- At the bottom of the feed for the PR, there is a button with a selection dropdown for merging a branch. Make sure the "Squash and merge" option is selected, and then click "Squash and merge".
- Whenever possible, make sure that the commit title includes the JIRA number and title.
Other notes
- The committer workflow used to involve running a "merge-pull-request.py" script. That flow is no longer applicableMerging changes that don’t cleanly apply on the master should be avoided.
- For committers wishing to update the webpage, please see see docs/README.md for for instructions.
...