Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "SWTBot/Contributing"

m (duplicated content removed)
(Release process)
(48 intermediate revisions by 10 users not shown)
Line 1: Line 1:
 
{{SWTBot}}
 
{{SWTBot}}
  
== Getting the source ==
+
== Setting up the workspace with Oomph (NEW) ==
  
The source code of the SWTBot project can be found in a eclipse.org Subversion repository:
+
# Download and start [https://wiki.eclipse.org/Eclipse_Oomph_Installer Oomph].
 +
# On the initial page, click on the Switch to advanced mode button in the top right.
 +
# On the Product page, select ''Eclipse IDE for Eclipse Committers''.
 +
# On the Projects page, double-click '''SWTBot'''
 +
# Choose your preferred installation settings on the ''Variables'' page:
 +
## If you plan to contribute patches using Gerrit ([[#Provide_a_contribution_using_Gerrit|section about Gerrit]]), check "Show all variables" and make sure you select ("SSH (read-write Gerrit)") in the ''Git or Gerrit repository''; the git URI will then look like <pre>ssh://${git.user.id|username}@git.eclipse.org:29418/swtbot/org.eclipse.swtbot</pre>
 +
## Then specify your Bugzilla/Hudson password and Git/Gerrit user ID (you can also specify the password and check that your credential are correct using the "Authenticate..." button). An example is shown in the following screenshot. [[File:Swtbot-oomph-variables.png]]
 +
# Press next and finish.
  
{{codeblock|svn co http://dev.eclipse.org/svnroot/technology/org.eclipse.swtbot/trunk/}}
+
This will first create an Eclipse installation with all the needed plug-ins for developing SWTBot (including the [[#Recommended_Eclipse_plugins|Recommended Eclipse plugins]]), and then will start the new installed Eclipse (press Finish to close the first installation dialog). The new installed Eclipse will automatically setup the workspace and you will have to wait for this procedure to end (you can click on the animated arrow icon on the status bar to show the progress). This workspace setup procedure includes:
  
Alternatively, you can use a git mirror of that repository:
+
* cloning the SWTBot git repository (you'll be asked for a password if you selected the read-write git URI)
 +
* setup the target platform
 +
* setup the API baseline
 +
* setup Mylyn queries for SWTBot Bugzilla bugs and SWTBot Gerrit reviews
 +
* setup the Mylyn Hudson build view
 +
* setup the working sets
  
{{codeblock|git clone git://github.com/ketan/swtbot.git}}
+
Once this procedure ends, your workspace will be built and you are ready to develop.
+
 
You can also browse the repository using a web interface: [http://dev.eclipse.org/viewcvs/index.cgi/trunk/?root=Technology_SWTBot SVN], [http://github.com/ketan/swtbot Git]
+
The installed Eclipse can be found in the "Installation folder name" selected in the "Variables" dialog, under the subdirectory "eclipse".
 +
 
 +
== Getting the source (old manual way) ==
 +
 
 +
You can use a git mirror of that repository:
 +
 
 +
{{codeblock|git clone git://git.eclipse.org/gitroot/swtbot/org.eclipse.swtbot.git}}
 +
 
 +
You can also browse the repository using [https://git.eclipse.org/c/swtbot/org.eclipse.swtbot.git/ a web interface] or even by monitoring the [https://github.com/eclipse/swtbot mirror of the repository on GitHub].
 +
 
 +
To contribute changes to the website, use this git repo: <tt>https://git.eclipse.org/c/www.eclipse.org/swtbot.git</tt>
 +
 
 +
=== IDE tips ===
 +
==== Recommended Eclipse plugins ====
 +
It's advised that you use the following plugins in Eclipse:
 +
* EGit
 +
* FindBugs (with a high "Minimum rank to report" set in ''Window > Preferences > Java > Findbugs'')
 +
* Configure JDT in "pedantic" mode: from ''Window > Preferences > Java > Compiler > Errors/Warning'' make all violations send a warning, ignore nothing.
 +
* EclEmma is useful to analyze Coverage Reports
 +
* ... Any other tool that makes you write better code faster ...
 +
 
 +
==== Target Platforms ====
 +
 
 +
You can find some ready-to-use target platforms for development in the ''devtools/target-platforms'' folder. Each target-platform basically target a version of the Eclipse release train. It's recommended to use one of these target-platform since it contains all SWTBot dependencie. These target-platforms are also used at build time, so your dependencies in IDE will be consistent with dependencies during build.  Enable the selected target-platform by opening it in IDE with the target definition editor, and click ''Set As Target Platform''.
 +
 
 +
In case something is not working well, please report them as a bug.
 +
 
 +
==== API Baseline ====
 +
 
 +
To track API changes, it is advised to use the API tool.
 +
To set up the API baseline, follow these steps:
 +
 
 +
* Select "Window -> Preferences". In the window that opens, select "Plug-in Development -> API Baselines" on the left pane.
 +
* Click on "Add Baseline..."
 +
* Choose "A target platform" and click Next.
 +
* In the next page check the box next to the target which contains "baseline" in its name, like "swtbot-baseline".
 +
* Click "Reset" to download the contents of the target.
 +
* Specify a name for this baseline in the top area, like "SWTBot API" for example.
 +
* Click "Finish", then "OK" in the previous dialog.
 +
 
 +
It should offer you do to a full rebuild. You can click "Yes" at this point.
  
 
== Building SWTBot ==
 
== Building SWTBot ==
  
See [http://dev.eclipse.org/viewcvs/index.cgi/trunk/org.eclipse.swtbot.releng/readme.txt?revision=230&root=Technology_SWTBot ''org.eclipse.swtbot.releng/readme.txt''] in the repository for instructions on how to build SWTBot.
+
# First Get the sources, as explained a few lines above.
 +
# then <tt>mvn clean verify</tt>
 +
# That's all!
  
See [[Dev Setup For Recorder Branch]] to setup your development environment with the branch that contains the recorder.
+
NOTE: default build performs against Eclipse Luna. You can test and build against Juno instead by activating the "juno" profile: <tt>mvn clean verify -P juno</tt>, for Kepler, run <tt>mvn clean verify -P kepler</tt>, and for Indigo, run <tt>mvn clean verify -P indigo</tt>.
  
== Contributing ==
+
== Continuous integration ==
  
Patches and contributions are always welcome! There are many general articles about contributing to Eclipse projects:
+
Continuous integrations jobs for SWTBot are available here https://hudson.eclipse.org/swtbot . Here is a quick description of available jobs:
 +
* ''swtbot-tycho'' is the main CI job. It builds and run tests against an Eclipse Indigo platform and publishes output p2 repository to http://download.eclipse.org/technology/swtbot/snapshots
 +
* ''swtbot-tycho-e4.2'' compiles and runs tests against the last release of Eclipse 4.x branch. It guarantees compatibility with a wide range of Eclipse versions
 +
* ''swtbot-gerrit'' compiles and runs tests against any Gerrit contribution, and then add a vote to the contribution: +1 if everything is fine, -1 in case of a compile error, build error, or failed test
 +
* ''SWTBot-Sonar'' runs (weekly) build and tests against last commit of master branch and generates Sonar reports. See [[#Sonar]]
 +
* Other ''swtbot-*'' are legacy jobs, prior to usage of Maven (2.0.5 and older).
  
 +
== Sonar ==
 +
 +
Sonar is used in order to track Code Quality:
 +
* https://dev.eclipse.org/sonar/dashboard/index/1
 +
* contains results of dedicated build https://hudson.eclipse.org/swtbot/job/SWTBot-Sonar/
 +
 +
== Submit a contribution ==
 +
 +
=== Generalities ===
 +
 +
Patches and contributions are always welcome! There are many general articles about contributing to Eclipse projects:
 
* [http://blog.hantsuki.org/2008/03/07/how-to-contribute-to-eclipse-projects/ How to contribute to Eclipse projects...]
 
* [http://blog.hantsuki.org/2008/03/07/how-to-contribute-to-eclipse-projects/ How to contribute to Eclipse projects...]
 
* [http://www.eclipsezone.com/eclipse/forums/t99339.html Getting started with Eclipse plug-ins: contributing to Eclipse]
 
* [http://www.eclipsezone.com/eclipse/forums/t99339.html Getting started with Eclipse plug-ins: contributing to Eclipse]
 
* [http://www.eclipse.org/articles/article.php?file=Article-How-to-Fix-a-Bug-in-Eclipse/index.html How to Fix a Bug in Eclipse]
 
* [http://www.eclipse.org/articles/article.php?file=Article-How-to-Fix-a-Bug-in-Eclipse/index.html How to Fix a Bug in Eclipse]
  
== See also ==
+
=== Report a bug or suggest an enhancement ===
  
* {{SWTBotLink|Maintaining SWTBot Versions For Your Team|Maintaining SWTBot Versions For Your Team}}
+
Just create a ticket here: https://bugs.eclipse.org/bugs/enter_bug.cgi?product=SWTBot
 +
 
 +
=== Contributions list ===
 +
 
 +
* Unresolved '''Bugzilla''' tickets: https://bugs.eclipse.org/bugs/buglist.cgi?list_id=2369532;classification=Technology;query_format=advanced;bug_status=UNCONFIRMED;bug_status=NEW;bug_status=ASSIGNED;bug_status=REOPENED;product=SWTBot
 +
* Open '''Gerrit''' reviews: https://git.eclipse.org/r/#/q/status:open+project:swtbot/org.eclipse.swtbot,n,z
 +
 
 +
=== Be notified ===
 +
 
 +
* To receive notifications from '''Gerrit''', go to https://git.eclipse.org/r/#/settings/projects , add project ''swtbot/org.eclipse.swtbot.git and tick all checkboxes'' for this project to receive notifications.
 +
* To receive notifications from '''Bugzilla''', go to https://bugs.eclipse.org/bugs/userprefs.cgi?tab=email , and add in '''User watching''' the following mail: ''swtbot-inbox@eclipse.org''.
 +
 
 +
=== Provide a contribution using Gerrit ===
 +
 
 +
# First, make sure you have agreed and signed the [http://www.eclipse.org/legal/clafaq.php Eclipse Contribution CLA].
 +
# Then find out the repository URL. It should be something like 'ssh://username@git.eclipse.org:29418/swtbot/org.eclipse.swtbot.git'. In case you're unsure of the Gerrt repo URL, you can find it at https://git.eclipse.org/r/#/admin/projects/swtbot/org.eclipse.swtbot , once you're logged in.
 +
# Then, read '''carefully''' this documents: [[Gerrit]] to set up commit hooks, learn about Change-Ids and other things.
 +
 
 +
We recommand using the [[Gerrit#Using_Gerrit_with_EGit | EGit-Gerrit connector]]. Make sure that the options ''Add Signed-off by'' and ''Compute Change-Id for Gerrit Code-Review'' are selected in the commit dialog. After the push, the next dialog should show you the log message, which includes the Gerrit review URL.
 +
 
 +
In case you work without EGit Gerrit connector:
 +
# Make your change locally, and ''git commit'' them in your local repo. Commit message must contain Bug Number.
 +
# When you're ready, ''git push'' your change to Gerrit using the following command: <tt>git push ssh://username@git.eclipse.org:29418/swtbot/org.eclipse.swtbot.git HEAD:refs/for/master</tt> or
 +
<source lang="bash">
 +
$ git remote add gerrit
 +
$ git push gerrit HEAD:refs/for/master
 +
</source>
 +
# After the push, log tells you about a URL which tracks the
 +
 
 +
In any case
 +
# Share the URL of the review on the bug you're working on.
 +
 
 +
 
 +
If you want to push an improved version of the patch, just amend your commit, make sure it has the same Change-Id as the original one, and push it again to refs/for/master. This will create another version of your patch, on the same Gerrit review.
 +
 
 +
=== Provide a patch (Deprecated in favor of Gerrit) ===
 +
 
 +
In order to provide a patch, follow the following process:
 +
# <tt>git checkout branch_you_want_to_edit</tt>
 +
# Modify code
 +
# <tt>git add your/modified/file1 your/modified/file2 ...</tt>
 +
# <tt>git commit</tt> Put number of the bug you are working on at the beginning of commit message
 +
# <tt>git format-patch HEAD^</tt>
 +
# Attach generated patch to the bug you want to contribute to.
 +
 
 +
== Committers ==
 +
 
 +
* Committer must '''subscribe to notifications''' to not miss a contribution. See [[#Be Notified|how to set up nofications]]
 +
* Committer have to '''use Gerrit''' too and follow same process as contributors. They can approve their own contributions, but asking review from another contributor is a cool thing.
 +
* A Gerrit contribution is automatically merged when all "acceptance flags" (Verification, review, IP) are OK.
 +
 
 +
== Contribute changes to website ==
 +
 
 +
Website can also be edited using Git and Gerrit process mentioned about for sources:
 +
* Gerrit repo is https://git.eclipse.org/r/p/www.eclipse.org/swtbot.git
  
 
[[Category:Draft Documentation]]
 
[[Category:Draft Documentation]]
 +
 +
== Release process ==
 +
 +
# Make sure upcoming release is listed in http://projects.eclipse.org/projects/technology.swtbot/releases. Click the 'Create a new release...' link and fill the requested information. To edit the release details, select it in the table and click the 'Edit' tab on the following page.
 +
# Announce wish to release on swtbot-dev mailing-list, and wait for approval of committers
 +
# Generate an IPLog from the [https://projects.eclipse.org/projects/technology.swtbot project page] in the Committer Tools side menu
 +
# A bug may be created by the EMO to track the release. When PMC approval is required, send a message to the technology-pmc mailing list ([https://dev.eclipse.org/mhonarc/lists/technology-pmc/msg07388.html example]). Wait for the release to be approved.
 +
# Run all builds on [https://hudson.eclipse.org/swtbot/ Hudson] (swtbot-tycho, SWTBot-Sonar).
 +
# Keep the build and tag it with the version of the release using Hudson UI. In the Job Dashboard for swtbot-tycho, select the build and click 'Keep this build forever' and 'add description' with e.g. '2.1.1 release'.
 +
# Tag source in git repository <source line lang="bash">
 +
$ git fetch eclipse master
 +
$ git checkout FETCH_HEAD
 +
$ git tag 2.1.1 -m "SWTBot 2.1.1 release"
 +
$ git push gerrit 2.1.1
 +
</source>
 +
# Once all CI builds are done, log in to build.eclipse.org, copy and make the release available <source line lang="bash">
 +
$ ssh userid@build.eclipse.org
 +
$ cd download/technology/swtbot
 +
$ cp snapshots releases/2.1.1
 +
$ rm -r releases/latest
 +
$ cp releases/2.1.1 releases/latest
 +
</source>
 +
# From http://portal.eclipse.org, update Bugzilla in the Committer Tools to add the released version as a "version" and the next version as a "milestone".
 +
# Update wiki pages [[../#Update Sites]] and [[../Releases]]
 +
# If necessary, update [https://marketplace.eclipse.org/content/swtbot SWTBot marketplace entry]. Since it's referencing the ''releases/latest'' URL, no change should be required.
 +
# Announce release on swtbot-dev mailing-list and SWTBot forum ([https://dev.eclipse.org/mhonarc/lists/swtbot-dev/msg00698.html example])
 +
# Change all pom.xml, MANIFEST.MF and feature.xml to use the version of next release, git commit and push

Revision as of 14:10, 24 August 2016


SWTBot
Website
Update Sites
Community
Mailing List
Forums/Newsgroups
IRC
Contribute
Open Bugzilla tickets
Open Gerrit reviews
Browse Source
Continuous Integration


Setting up the workspace with Oomph (NEW)

  1. Download and start Oomph.
  2. On the initial page, click on the Switch to advanced mode button in the top right.
  3. On the Product page, select Eclipse IDE for Eclipse Committers.
  4. On the Projects page, double-click SWTBot
  5. Choose your preferred installation settings on the Variables page:
    1. If you plan to contribute patches using Gerrit (section about Gerrit), check "Show all variables" and make sure you select ("SSH (read-write Gerrit)") in the Git or Gerrit repository; the git URI will then look like
      ssh://${git.user.id|username}@git.eclipse.org:29418/swtbot/org.eclipse.swtbot
    2. Then specify your Bugzilla/Hudson password and Git/Gerrit user ID (you can also specify the password and check that your credential are correct using the "Authenticate..." button). An example is shown in the following screenshot. Swtbot-oomph-variables.png
  6. Press next and finish.

This will first create an Eclipse installation with all the needed plug-ins for developing SWTBot (including the Recommended Eclipse plugins), and then will start the new installed Eclipse (press Finish to close the first installation dialog). The new installed Eclipse will automatically setup the workspace and you will have to wait for this procedure to end (you can click on the animated arrow icon on the status bar to show the progress). This workspace setup procedure includes:

  • cloning the SWTBot git repository (you'll be asked for a password if you selected the read-write git URI)
  • setup the target platform
  • setup the API baseline
  • setup Mylyn queries for SWTBot Bugzilla bugs and SWTBot Gerrit reviews
  • setup the Mylyn Hudson build view
  • setup the working sets

Once this procedure ends, your workspace will be built and you are ready to develop.

The installed Eclipse can be found in the "Installation folder name" selected in the "Variables" dialog, under the subdirectory "eclipse".

Getting the source (old manual way)

You can use a git mirror of that repository:

git clone git://git.eclipse.org/gitroot/swtbot/org.eclipse.swtbot.git

You can also browse the repository using a web interface or even by monitoring the mirror of the repository on GitHub.

To contribute changes to the website, use this git repo: https://git.eclipse.org/c/www.eclipse.org/swtbot.git

IDE tips

Recommended Eclipse plugins

It's advised that you use the following plugins in Eclipse:

  • EGit
  • FindBugs (with a high "Minimum rank to report" set in Window > Preferences > Java > Findbugs)
  • Configure JDT in "pedantic" mode: from Window > Preferences > Java > Compiler > Errors/Warning make all violations send a warning, ignore nothing.
  • EclEmma is useful to analyze Coverage Reports
  • ... Any other tool that makes you write better code faster ...

Target Platforms

You can find some ready-to-use target platforms for development in the devtools/target-platforms folder. Each target-platform basically target a version of the Eclipse release train. It's recommended to use one of these target-platform since it contains all SWTBot dependencie. These target-platforms are also used at build time, so your dependencies in IDE will be consistent with dependencies during build. Enable the selected target-platform by opening it in IDE with the target definition editor, and click Set As Target Platform.

In case something is not working well, please report them as a bug.

API Baseline

To track API changes, it is advised to use the API tool. To set up the API baseline, follow these steps:

  • Select "Window -> Preferences". In the window that opens, select "Plug-in Development -> API Baselines" on the left pane.
  • Click on "Add Baseline..."
  • Choose "A target platform" and click Next.
  • In the next page check the box next to the target which contains "baseline" in its name, like "swtbot-baseline".
  • Click "Reset" to download the contents of the target.
  • Specify a name for this baseline in the top area, like "SWTBot API" for example.
  • Click "Finish", then "OK" in the previous dialog.

It should offer you do to a full rebuild. You can click "Yes" at this point.

Building SWTBot

  1. First Get the sources, as explained a few lines above.
  2. then mvn clean verify
  3. That's all!

NOTE: default build performs against Eclipse Luna. You can test and build against Juno instead by activating the "juno" profile: mvn clean verify -P juno, for Kepler, run mvn clean verify -P kepler, and for Indigo, run mvn clean verify -P indigo.

Continuous integration

Continuous integrations jobs for SWTBot are available here https://hudson.eclipse.org/swtbot . Here is a quick description of available jobs:

  • swtbot-tycho is the main CI job. It builds and run tests against an Eclipse Indigo platform and publishes output p2 repository to http://download.eclipse.org/technology/swtbot/snapshots
  • swtbot-tycho-e4.2 compiles and runs tests against the last release of Eclipse 4.x branch. It guarantees compatibility with a wide range of Eclipse versions
  • swtbot-gerrit compiles and runs tests against any Gerrit contribution, and then add a vote to the contribution: +1 if everything is fine, -1 in case of a compile error, build error, or failed test
  • SWTBot-Sonar runs (weekly) build and tests against last commit of master branch and generates Sonar reports. See #Sonar
  • Other swtbot-* are legacy jobs, prior to usage of Maven (2.0.5 and older).

Sonar

Sonar is used in order to track Code Quality:

Submit a contribution

Generalities

Patches and contributions are always welcome! There are many general articles about contributing to Eclipse projects:

Report a bug or suggest an enhancement

Just create a ticket here: https://bugs.eclipse.org/bugs/enter_bug.cgi?product=SWTBot

Contributions list

Be notified

Provide a contribution using Gerrit

  1. First, make sure you have agreed and signed the Eclipse Contribution CLA.
  2. Then find out the repository URL. It should be something like 'ssh://username@git.eclipse.org:29418/swtbot/org.eclipse.swtbot.git'. In case you're unsure of the Gerrt repo URL, you can find it at https://git.eclipse.org/r/#/admin/projects/swtbot/org.eclipse.swtbot , once you're logged in.
  3. Then, read carefully this documents: Gerrit to set up commit hooks, learn about Change-Ids and other things.

We recommand using the EGit-Gerrit connector. Make sure that the options Add Signed-off by and Compute Change-Id for Gerrit Code-Review are selected in the commit dialog. After the push, the next dialog should show you the log message, which includes the Gerrit review URL.

In case you work without EGit Gerrit connector:

  1. Make your change locally, and git commit them in your local repo. Commit message must contain Bug Number.
  2. When you're ready, git push your change to Gerrit using the following command: git push ssh://username@git.eclipse.org:29418/swtbot/org.eclipse.swtbot.git HEAD:refs/for/master or
$ git remote add gerrit 
$ git push gerrit HEAD:refs/for/master
  1. After the push, log tells you about a URL which tracks the

In any case

  1. Share the URL of the review on the bug you're working on.


If you want to push an improved version of the patch, just amend your commit, make sure it has the same Change-Id as the original one, and push it again to refs/for/master. This will create another version of your patch, on the same Gerrit review.

Provide a patch (Deprecated in favor of Gerrit)

In order to provide a patch, follow the following process:

  1. git checkout branch_you_want_to_edit
  2. Modify code
  3. git add your/modified/file1 your/modified/file2 ...
  4. git commit Put number of the bug you are working on at the beginning of commit message
  5. git format-patch HEAD^
  6. Attach generated patch to the bug you want to contribute to.

Committers

  • Committer must subscribe to notifications to not miss a contribution. See how to set up nofications
  • Committer have to use Gerrit too and follow same process as contributors. They can approve their own contributions, but asking review from another contributor is a cool thing.
  • A Gerrit contribution is automatically merged when all "acceptance flags" (Verification, review, IP) are OK.

Contribute changes to website

Website can also be edited using Git and Gerrit process mentioned about for sources:

Release process

  1. Make sure upcoming release is listed in http://projects.eclipse.org/projects/technology.swtbot/releases. Click the 'Create a new release...' link and fill the requested information. To edit the release details, select it in the table and click the 'Edit' tab on the following page.
  2. Announce wish to release on swtbot-dev mailing-list, and wait for approval of committers
  3. Generate an IPLog from the project page in the Committer Tools side menu
  4. A bug may be created by the EMO to track the release. When PMC approval is required, send a message to the technology-pmc mailing list (example). Wait for the release to be approved.
  5. Run all builds on Hudson (swtbot-tycho, SWTBot-Sonar).
  6. Keep the build and tag it with the version of the release using Hudson UI. In the Job Dashboard for swtbot-tycho, select the build and click 'Keep this build forever' and 'add description' with e.g. '2.1.1 release'.
  7. Tag source in git repository
    1. $ git fetch eclipse master
    2. $ git checkout FETCH_HEAD
    3. $ git tag 2.1.1 -m "SWTBot 2.1.1 release"
    4. $ git push gerrit 2.1.1
  8. Once all CI builds are done, log in to build.eclipse.org, copy and make the release available
    1. $ ssh userid@build.eclipse.org
    2. $ cd download/technology/swtbot
    3. $ cp snapshots releases/2.1.1
    4. $ rm -r releases/latest
    5. $ cp releases/2.1.1 releases/latest
  9. From http://portal.eclipse.org, update Bugzilla in the Committer Tools to add the released version as a "version" and the next version as a "milestone".
  10. Update wiki pages SWTBot#Update Sites and SWTBot/Releases
  11. If necessary, update SWTBot marketplace entry. Since it's referencing the releases/latest URL, no change should be required.
  12. Announce release on swtbot-dev mailing-list and SWTBot forum (example)
  13. Change all pom.xml, MANIFEST.MF and feature.xml to use the version of next release, git commit and push

Back to the top