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 "SWT/Devel/Workflow"

< SWT‎ | Devel
m (Backporting Patches)
(Bugzilla)
 
(18 intermediate revisions by the same user not shown)
Line 1: Line 1:
= Launching Eclipse with SWT source code =  
+
= General tips =
To test SWT snippets, it's useful to launch a child Eclipse with your patch to see how it looks and feels.
+
To do so, under run-configurations, right click on "Eclipse Application" and select "new".
+
[[File:RunConfigurationWithEclipseApplication.png|thumbnail|center|Eclipse Application]]
+
  
 
== Common troubleshooting ==
 
== Common troubleshooting ==
Often Eclipse won't launch with various errors. Below are common steps to troubleshoot.
+
Often Eclipse won't launch with various errors. Below are common steps to troubleshoot:
  
* '''API Baseline: ''' Make sure API Base line is set. If you updated Eclipse (e.g Luna to Mars), you may need to re-create the baseline.
+
* '''API Baseline: ''' Make sure API Baseline is set. If you updated Eclipse (e.g Neon to Oxygen), you may need to re-create the baseline.
* '''Enable Execution Environments: ''' Make sure that relevant Execution Environments are enabled. (1.5, 1.6 etc..)
+
* '''Enable Execution Environments: ''' Make sure that relevant Execution Environments are enabled (1.5, 1.6 etc.).
 
[[File:Eclipse Preference Executin Environments.png|thumbnail|center|Eclipse Execution Environments]]
 
[[File:Eclipse Preference Executin Environments.png|thumbnail|center|Eclipse Execution Environments]]
 
* '''Target Platform: ''' Make sure to have an Target Platform set. Try re-creating it with Default for running platform.
 
* '''Target Platform: ''' Make sure to have an Target Platform set. Try re-creating it with Default for running platform.
* '''Validate Plugins: ''' In the run-time configuration for a Child Eclipse, under the 'Plug-ins' tab, instead of launching all plugins, try to select only SWT and it's binaries. Try to Validate the setup to see if there are missing dependencies.
+
* '''Validate Plugins: ''' In the runtime configuration for a child Eclipse, under the 'Plug-ins' tab, instead of launching all plugins, try to select only SWT and the binaries project. Try to Validate the setup to see if there are missing dependencies.
* '''re-create new run-time configuration: ''' Often after updating Eclipse version,  I have to create new "Eclipse Application" run time configurations for the child Eclipse to launch propertly
+
  
== Tips ==
+
= Bugzilla =
* '''Choice of child Eclipse Workspace:''' Instead of using a blank workspace, copy your exiting workspace, append '-runtime' and use that for your child Eclipse.
+
= Preserving run configurations across workspaces =
+
If you are using the same major version of Eclipse across workspaces, you can copy your run configurations across to prevent losing them. It's highly recommended that you backup your workspace before copying, in case something goes awry.
+
  
To find your current launch configurations, navigate to:
+
All SWT bugs and new development work is carried out via the [https://bugs.eclipse.org/bugs/ Eclipse Bugzilla instance.]
  <workspace directory>/.metadata/.plugins/org.eclipse.debug.core/.launches
+
  
In this folder, there should be a .launch file for every run configuration created within Eclipse. Copy all these files to:
+
== Triage process overview ==
  <new workspace directory>/.metadata/.plugins/org.eclipse.debug.core/.launches
+
The goal of triage is a '''quick''' initial response to incoming bug submissions from users.<br> The intent is for users to receive initial feedback on their submission and for bugs to be categorized properly so that developers can find/identify them easily.
  
Launch Eclipse using the new workspace. Open the run configurations dialog, all the old run configurations should be there.
+
If the bug has sufficient information and is reproducible, then add the "'''triaged'''" keyword to it and optionally leave some message for the user e.g "Thank you for bug submission, I can reproduce the issue.". The bug status should remain "NEW" and remain assigned to platform-swt-inbox@eclipse.org.
= Using Gerrit =
+
Gerrit is used to review your patches. For further information, please see [[SWT/Devel/Gerrit | gerrit.]]
+
  
= Backporting Patches =
+
Subsequently, when developers look for new bugs to work on, they can check bugs that have the "triaged" keyword. <br>
== Overview ==
+
All the triaged bugs with assignee as platform-swt-inbox@eclipse.org and status=NEW are considered active but are not currently being worked on. These bugs are available for anyone in the community to work on.<br>
It's recommended to backport as following:
+
Assign "helpwanted" keyword for bugs that developers might not have time to work, but will review patches for.<br><br>
* Create a seperate brach from R_X_maintenance
+
* Create a new patch that contains changes for your backport (I.e, one with a new changeID [Ref 1 below])
+
* Submit it for review to gerrit. This should link to the bugzilla ticket. (Pushing directly doesn't leave a clean link in Bugzilla bug).
+
  
== Details ==
+
The purpose of a bug's status is to tell readers if someone is working on a bug or not:
This can be done as following:
+
* NEW means that nobody is working on a bug, you can start work on it.
* '''Checkout Maintenance patch'''
+
* ASSIGNED means someone is already working on the bug. When work has started on a bug, (either by you, or patch is being provided by community), then the status can be set to ASSIGNED. If for some reason work stops and requires a new contributor, the status should be returned back to "NEW".
** Open Eclipse, checkout "origin/R_X_maintenance" as local branch.
+
<br>
** Create a new branch off of it and it's name should be something of your choosing: ex: R4_6_maintenance_bug_BkP_487757_ScrolledComposite (do not name R4_6_maintenance to avoid confusion with maint branch)
+
See the following diagram:<br>
** Uncheck 'configure upstream for push and pull'
+
[[File:Platform-Triage-Process-v2.png|thumbnail|left]]
 +
<br>
 +
<br>
 +
<br>
 +
<br>
 +
<br>
 +
<br>
 +
<br>
  
* '''Apply changes from the desired patch'''
+
As an SWT developer, consider [https://devzing.com/blog/index.php/bugzilla-tip-have-bugzilla-email-me-when-another-person-is-assigned-a-bug/ watching] the platform-swt-inbox@eclipse.org user in Bugzilla to get notifications about new and triaged bugs.
** Either:  
+
*** Manually copy changed lines of code, create a new patch.
+
*** Or just find the desired commit form the git history and click on the '''cherry pick''' button in the upper left corner. After cherry picking it, go into the git history, amend your cherry pick and change the 'Change Id' to I000 ... [See Ref 1 below]. Commit and verify that your Change ID is different from the original patch (this is gerrit knows it's a different submission and not a new patch set).
+
** Test your patch first with jUnit etc.. Ensure there are no errors in project. (you may need to clean/rebuild/swtjni rebuild bindings)
+
** Be mindful of dependencies. For example a patch might depend on a new binding in OS.java from a previous patch that has not been back-ported yet.
+
  
* '''Pushing to Gerrit'''
+
=== Triage check list ===
** Right click on SWT git repository and click on "Push to Gerrit"
+
Use the following as a guideline on how to triage a bug:
** Make sure to change the branch that you're pushing to from '''master''' to something like '''R4_6_maintenance'''. TIP: you can press ctrl+space in the entry and Eclipse will predict branch names. (And after pushing to gerrit, verify that you're pushing to the maintenance branch not master).
+
** Select the correct URI:
+
*** From URI, click on drop down list and select: ssh://YOUR_USERNAME@git.eclipse.org:29418/platform/eclipse.platform.swt.git
+
*** (!) Ensure that there is no ''gitroot'' in name (as this may be in the default selection), as push to gitroot will fail.
+
Be attentive:
+
                ex wrong: ssh://lufimtsev@git.eclipse.org:29418/gitroot/platform/eclipse.platform.swt.git
+
                ex right: ssh://lufimtsev@git.eclipse.org:29418/platform/eclipse.platform.swt.git
+
                                                                ^- Platform vs gitroot. Platform is what you want
+
  
If 'push to gerrit' is missing, then you may need to configure gerrit for pushing to review first. for 'push to gerrit to work.
+
* Check for duplicate bugs
 +
* Set/update metadata/keywords/status correctly
 +
* Link to other relevant bugs
 +
* Briefly investigate if bug is real (i.e, reproducible on latest build or branch)
 +
* Ask user to test with newer version if the reported version is very old
 +
* Request versions of SWT/OS/GTK/WebKit. Note, GTK/WebKit versions can be acquired by [https://bugs.eclipse.org/bugs/show_bug.cgi?id=519124 setting version variable] :
 +
  export SWT_LIB_VERSIONS=1
 +
  eclipse
  
It should look like this:
+
* Request a snippet (or clear steps to reproduce) if it's not clear as to how to reproduce issue
 +
* Ping/CC developers involved in related issue (especially when regressions occur)
 +
* Try to bisect codebase for regression reports (optional/time permitting)
  
[[File:PushToGerritMaintenanceDialogue.png|thumbnail|center]]
+
=== Setting proper metadata ===
 +
* For severity and priority see [[WTP/Conventions_of_bug_priority_and_severity | the bug priority and severity guidelines.]]
 +
* Prefix OS and Component to bug summary. <br>
 +
** OS: [GTK][GTK2][GTK3][Wayland][Cocoa][Win32]
 +
*** PI means Native library interface.
 +
*** 64 means 32/64 bit issues.
 +
*** I18N means Internationalization issues.
 +
*** BiDi means Bi-directional text
 +
** ex: [GTK3] Button background not styled.
 +
* Bug reports which are regressions can make use of the "regression" keyword
 +
* Set appropriate target milestone if we plan to fix it within a particular time frame -- this is usually used by committers.
  
[Ref 1] : New changeID can be created by setting the changeID in Eclipse to: 
+
== Bugzilla queries ==
Change-Id: I0000000000000000000000000000000000000000
+
This works only in Eclipse git. For native git you would have to use custom hooks.
+
Tip: You can toggle the "ammend commit" button to get to a zero Change ID, then copy it back to your change id.
+
  
== Note on cherry picking ==
+
=== New Bugs ===
Blind cherry picking can cause problems as it may not pull in all the dependencies that you need for the build to succeed. <br>
+
* [https://bugs.eclipse.org/bugs/buglist.cgi?bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&columnlist=product%2Ccomponent%2Cpriority%2Cvotes%2Cbug_severity%2Ctarget_milestone%2Cbug_status%2Cresolution%2Cshort_desc%2Cchangeddate%2Cstatus_whiteboard%2Ckeywords%2Copendate%2Cversion&field0-0-0=product&field0-0-1=component&field1-0-0=assigned_to&field2-0-0=keywords&no_redirect=1&order=votes%20DESC%2Cbug_status%2Cpriority%2Cassigned_to%2Cbug_id&query_based_on=&query_format=advanced&type0-0-0=substring&type0-0-1=substring&type1-0-0=substring&type2-0-0=nowords&value0-0-0=swt&value0-0-1=swt&value1-0-0=platform-swt-inbox&value2-0-0=Triage    Highest voted bugs]
With that said, if you find a reliable method to cherry pick a patch instead of copying lines of code across, please document it here.
+
* [https://bugs.eclipse.org/bugs/buglist.cgi?bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&columnlist=product%2Ccomponent%2Cpriority%2Cvotes%2Cbug_severity%2Ctarget_milestone%2Cbug_status%2Cresolution%2Cshort_desc%2Cchangeddate%2Cstatus_whiteboard%2Ckeywords%2Copendate%2Cversion&field0-0-0=product&field0-0-1=component&field1-0-0=assigned_to&field2-0-0=keywords&no_redirect=1&query_based_on=&query_format=advanced&type0-0-0=substring&type0-0-1=substring&type1-0-0=substring&type2-0-0=nowords&value0-0-0=swt&value0-0-1=swt&value1-0-0=platform-swt-inbox&value2-0-0=Triage      All]
 +
* [https://bugs.eclipse.org/bugs/buglist.cgi?bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&columnlist=product%2Ccomponent%2Cpriority%2Cbug_severity%2Cvotes%2Cbug_status%2Cstatus_whiteboard%2Ctarget_milestone%2Cshort_desc%2Cop_sys%2Cchangeddate%2Copendate%2Ckeywords%2Ctag%2Creporter%2Cversion&field0-0-0=product&field0-0-1=component&field1-0-0=assigned_to&field2-0-0=keywords&field3-0-0=op_sys&field3-0-1=op_sys&field3-0-2=op_sys&field4-0-0=op_sys&order=priority%2Cvotes%20DESC%2Cbug_severity%2Ctarget_milestone%2Cbug_status%2Cassigned_to%2Cbug_id&query_based_on=&query_format=advanced&type0-0-0=substring&type0-0-1=substring&type1-0-0=substring&type2-0-0=nowords&type3-0-0=substring&type3-0-1=substring&type3-0-2=substring&type4-0-0=notsubstring&value0-0-0=swt&value0-0-1=swt&value1-0-0=platform-swt-inbox%40eclipse.org&value2-0-0=Triaged&value3-0-0=All&value3-0-1=Linux&value3-0-2=CentOS&value4-0-0=Windows      All and Linux, CentOS]
 +
* [https://bugs.eclipse.org/bugs/buglist.cgi?bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&columnlist=product%2Ccomponent%2Cpriority%2Cvotes%2Cbug_severity%2Ctarget_milestone%2Cbug_status%2Cresolution%2Cshort_desc%2Cchangeddate%2Cstatus_whiteboard%2Ckeywords%2Copendate%2Cversion&f0=OP&f1=OP&f10=CP&f11=OP&f12=OP&f13=keywords&f14=CP&f15=CP&f2=product&f3=component&f4=CP&f5=CP&f6=OP&f7=OP&f8=assigned_to&f9=CP&j1=OR&j12=OR&j7=OR&o13=nowords&o2=substring&o3=substring&o8=substring&op_sys=Windows%20All&op_sys=Windows%2095&op_sys=Windows%2098&op_sys=Windows%202000&op_sys=Windows%20Server%202003&op_sys=Windows%20Server%202008&op_sys=Windows%207&op_sys=Windows%208&op_sys=Windows%2010&op_sys=Windows%20CE&op_sys=Windows%20ME&op_sys=Windows%20Mobile%202003&op_sys=Windows%20Mobile%205.0&op_sys=Windows%20NT&op_sys=Windows%20XP&op_sys=Windows%20Vista&op_sys=Windows%20Vista-WPF&order=priority%2Cvotes%20DESC%2Cbug_severity%2Ctarget_milestone%2Cbug_status%2Cassigned_to%2Cbug_id&query_based_on=&query_format=advanced&v13=Triage&v2=swt&v3=swt&v8=platform-swt-inbox  All and Win32]
 +
* [https://bugs.eclipse.org/bugs/buglist.cgi?bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&columnlist=product%2Ccomponent%2Cpriority%2Cvotes%2Cbug_severity%2Ctarget_milestone%2Cbug_status%2Cresolution%2Cshort_desc%2Cchangeddate%2Cstatus_whiteboard%2Ckeywords%2Copendate%2Cversion&f0=OP&f1=OP&f10=CP&f11=OP&f12=OP&f13=keywords&f14=CP&f15=CP&f2=product&f3=component&f4=CP&f5=CP&f6=OP&f7=OP&f8=assigned_to&f9=CP&j1=OR&j12=OR&j7=OR&o13=nowords&o2=substring&o3=substring&o8=substring&op_sys=Mac%20OS%20X%20-%20Carbon%20%28unsup.%29&op_sys=Mac%20OS%20X&query_format=advanced&v13=Triage&v2=swt&v3=swt&v8=platform-swt-inbox  All and Cocoa]
  
== Note on pushing to branch directly ==
+
=== Triaged bugs ===
'''The following is discouraged, but here for reference purposes.'''
+
* [https://bugs.eclipse.org/bugs/buglist.cgi?bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&columnlist=product%2Ccomponent%2Cpriority%2Cvotes%2Cbug_severity%2Ctarget_milestone%2Cbug_status%2Cstatus_whiteboard%2Cshort_desc%2Ckeywords%2Ctag%2Clongdescs.count%2Cchangeddate%2Copendate%2Creporter&field0-0-0=product&field0-0-1=component&field1-0-0=assigned_to&field2-0-0=keywords&no_redirect=1&order=priority%2Cvotes%20DESC%2Cbug_severity%2Ctarget_milestone%20DESC%2Cbug_status%2Cassigned_to%2Cbug_id&query_based_on=&query_format=advanced&type0-0-0=substring&type0-0-1=substring&type1-0-0=substring&type2-0-0=anywords&value0-0-0=swt&value0-0-1=swt&value1-0-0=platform-swt-inbox&value2-0-0=Triaged All]
 +
* [https://bugs.eclipse.org/bugs/buglist.cgi?bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&columnlist=product%2Ccomponent%2Cpriority%2Cbug_severity%2Cvotes%2Cbug_status%2Cstatus_whiteboard%2Ctarget_milestone%2Cshort_desc%2Cop_sys%2Cchangeddate%2Copendate%2Ckeywords%2Ctag%2Creporter%2Cversion&field0-0-0=product&field0-0-1=component&field1-0-0=assigned_to&field2-0-0=keywords&field3-0-0=op_sys&field3-0-1=op_sys&field3-0-2=op_sys&field4-0-0=op_sys&order=priority%2Cvotes%20DESC%2Cbug_severity%2Ctarget_milestone%2Cbug_status%2Cassigned_to%2Cbug_id&query_based_on=&query_format=advanced&type0-0-0=substring&type0-0-1=substring&type1-0-0=substring&type2-0-0=nowords&type3-0-0=substring&type3-0-1=substring&type3-0-2=substring&type4-0-0=notsubstring&value0-0-0=swt&value0-0-1=swt&value1-0-0=platform-swt-inbox%40eclipse.org&value2-0-0=Triaged&value3-0-0=All&value3-0-1=Linux&value3-0-2=CentOS&value4-0-0=Windows      All, Linux, CentOS, Unix]
 +
* [https://bugs.eclipse.org/bugs/buglist.cgi?bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&classification=Eclipse&component=SWT&keywords=triaged%2C%20&keywords_type=allwords&op_sys=All&op_sys=Windows%20All&op_sys=Windows%2095&op_sys=Windows%2098&op_sys=Windows%202000&op_sys=Windows%20Server%202003&op_sys=Windows%20Server%202008&op_sys=Windows%207&op_sys=Windows%208&op_sys=Windows%2010&op_sys=Windows%20CE&op_sys=Windows%20ME&op_sys=Windows%20Mobile%202003&op_sys=Windows%20Mobile%205.0&op_sys=Windows%20NT&op_sys=Windows%20XP&op_sys=Windows%20Vista&op_sys=Windows%20Vista-WPF&order=Importance&product=Platform&query_format=advanced      All, Windows]
 +
* [https://bugs.eclipse.org/bugs/buglist.cgi?bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&classification=Eclipse&component=SWT&keywords=triaged%2C%20&keywords_type=allwords&op_sys=All&op_sys=Mac%20OS%20X%20-%20Carbon%20%28unsup.%29&op_sys=Mac%20OS%20X&product=Platform&query_format=advanced All, Cocoa]
  
You can push changes directly to maintenance branch if you have committer rights:
+
=== Query construction ===
  git push review HEAD:R4_X_maintenance
+
To construct the queries above:
  
== Note about backporting to versions earlier than n-1 ==
+
Use [https://bugs.eclipse.org/bugs/page.cgi?id=quicksearch.html quick search]. For example:
A good explanation has been given by Markus Keller in: https://bugs.eclipse.org/bugs/show_bug.cgi?id=312451#c56
+
* :swt @platform-swt-inbox@eclipse.org -!Triaged
 +
* :swt @platform-swt-inbox@eclipse.org -!Triaged os:All,Linux,CentOS -os:Windows
 +
* etc.
  
    We only do that rarely, and only after the fix has been backported and tested in the active maintenance branch for a while.
+
Columns were changed, such that the following were kept:
    To backport to out-of-service branches, a few things need to be done carefully:
+
* Product, Component, Priority, Severity, Votes, Status, Whiteboard, Target Milestone, Summary, OS, Changed, Opened, Keywords, Tags, Reporter, Version, # of comments
    - Create a new bug, set its target milestone to the oldest x.y.z+ version, and make sure it depends on the original bug
+
* "Stagger Headers" was used.
    - Also backport the fix to *all* maintenance branches that are newer than the one you're interested in. This is important for consumers. E.g. moving from 4.3.2+ to 4.4.2+ must not lose any backported fixes.
+
    - Make sure you correctly update all necessary bundle and feature version numbers (i.e. all features that contain SWT). E.g. adding 0.0.1 everywhere would be wrong.
+
    - Test the fix in all branches.
+
  
In addition you will need a +1 from an SWT project lead in the bug report.
+
Then result was sorted in desired order: Priority, Votes, Severity, Target Milestone
 +
 
 +
URL was copied.
 +
 
 +
In the past, triaged bugs were re-assigned from a platform-swt-inbox@eclipse.org to a swt-triaged@eclipse.org user. Instead, we now just add the "triaged" keyword.
 +
 
 +
In the distant past, bugs were assigned to component owners, but that lead to component owners to have large amount of bugs that they did not actually work on.
 +
 
 +
Some projects used to use platform-inbox, but to mark a bug as triaged, the "ASSIGNED" status was used. But this could lead to confusion where users could think that
 +
 
 +
= Gerrit =
 +
 
 +
== Configure Repository for Gerrit review ==
 +
Eclipse/SWT uses a code review tool called [https://git.eclipse.org/r Gerrit].
 +
 
 +
=== Using EGit ===
 +
It's quite easy to configure Gerrit if you have the [https://www.eclipse.org/egit/ EGit] plugin installed.
 +
# Open the "Git Repositories" view
 +
# Expand the "org.eclipse.swt" item (assuming you have the org.eclipse.platform.swt project in your EGit repositories view)
 +
# Expand the "Remotes" item
 +
# Right click the "origin" item, and select "Gerrit configuration"
 +
# Fill in your information from Gerrit (username).
 +
 
 +
=== Manual configuration ===
 +
Edit your git config file from the SWT repository. The file is located in top level directory of the org.eclipse.platform.swt git repository:
 +
  .git/config
 +
 
 +
Then add the review branch:
 +
  [remote "review"]
 +
    url = ssh://YOUR_GERRIT_USER_NAME@git.eclipse.org:29418/platform/eclipse.platform.swt.git
 +
    push = HEAD:refs/for/master
 +
 
 +
Substitute YOUR_GERRIT_USER_NAME with your username like 'lufimtsev' (not your full email address).
 +
 
 +
Now you can push patches to review
 +
  git push review
 +
 
 +
== Reviewing Changes ==
 +
 
 +
=== Fetching changes from Gerrit into Eclipse ===
 +
For simplicity and ease of use, you can fetch changes from Gerrit into Eclipse using Egit (this assumes you have it installed).
 +
 
 +
To do so, you must know the Gerrit change number, and have your git config set up for review. Note: change number ''is not'' the same as change-ID.
 +
 
 +
To find the change number, go to the Gerrit review you intend to fetch and look at the URL to see the change number:
 +
  git.eclipse.org/r/#/c/change_number_will_be_here/
 +
 
 +
You can also look at the header above the commit message, "Change <change_number>".
 +
 
 +
To fetch it, right click the repository in Eclipse that contains the change, and select "Fetch from Gerrit..." The following window will appear:
 +
 
 +
[[File:Fetch from Gerrit window.png|thumbnail|center|Fetch from Gerrit window]]
 +
 
 +
 
 +
Enter the change number from Gerrit and press Ctrl + Space. Eclipse will pull information for the change and provide a drop down menu of patch sets to choose from. Choose the patch set you wish to fetch.
 +
 
 +
If you wish to create a separate branch with these changes, keep the default selected option and enter a branch name.
 +
 
 +
If you want the changes applied against the branch you are currently on, select the "Checkout FETCH_HEAD" option. Click finish and Eclipse will fetch the changes into your workspace.
 +
 
 +
=== Identifying dependencies between patches ===
 +
Sometimes you want to know which patches have to be pushed to master before your patch can be merged (dependencies).
 +
 
 +
"Related changes" will pop up if there are related changes (e.g your patch depends on another patch, or it's a pre-requisite for another patch).
 +
 
 +
In older versions of Gerrit, there were explicit titles for 'parent' patches and 'child' patches. However now one thing to note is that the related changes are listed the same way a 'git-log' is listed. Meaning all dependencies will appear below the current patch etc...
 +
Please see documentation for details: [[https://gerrit-review.googlesource.com/Documentation/user-review-ui.html#related-changes-tab]]
 +
 
 +
= Adding API to SWT =
 +
SWT API has to be backwards compatible, meaning changing existing API is basically not an option (except in a few cases). However it's very common to add new API -- to do so, follow the steps below.
 +
 
 +
# Add the API. If you are doing this in a common class, you only have to add it once. Otherwise, be sure to add the constant/method to all platforms' classes.
 +
# If this is the ''first'' time you are adding API in this release cycle, bump the minor "version" fields in the pom.xml and MANIFEST.mf files. For example, 3.107.100 -> 3.108.0
 +
# Write the Javadocs, and be sure to include @since tags, indicating the API is available since the API version you just bumped in step 2.
 +
 
 +
== Setting an API baseline ==
 +
In general, it's important to configure API tools properly to warn you about API changes and versions that need to be bumped. To set an API baseline:
 +
 
 +
# Go to Windows -> Preferences. Search for "API baseline"
 +
# Click "Add Baseline"
 +
# Select "An existing Eclipse installation directory"
 +
# Click "Browse" and point the wizard to the binary "eclipse" file for your current Eclipse installation
 +
# Click "Finish"
  
 
= Mylyn =
 
= Mylyn =
  
Nice Video tutorials:
+
[https://www.eclipse.org/mylyn/ Mylyn] is the task and application lifecycle management (ALM) framework for Eclipse.
 +
 
 +
Some video tutorials:
 
* Mylyn overview: [https://www.youtube.com/watch?v=2wp32Ow_OmE Youtube : Mylyn Overview]
 
* Mylyn overview: [https://www.youtube.com/watch?v=2wp32Ow_OmE Youtube : Mylyn Overview]
* Mylyn, doing code reviews on gerrit [https://youtu.be/gq5w6HAr_CE?t=2589 Youtube : Code review inside Eclipse with gerrit]
+
* Doing Gerrit code reviews on through Mylyn [https://youtu.be/gq5w6HAr_CE?t=2589 Youtube : Code review inside Eclipse with Gerrit]
  Note, you need to install the 'Gerrit' connector inside mylyn.
+
 
 +
= Writing new and noteworthy (N&N) posts =
 +
If you've added a new feature or fixed a significant bug, it's often useful to write an N&N post. N&N posts are short HTML entries in a milestone's/release's N&N page. The N&N page showcases improvements and features for all aspects of the Eclipse IDE during that milestone/release. To write an N&N post:
 +
 
 +
# Clone the [git://git.eclipse.org/gitroot/www.eclipse.org/eclipse/news.git eclipse/news] repository
 +
# Look for the folder and file corresponding to the milestone/release and component you want to write about (for example: 4.9/platform.html)
 +
# Follow the instructions in the HTML page and/or look at other posts as example
 +
# Add a new section with a meaningful title and a short description about the feature/bug that was fixed. Images can be added to further demonstrate the fix (follow the instructions in the HTML file re: images)
 +
# Upload the change to the Gerrit repo for eclipse/news and add a committer from your component to review it

Latest revision as of 14:45, 21 August 2018

General tips

Common troubleshooting

Often Eclipse won't launch with various errors. Below are common steps to troubleshoot:

  • API Baseline: Make sure API Baseline is set. If you updated Eclipse (e.g Neon to Oxygen), you may need to re-create the baseline.
  • Enable Execution Environments: Make sure that relevant Execution Environments are enabled (1.5, 1.6 etc.).
Eclipse Execution Environments
  • Target Platform: Make sure to have an Target Platform set. Try re-creating it with Default for running platform.
  • Validate Plugins: In the runtime configuration for a child Eclipse, under the 'Plug-ins' tab, instead of launching all plugins, try to select only SWT and the binaries project. Try to Validate the setup to see if there are missing dependencies.

Bugzilla

All SWT bugs and new development work is carried out via the Eclipse Bugzilla instance.

Triage process overview

The goal of triage is a quick initial response to incoming bug submissions from users.
The intent is for users to receive initial feedback on their submission and for bugs to be categorized properly so that developers can find/identify them easily.

If the bug has sufficient information and is reproducible, then add the "triaged" keyword to it and optionally leave some message for the user e.g "Thank you for bug submission, I can reproduce the issue.". The bug status should remain "NEW" and remain assigned to platform-swt-inbox@eclipse.org.

Subsequently, when developers look for new bugs to work on, they can check bugs that have the "triaged" keyword.
All the triaged bugs with assignee as platform-swt-inbox@eclipse.org and status=NEW are considered active but are not currently being worked on. These bugs are available for anyone in the community to work on.
Assign "helpwanted" keyword for bugs that developers might not have time to work, but will review patches for.

The purpose of a bug's status is to tell readers if someone is working on a bug or not:

  • NEW means that nobody is working on a bug, you can start work on it.
  • ASSIGNED means someone is already working on the bug. When work has started on a bug, (either by you, or patch is being provided by community), then the status can be set to ASSIGNED. If for some reason work stops and requires a new contributor, the status should be returned back to "NEW".


See the following diagram:

Platform-Triage-Process-v2.png








As an SWT developer, consider watching the platform-swt-inbox@eclipse.org user in Bugzilla to get notifications about new and triaged bugs.

Triage check list

Use the following as a guideline on how to triage a bug:

  • Check for duplicate bugs
  • Set/update metadata/keywords/status correctly
  • Link to other relevant bugs
  • Briefly investigate if bug is real (i.e, reproducible on latest build or branch)
  • Ask user to test with newer version if the reported version is very old
  • Request versions of SWT/OS/GTK/WebKit. Note, GTK/WebKit versions can be acquired by setting version variable :
 export SWT_LIB_VERSIONS=1
 eclipse
  • Request a snippet (or clear steps to reproduce) if it's not clear as to how to reproduce issue
  • Ping/CC developers involved in related issue (especially when regressions occur)
  • Try to bisect codebase for regression reports (optional/time permitting)

Setting proper metadata

  • For severity and priority see the bug priority and severity guidelines.
  • Prefix OS and Component to bug summary.
    • OS: [GTK][GTK2][GTK3][Wayland][Cocoa][Win32]
      • PI means Native library interface.
      • 64 means 32/64 bit issues.
      • I18N means Internationalization issues.
      • BiDi means Bi-directional text
    • ex: [GTK3] Button background not styled.
  • Bug reports which are regressions can make use of the "regression" keyword
  • Set appropriate target milestone if we plan to fix it within a particular time frame -- this is usually used by committers.

Bugzilla queries

New Bugs

Triaged bugs

Query construction

To construct the queries above:

Use quick search. For example:

  •  :swt @platform-swt-inbox@eclipse.org -!Triaged
  •  :swt @platform-swt-inbox@eclipse.org -!Triaged os:All,Linux,CentOS -os:Windows
  • etc.

Columns were changed, such that the following were kept:

  • Product, Component, Priority, Severity, Votes, Status, Whiteboard, Target Milestone, Summary, OS, Changed, Opened, Keywords, Tags, Reporter, Version, # of comments
  • "Stagger Headers" was used.

Then result was sorted in desired order: Priority, Votes, Severity, Target Milestone

URL was copied.

In the past, triaged bugs were re-assigned from a platform-swt-inbox@eclipse.org to a swt-triaged@eclipse.org user. Instead, we now just add the "triaged" keyword.

In the distant past, bugs were assigned to component owners, but that lead to component owners to have large amount of bugs that they did not actually work on.

Some projects used to use platform-inbox, but to mark a bug as triaged, the "ASSIGNED" status was used. But this could lead to confusion where users could think that

Gerrit

Configure Repository for Gerrit review

Eclipse/SWT uses a code review tool called Gerrit.

Using EGit

It's quite easy to configure Gerrit if you have the EGit plugin installed.

  1. Open the "Git Repositories" view
  2. Expand the "org.eclipse.swt" item (assuming you have the org.eclipse.platform.swt project in your EGit repositories view)
  3. Expand the "Remotes" item
  4. Right click the "origin" item, and select "Gerrit configuration"
  5. Fill in your information from Gerrit (username).

Manual configuration

Edit your git config file from the SWT repository. The file is located in top level directory of the org.eclipse.platform.swt git repository:

 .git/config

Then add the review branch:

 [remote "review"]
   url = ssh://YOUR_GERRIT_USER_NAME@git.eclipse.org:29418/platform/eclipse.platform.swt.git
   push = HEAD:refs/for/master

Substitute YOUR_GERRIT_USER_NAME with your username like 'lufimtsev' (not your full email address).

Now you can push patches to review

 git push review

Reviewing Changes

Fetching changes from Gerrit into Eclipse

For simplicity and ease of use, you can fetch changes from Gerrit into Eclipse using Egit (this assumes you have it installed).

To do so, you must know the Gerrit change number, and have your git config set up for review. Note: change number is not the same as change-ID.

To find the change number, go to the Gerrit review you intend to fetch and look at the URL to see the change number:

 git.eclipse.org/r/#/c/change_number_will_be_here/ 

You can also look at the header above the commit message, "Change <change_number>".

To fetch it, right click the repository in Eclipse that contains the change, and select "Fetch from Gerrit..." The following window will appear:

File:Fetch from Gerrit window.png
Fetch from Gerrit window


Enter the change number from Gerrit and press Ctrl + Space. Eclipse will pull information for the change and provide a drop down menu of patch sets to choose from. Choose the patch set you wish to fetch.

If you wish to create a separate branch with these changes, keep the default selected option and enter a branch name.

If you want the changes applied against the branch you are currently on, select the "Checkout FETCH_HEAD" option. Click finish and Eclipse will fetch the changes into your workspace.

Identifying dependencies between patches

Sometimes you want to know which patches have to be pushed to master before your patch can be merged (dependencies).

"Related changes" will pop up if there are related changes (e.g your patch depends on another patch, or it's a pre-requisite for another patch).

In older versions of Gerrit, there were explicit titles for 'parent' patches and 'child' patches. However now one thing to note is that the related changes are listed the same way a 'git-log' is listed. Meaning all dependencies will appear below the current patch etc... Please see documentation for details: [[1]]

Adding API to SWT

SWT API has to be backwards compatible, meaning changing existing API is basically not an option (except in a few cases). However it's very common to add new API -- to do so, follow the steps below.

  1. Add the API. If you are doing this in a common class, you only have to add it once. Otherwise, be sure to add the constant/method to all platforms' classes.
  2. If this is the first time you are adding API in this release cycle, bump the minor "version" fields in the pom.xml and MANIFEST.mf files. For example, 3.107.100 -> 3.108.0
  3. Write the Javadocs, and be sure to include @since tags, indicating the API is available since the API version you just bumped in step 2.

Setting an API baseline

In general, it's important to configure API tools properly to warn you about API changes and versions that need to be bumped. To set an API baseline:

  1. Go to Windows -> Preferences. Search for "API baseline"
  2. Click "Add Baseline"
  3. Select "An existing Eclipse installation directory"
  4. Click "Browse" and point the wizard to the binary "eclipse" file for your current Eclipse installation
  5. Click "Finish"

Mylyn

Mylyn is the task and application lifecycle management (ALM) framework for Eclipse.

Some video tutorials:

Writing new and noteworthy (N&N) posts

If you've added a new feature or fixed a significant bug, it's often useful to write an N&N post. N&N posts are short HTML entries in a milestone's/release's N&N page. The N&N page showcases improvements and features for all aspects of the Eclipse IDE during that milestone/release. To write an N&N post:

  1. Clone the eclipse/news repository
  2. Look for the folder and file corresponding to the milestone/release and component you want to write about (for example: 4.9/platform.html)
  3. Follow the instructions in the HTML page and/or look at other posts as example
  4. Add a new section with a meaningful title and a short description about the feature/bug that was fixed. Images can be added to further demonstrate the fix (follow the instructions in the HTML file re: images)
  5. Upload the change to the Gerrit repo for eclipse/news and add a committer from your component to review it

Back to the top