Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • 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
    1. Fork the Github repository at http://github.com/apache/samza if you haven’t already
    2. Create a new branch in your repository and push your changes to that branch
    3. 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
    4. 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:

  1. Setup JIRA on your host
    • Install Jira packages - sudo pip install jira
    • Set the JIRA_USERNAME and JIRA_PASSWORD environment variables with the appropriate credentials for interacting with Jira. This is required to correctly close the JIRA associated with the PR
  2. Setup aliases for the remote repositories:(Samza Github repo and Apache Samza Repo)
    • Add ASF git repo for committing the PR 

      Code Block
      languagebash
      git remote add samza-apache https://git-wip-us.apache.org/repos/asf/samza.git 
    • Add Github repo for fetching the patch from the PR 
      Code Block
      languagebash
      git remote add samza-github https://github.com/apache/samza.git
  3. 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

  1. Prerequisites
    1. Apache ID (should have been set up in the initial committer onboarding process)
    2. You should be added as a committer to the Samza project (should have been set up in the initial committer onboarding process)
    3. Github account
  2. Follow the instructions at https://reference.apache.org/committer/github. Please do also follow the instructions for "Can I write to repositories at GitHub ??", so you can merge through GitHub.
    1. When doing the Gitbox linking under "Can I write to repositories at GitHub ??", you will be required to set up 2FA for Github. This page (https://help.github.com/en/articles/configuring-two-factor-authentication) might be helpful for that.
      1. This link (https://help.github.com/en/articles/accessing-github-using-two-factor-authentication#using-two-factor-authentication-with-the-command-line) might also be helpful if you need to authenticate on the command line after enabling 2FA (e.g. for pushing code to GitHub).
  3. Once the Gitbox page says you have linked your Apache account to GitHub, you can double check that everything is now ready: Go to an open Samza pull request (PR) and scroll towards the bottom of the feed for the PR. In the section about the test and merge checks, you should see a button for merging the branch.

Merging a pull request (PR)

  1. Make sure the PR can be cleanly merged (GitHub should report if it can be cleanly merged).
  2. 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".
  3. 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.

...