Steps to submit a PR for new binding

Tags: #<Tag:0x00007f616d95e130> #<Tag:0x00007f616d95e018>

Hi all, following the openHAB documentation I’ve finally completed my first binding for BTicino Smarther Chronothermostat and would like to contribute to the Community with a PR.

I’m using Eclipse on Windows and, reading Contribution section, I’ve found many useful hints and understood I have to create an enhancement issue.

However, before messing up anything, since it’s my first contribution, I was wondering if someone of you could point me in the right direction to achieve the goal at best with my dev setup :slight_smile:

Thanks,

I am a noob and working on my first PR so hopefully the following is correct and is what you are asking? A maintainer will do a review and tell you what needs to be changed but to make their life easier…

  1. Run ‘mvn clean install’ and fix all the warnings and errors that are listed. The code checker tells you what needs to be looked at before doing a PR.

  2. I have seen people recommend the readme.md file should have all sentences on their own line. This way it makes any PR on the documentation cleaner.

  3. Make sure your NOTICE file is correctly and fully filled in so someone can check the dependencies and their licenses quickly. Look at other bindings NOTICE file to see how to fill it in.

1 Like

Thanks @matt1 for your hints, I’m a noob too :smile:

I wanted to be sure I was doing the right steps to submit a PR with my combination of development tools.

I think I figured it out yesterday; today I’ll check the items you suggested me to and try to submit my first one :crossed_fingers:

Hi @matt1, I’ve submitted my PR today! So far so good :smile:

Cheers,

Thanks for contributing.

1 Like

:+1: yes, thank you Fabio for contributing
Please post a link to your PR so we can all follow along at home

1 Like

Hi @Andrew_Rowe and all,
you can follow it here in the dedicated thread:

Cheers,

To everyone who may need it :wink:
Starting from openHAB documentation, that’s what I’ve done to submit my PR using Eclipse and Github.

A. Github:

  1. Clone the “openhab-addons” repository in your personal repos, clicking on top-right “Fork” icon (I’ve cloned the 2.5.x one)
  2. Go to your profile Settings > Developer settings > Personal Access Tokens, generate a new token and write it down as it will be needed when pushing commits back to you Github repo

B. Eclipse:

  1. Create a “[your binding]” branch on local “openhab-addons” repo
  2. Compile your Binding with mvn clean install, fix all the high priority issues and the relevant medium and low priority issues and compile it again, until it’s ready
  3. Update the README.md and NOTICE files (also see how these are written for other bindings)
  4. Go to Window > Preferences > Team > Git then, in “Committing” section check the “Insert Signed-off-by” box, in “Configuration” section select the “Repository Settings” tab and add two entries: user.name (your full name) and user.email (email address used in Github)
  5. In Package Explorer view, right click on “OH Add-ons” > Team > Commit
  6. In Git Staging view, stage all the files you want to commit, add a comment (make sure to have a last line with “Signed-off-by: [your name] <[your email address]>”), make sure the Author and Committer fields are properly set and press “Commit and Push…” (provide Github username and access token when required)

The above will push the local changes to your “openhab-addons” copy, in [your binding] branch.

C. Back to Github:

  1. Go to your “openhab-addons” repo, switch to the [your binding] branch and press the “New pull request” button; you should be directed to the “Open a pull request” page
  2. Follow the instructions in the textbox (pay attention to properly set the ) then click on “Create pull request”

Done!

Now follow the pending automatic checks. DCO is the first one to go, it will fail if you haven’t signed-off your commit (in that case, follow the “Details” link near the check to see what you have to do).

Cheers,

3 Likes

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.