Bug 351056 - [publisher] Allow fail on error in publishers
Summary: [publisher] Allow fail on error in publishers
Status: RESOLVED WONTFIX
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: P2 Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks: 325611 342198 364855
  Show dependency tree
 
Reported: 2011-07-04 04:27 EDT by Tobias Oberlies CLA
Modified: 2013-11-10 22:31 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Oberlies CLA 2011-07-04 04:27:47 EDT
The publishers are traditionally very lenient about error conditions. This was in particularly necessary when p2 was introduced, and hence people needed to generate p2 metadata for artifacts they had not produced themselves. If however the publishers are called directly after an artifact has been built, one does not want to tolerate any errors, but rather fail the build immediately. This is currently not possible (without text matching) with most publishers.

The requirements are as follows:
- The callers of the publishers need to be able to choose which error conditions are fatal and which aren't.
- The errors/warnings should be have a severity that may be used as default severity by the callers. Together with the first requirements, the callers would be able to specify "fail for all errors and warning xyz".
- The current behaviour of the publishers shall remain available.

My idea for implementing this is to 
- return all errors & warnings in the MultiStatus returned by the publishers,
- identify errors/warnings with a type and error code,
- provide methods that answer the question whether a MultiStatus used to be fatal in Indigo.
Comment 1 Tobias Oberlies CLA 2011-07-04 04:36:06 EDT
These bugs propose introducing new warnings/errors in the publishers: bug 342198, bug 331683, bug 325611
Once we have agreed on a concept (in this bug), they should be easy to fix.
Comment 2 Pascal Rapicault CLA 2011-07-04 05:36:05 EDT
Given that the IPublisherAction#perform returns an IStatus, your suggested implementation makes sense.

The only thing I'm not sure about is whether we really want to preserve the old behaviour. After all people use to get bad metadata without noticing and we are now making them a favour in telling them earlier.

What could be interesting is adding a verbose mode to the various publisher apps so one could see the non fatal errors like warnings / infos.
Comment 3 Meng Xin Zhu CLA 2012-09-07 03:50:23 EDT
(In reply to comment #0)
> My idea for implementing this is to 
> - return all errors & warnings in the MultiStatus returned by the publishers,
> - identify errors/warnings with a type and error code,
I like them.
> - provide methods that answer the question whether a MultiStatus used to be
> fatal in Indigo.
It might be a bit complicated. Publisher mostly is used as a standalone application. It should return error code to caller if something wrong happened in publishing process. The caller script or application can know whether it's indeed failed or not.
Comment 4 Tobias Oberlies CLA 2013-01-28 04:50:15 EST
(In reply to comment #2)
> The only thing I'm not sure about is whether we really want to preserve the old
> behaviour. After all people use to get bad metadata without noticing and we are
> now making them a favour in telling them earlier.
This makes sense. We really shouldn't be ignoring things which are really errors.

And as long as we don't have a concrete case where the definition of what is an error differs for different users, we don't need to implement the compatibility layer proposed here.