Issue with the Whisker CLI

2012-08-16 Thread Chip Childers
Hi all,

I've found an issue with the Whisker CLI command line parsing logic,
which the diff below resolves.  Basically, as it stands in trunk
today, the CLI is only able to run the help function, since the parse
method isn't being provided the full list of possible options.

We're trying to setup Whisker for the CloudStack project, and I was
hoping to use the CLI for development of the required metadata files.

Is there a specific method you would like me to follow to get this fix
(or something more appropriate) into the codebase?

-chip


Index: apache-whisker-cli/src/main/java/org/apache/creadur/whisker/cli/Main.java
===
--- apache-whisker-cli/src/main/java/org/apache/creadur/whisker/cli/Main.java   
(revision
1373827)
+++ apache-whisker-cli/src/main/java/org/apache/creadur/whisker/cli/Main.java   
(working
copy)
@@ -188,9 +188,13 @@
  */
 private boolean printHelp(String[] args) throws ParseException {
 final CommandLineOption help = CommandLineOption.PRINT_HELP;
-return help.isSetOn(
-parser().parse(new Options().addOption(
-help.create()), args));
+try {
+   return help.isSetOn(
+   parser().parse(new Options().addOption(
+   help.create()), args));
+} catch (ParseException e) {
+   return false;
+}
 }

 /**


Re: buildbot success in ASF Buildbot on whisker-trunk

2012-08-16 Thread Robert Burrell Donkin

On 08/15/12 04:00, Gavin McDonald wrote:

I re-ran the test with 'mvn3 clean install' and it now passes.

This fixes https://issues.apache.org/jira/browse/INFRA-4819


Thanks :-)

Robert


Re: Issue with the Whisker CLI

2012-08-16 Thread Chip Childers
On Thu, Aug 16, 2012 at 10:30 AM, Chip Childers
 wrote:
> Hi all,
>
> I've found an issue with the Whisker CLI command line parsing logic,
> which the diff below resolves.  Basically, as it stands in trunk
> today, the CLI is only able to run the help function, since the parse
> method isn't being provided the full list of possible options.
>
> We're trying to setup Whisker for the CloudStack project, and I was
> hoping to use the CLI for development of the required metadata files.
>
> Is there a specific method you would like me to follow to get this fix
> (or something more appropriate) into the codebase?
>
> -chip
>
>
> Index: 
> apache-whisker-cli/src/main/java/org/apache/creadur/whisker/cli/Main.java
> ===
> --- apache-whisker-cli/src/main/java/org/apache/creadur/whisker/cli/Main.java 
>   (revision
> 1373827)
> +++ apache-whisker-cli/src/main/java/org/apache/creadur/whisker/cli/Main.java 
>   (working
> copy)
> @@ -188,9 +188,13 @@
>   */
>  private boolean printHelp(String[] args) throws ParseException {
>  final CommandLineOption help = CommandLineOption.PRINT_HELP;
> -return help.isSetOn(
> -parser().parse(new Options().addOption(
> -help.create()), args));
> +try {
> +   return help.isSetOn(
> +   parser().parse(new Options().addOption(
> +   help.create()), args));
> +} catch (ParseException e) {
> +   return false;
> +}
>  }
>
>  /**



Using a locally patched version (see above patch), I'm making good
progress with using Whisker.  Thanks for that goes to this community!

I do have two other Whisker CLI questions:

1 - How do I get a NOTICE output using the CLI?  Or do I have to use
Whisker as a Maven plugin.

2 - In the following example, the copyright notice is not being added
to the LICENSE file output:

Assume the ApacheLicenseVersion2 exists above this snippet.  Also
assume the org for Clinton Begin exists.

[snip...]

Copyright (c) 2012 The Apache Software
Foundation








Copyright (c) 2004 Clinton Begin






[snip...]

The relevant output is here:

Within the utils/src/com/cloud/utils/db directory
licensed under the Apache License, Version 2
http://www.apache.org/licenses/LICENSE-2.0.txt  (as above)

As you can see, there's no copyright attribution for that resource.

Thanks in advance for any advice you can offer!


Re: Creadur project RAT failures

2012-08-16 Thread Robert Burrell Donkin

On 08/15/12 04:36, Gavin McDonald wrote:

Just wanted to refresh this so we got our own house in order.


:-)


http://ci.apache.org/projects/rat/rat-output.html shows 10 files without a
license.

We had at last check SIX (6) that were done on purpose for testing.

(http://ci.apache.org/projects/rat-master-summary.html shows this)

Of the 10 files noted I see:

Source.java is without license on purpose.
Empty.txt is without license on purpose.
FilterTest.cs has no license - can we add one safely here ?


My reading of [1] is that the test involves appending a license after 
the binary bit at the start of the file



bad.txt is without license on purpose.
invoker.properties has no license - can we safely add one here?


I think so


Src.apt has a different license on purpose, we should leave this.
Verify.bsh has no license and we should add one.
Src.txt is without license on purpose.
Src.apt is without license on purpose.
Index.apt is without license on purpose.

Summary:

We now have SEVEN (7) that are without license header on purpose.
Two that possibly need license headers adding (FilterTest.cs


I think FilterTest is intentionally missing a header for test purposes


and invoker.properties)


+1


One that (imho) we should definitely add a license header to (verify.bsh)


+1


Opinions (I'm happy to fix all)


:-)

+1 for verify.bsh and invoker.properties

BTW would it make sense to allow Rat to pick up a configuration file 
allowing a project to list known files intentionally missing a license 
header...?


Robert

[1] 
http://svn.apache.org/repos/asf//creadur/rat/trunk/apache-rat-core/src/test/java/org/apache/rat/annotation/TestLicenceAppender.java


Re: Issue with the Whisker CLI

2012-08-16 Thread Chip Childers
On Thu, Aug 16, 2012 at 4:01 PM, Chip Childers
 wrote:
> 2 - In the following example, the copyright notice is not being added
> to the LICENSE file output:
>
> Assume the ApacheLicenseVersion2 exists above this snippet.  Also
> assume the org for Clinton Begin exists.
>
> [snip...]
> 
> Copyright (c) 2012 The Apache Software
> Foundation
> 
> 
>  id='apache.org'
> name='The Apache Software Foundation'
> url='http://www.apache.org/'/>
>  id='person:Clinton.Begin'
> name='Clinton Begin'
> url='http://code.google.com/p/mybatis/' />
> 
> 
> 
> 
> Copyright (c) 2004 Clinton Begin
> 
> 
> 
> 
> 
> 
> [snip...]
>
> The relevant output is here:
>
> Within the utils/src/com/cloud/utils/db directory
> licensed under the Apache License, Version 2
> http://www.apache.org/licenses/LICENSE-2.0.txt  (as above)
>
> As you can see, there's no copyright attribution for that resource.
>
> Thanks in advance for any advice you can offer!

This issue is entirely my fault.  I was using the US spelling of organisation.

-chip