Clearcase plugin and the lshistory command

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Clearcase plugin and the lshistory command

Augusto Sellhorn
So I have the clearcase plugin and it's getting the source, but as soon as it gets to this cleartool lshistory command, it bombs.

Done loading "/vobs/s***/**f/" (362 objects, copied 0 KB).


[hudson_snapshot_view] $ cleartool lshistory -r -since 24-Oct.07:36:14 -fmt '\"%Nd\" \"%u\" \"%e\" \"%En\" \"%Vn\"\n%c\n' -nco .view.stg .view.dat update.24-Oct-07.07 :38:10.updt vobs

cleartool: Error: Not an object in a vob: ".view.stg".

cleartool: Error: Not an object in a vob: ".view.dat".

cleartool: Error: Not an object in a vob: "update.24-Oct-07.07 :38:10.updt".

cleartool: Error: Not an object in a vob: "vobs".

FATAL: Clear Case failed. exit code=1

FATAL: Clear tool did not return the expected exit code. Command line="cleartool lshistory -r -since 24-Oct.07:36:14 -fmt \"%Nd\" \"%u\" \"%e\" \"%En\" \"%Vn\"\n%c\n -nco .view.stg .view.dat update.24-Oct-07.07:38:10.updt vobs", actual exit code=1

java.io.IOException : Clear tool did not return the expected exit code. Command line="cleartool lshistory -r -since 24-Oct.07:36:14 -fmt \"%Nd\" \"%u\" \"%e\" \"%En\" \"%Vn\"\n%c\n -nco .view.stg .view.dat update.24-Oct-07.07:38:10.updt vobs", actual exit code=1

at hudson.plugins.clearcase.ClearCaseSCM.run(ClearCaseSCM.java:272)

at hudson.plugins.clearcase.ClearCaseSCM.getHistoryEntries(ClearCaseSCM.java :247)

at hudson.plugins.clearcase.ClearCaseSCM.checkout(ClearCaseSCM.java:117)

at hudson.model.AbstractProject.checkout(AbstractProject.java:529)

at hudson.model.AbstractBuild$AbstractRunner.checkout (AbstractBuild.java:213)

at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:179)

at hudson.model.Run.run(Run.java:579)

at hudson.model.Build.run(Build.java:103)

at hudson.model.ResourceController.execute (ResourceController.java:66)

at hudson.model.Executor.run(Executor.java:62)
=========================

It seems this line is killing it
-nco .view.stg .view.dat update.24-Oct-07.07:38:10.updt
 vobs
At the top of the workspace these files are there, and the script using them with the "-nco" flag. If I manually cd to an actual directory that is properly source controlled and doesn't have the .view . files, the command seems to work.

I have a simple config spec, and a simple load rule for all of this. What am I missing?

thx

--
Augusto
http://sellmic.com
Reply | Threaded
Open this post in threaded view
|

Re: Clearcase plugin and the lshistory command

Jean-Marc Taillant
Did you try to create a dynamic view with your config spec to be sure
that there is no problem. I got a similar exception because I forgot to add:

"load \vobname"

At the end of my config spec.

Regards,

Jean-Marc

Augusto Sellhorn a écrit :

> So I have the clearcase plugin and it's getting the source, but as
> soon as it gets to this cleartool lshistory command, it bombs.
>
> Done loading "/vobs/s***/**f/" (362 objects, copied 0 KB).
>
>
> [hudson_snapshot_view] $ cleartool lshistory -r -since 24-Oct.07:36:14 -fmt '\"%Nd\" \"%u\" \"%e\" \"%En\" \"%Vn\"\n%c\n' -nco .view.stg .view.dat update.24-Oct-07.07
> :38:10.updt vobs
>
> cleartool: Error: Not an object in a vob: ".view.stg".
>
> cleartool: Error: Not an object in a vob: ".view.dat".
>
> cleartool: Error: Not an object in a vob: "update.24-Oct-07.07
> :38:10.updt".
>
> cleartool: Error: Not an object in a vob: "vobs".
>
> FATAL: Clear Case failed. exit code=1
>
> FATAL: Clear tool did not return the expected exit code. Command line="cleartool lshistory -r -since
> 24-Oct.07:36:14 -fmt \"%Nd\" \"%u\" \"%e\" \"%En\" \"%Vn\"\n%c\n -nco .view.stg .view.dat update.24-Oct-07.07:38:10.updt vobs", actual exit code=1
>
> java.io.IOException
> : Clear tool did not return the expected exit code. Command line="cleartool lshistory -r -since 24-Oct.07:36:14 -fmt \"%Nd\" \"%u\" \"%e\" \"%En\" \"%Vn\"\n%c\n -nco .view.stg .view.dat
> update.24-Oct-07.07:38:10.updt vobs", actual exit code=1
>
> at hudson.plugins.clearcase.ClearCaseSCM.run(ClearCaseSCM.java:272)
>
> at hudson.plugins.clearcase.ClearCaseSCM.getHistoryEntries(ClearCaseSCM.java
> :247)
>
> at hudson.plugins.clearcase.ClearCaseSCM.checkout(ClearCaseSCM.java:117)
>
> at hudson.model.AbstractProject.checkout(AbstractProject.java:529)
>
> at hudson.model.AbstractBuild$AbstractRunner.checkout
> (AbstractBuild.java:213)
>
> at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:179)
>
> at hudson.model.Run.run(Run.java:579)
>
> at hudson.model.Build.run(Build.java:103)
>
> at hudson.model.ResourceController.execute
> (ResourceController.java:66)
>
> at hudson.model.Executor.run(Executor.java:62)
> =========================
>
> It seems this line is killing it
> -nco .view.stg .view.dat update.24-Oct-07.07:38:10.updt
>  vobs
>  
> At the top of the workspace these files are there, and the script
> using them with the "-nco" flag. If I manually cd to an actual
> directory that is properly source controlled and doesn't have the
> .view . files, the command seems to work.
>
> I have a simple config spec, and a simple load rule for all of this.
> What am I missing?
>
> thx
>
> --
> Augusto
> http://sellmic.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Clearcase plugin and the lshistory command

Erik Ramfelt
In reply to this post by Augusto Sellhorn
On 10/24/07, Augusto Sellhorn <[hidden email]> wrote:

> It seems this line is killing it
> -nco .view.stg .view.dat update.24-Oct-07.07:38:10.updt
>  vobs
>
>  At the top of the workspace these files are there, and the script using
> them with the "-nco" flag. If I manually cd to an actual directory that is
> properly source controlled and doesn't have the .view . files, the command
> seems to work.
>
> I have a simple config spec, and a simple load rule for all of this. What am
> I missing?

Could you run the below command from the console in the view folder
(workspace\hudson_snapshot_view), and tell me if you get any history
(perhaps you need to change the data in the -since param)?:
cleartool lshistory -r -since 24-Oct.07:36:14 -fmt '\"%Nd\" \"%u\"
\"%e\" \"%En\" \"%Vn\"\n%c\n' -nco vobs

Im currently working on a new version of the plugin that will be much
easier to test, and it will try to find the vobs that are loaded in
the current view and use those in the lshistory command.

regards
//Erik

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Clearcase plugin and the lshistory command

Augusto Sellhorn
The command works just like you had it there, as long as i don't pass it "vobs".
If I pass it "vobs" (or .view.stg .view.dat update.24-Oct-07.07:38:10.updt) I get a;

cleartool: Error: Not an object in a vob: "vobs".t

Same with say update.24-Oct*updt, that's not a versioned object. It's looking at the workspace and doing "-nco" to all the files in that workspace.

What works is if I pass it -nco to the path of the versioned object I'm interested in .../vobs/someprojectname. That works.

My load rules are "load /vobs/someprojecctname". Does anybody know if I can create a load rule that uses that pathname but doesn't use the full path. Ex: "lload /vobs/someprojectname" but loads /someprojectname at the top of the workspace dir?

Also, who do I make it so the plugin doesn't try to pass -nco all files at the top of the workspace?

thanks

On 10/24/07, Erik Ramfelt <[hidden email]> wrote:
On 10/24/07, Augusto Sellhorn < [hidden email]> wrote:

> It seems this line is killing it
> -nco .view.stg .view.dat update.24-Oct-07.07:38:10.updt
>  vobs
>
>  At the top of the workspace these files are there, and the script using
> them with the "-nco" flag. If I manually cd to an actual directory that is
> properly source controlled and doesn't have the .view . files, the command
> seems to work.
>
> I have a simple config spec, and a simple load rule for all of this. What am
> I missing?

Could you run the below command from the console in the view folder
(workspace\hudson_snapshot_view), and tell me if you get any history
(perhaps you need to change the data in the -since param)?:
cleartool lshistory -r -since 24-Oct.07:36:14 -fmt '\"%Nd\" \"%u\"
\"%e\" \"%En\" \"%Vn\"\n%c\n' -nco vobs

Im currently working on a new version of the plugin that will be much
easier to test, and it will try to find the vobs that are loaded in
the current view and use those in the lshistory command.

regards
//Erik

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]




--
Augusto
http://sellmic.com
Reply | Threaded
Open this post in threaded view
|

Re: Clearcase plugin and the lshistory command

Augusto Sellhorn
Yeah I can't get past the issue that there are files at the top of my workspace that are not source controlled. If I could only tell it to get history on some subfolders this should work.

BTW is the source code for this plugin available anywhere?

--
Augusto
http://sellmic.com
Reply | Threaded
Open this post in threaded view
|

Re: Clearcase plugin and the lshistory command

Erik Ramfelt
In reply to this post by Augusto Sellhorn
On 10/24/07, Augusto Sellhorn <[hidden email]> wrote:
> The command works just like you had it there, as long as i don't pass it
> "vobs".

Is the "vobs" folder a VOB? Or does it contain VOBs?

> What works is if I pass it -nco to the path of the versioned object I'm
> interested in .../vobs/someprojectname. That works.

Does the "/vobs" folder have a file named "view.dat"? Or is there such
a file in the "/vobs/someprojectname"?


> My load rules are "load /vobs/someprojecctname". Does anybody know if I can
> create a load rule that uses that pathname but doesn't use the full path.
> Ex: "lload /vobs/someprojectname" but loads /someprojectname at the top of
> the workspace dir?

Sorry, I dont have any idea. im no expert on clear case but our config
specs contain "load \acode\" and that will create a "acode" folder in
the view folder.

Is the hudson running in windows or in linux/unix?


> Also, who do I make it so the plugin doesn't try to pass -nco all files at
> the top of the workspace?

The "lshistory" command needs a path name to retrieve the history for,
and the released plugin will take all FilePaths in the view folder and
append it to the command line. The command will not fail if one of the
path names is an object in a vob or a vob. I can give you an updated
version that will just append the names of folders in the view, but
that will not solve your problem.

The source code to the plugin is available in the Hudson CVS. To get
the source, have a look at
http://hudson.gotdns.com/wiki/display/HUDSON/Building+Hudson

You can browse the code at
http://fisheye5.cenqua.com/browse/hudson/hudson/plugins/clearcase/src/main/java/hudson/plugins/clearcase

Regards
//Erik

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Clearcase plugin and the lshistory command

Augusto Sellhorn
Vobs is a mount where the actual versioned "vob" objects are contained. Sorry, no clearcase expert here either, but it's like this;
/vob/project1
/vob/project2
/vob/project3

We have a lot, so this setup supposedly scales well.

This is running on Solaris, btw.

So the problem I'm having is in this piece of code:
217     private List<Object[]> getHistoryEntries(Date lastBuildDate, Launcher launcher, FilePath workspace,
218     TaskListener listener, String viewName) throws IOException, InterruptedException {
219    
220     SimpleDateFormat formatter = new SimpleDateFormat("d-MMM.HH:mm:ss");
221     FilePath viewPath = workspace.child(viewName);
222     String[] vobNames = null;
223     List<FilePath> subFilePaths = viewPath.list((FileFilter) null);
224     if ((subFilePaths != null) && (subFilePaths.size() > 0)) {
225     vobNames = new String[subFilePaths.size()];
226     for (int i = 0; i < subFilePaths.size(); i++) {
227     vobNames[i] = subFilePaths.get(i).getName();
228     }
229     }

I guess a "vob" path would solve my problem, if I could tell it what the relative vob(s) path is so instead of listing files in the workspace (viewPath), it would list them relative to that.

ex: vobs "project1"

/hudson/workspace/view <=== view top dir
/hudson/workspace/view/project1 <=== loaded by config spec load rules

Maybe I should try creating a custom version of the plugin to try it, but does this make sense? Add a "vob" path variable to the project? It seems this might solve the issue, of course, I don't know if I'm the only one with this issue but oh well :-)

On 10/24/07, Erik Ramfelt <[hidden email]> wrote:

The "lshistory" command needs a path name to retrieve the history for,
and the released plugin will take all FilePaths in the view folder and
append it to the command line. The command will not fail if one of the
path names is an object in a vob or a vob. I can give you an updated
version that will just append the names of folders in the view, but
that will not solve your problem.

Don't know if it's my version of clearcase, but yeah if the -nco is passed files that are not versioned objects it will fail.

--
Augusto
http://sellmic.com
Reply | Threaded
Open this post in threaded view
|

Re: Clearcase plugin and the lshistory command

Augusto Sellhorn
I added a "vobPath" property for now ... but I must not be getting how settings in plugins get persisted in Hudson.

I added this to config.jelly for the clearcase plugin (addition highlighted)...

    <f:entry title="Branch" help="/plugin/clearcase/branch.html">
      <f:textbox name="clearcase.branch" value="${scm.branch}"/>
    </f:entry>

        <f:entry title="VOB path" help="/plugin/clearcase/vobpath.html">
      <f:textbox name="clearcase.vobpath" value="${scm.vobpath}"/>
    </f:entry>

I see the field, however when I save the config settings this setting is never saved, looking at the config.xml file, there's no entry for it. Argh, help, what am I missing? The property is in the clearcase object and has a getter method, I'm missing something fundamental here on how these things are saved.


Reply | Threaded
Open this post in threaded view
|

Re: Clearcase plugin and the lshistory command

Augusto Sellhorn
ok, figured it out. Was a silly thing with mix cases not matching.

My modification to the plugin seems to work, btw. It's weird to have to include the vob path again like that, but I see no other way around it in my case. If that setting is not used, the current mechanism is used intead (scans for files in the view)

On 10/24/07, Augusto Sellhorn <[hidden email]> wrote:
I added a "vobPath" property for now ... but I must not be getting how settings in plugins get persisted in Hudson.

I added this to config.jelly for the clearcase plugin (addition highlighted)...

    <f:entry title="Branch" help="/plugin/clearcase/branch.html">
      <f:textbox name="clearcase.branch" value="${scm.branch}"/>
    </f:entry>

        <f:entry title="VOB path" help="/plugin/clearcase/vobpath.html">
      <f:textbox name="clearcase.vobpath" value="${scm.vobpath}"/>
    </f:entry>

I see the field, however when I save the config settings this setting is never saved, looking at the config.xml file, there's no entry for it. Argh, help, what am I missing? The property is in the clearcase object and has a getter method, I'm missing something fundamental here on how these things are saved.





--
Augusto
http://sellmic.com
Reply | Threaded
Open this post in threaded view
|

Re: Clearcase plugin and the lshistory command

Erik Ramfelt
On 10/25/07, Augusto Sellhorn <[hidden email]> wrote:
> ok, figured it out. Was a silly thing with mix cases not matching.
>
> My modification to the plugin seems to work, btw. It's weird to have to
> include the vob path again like that, but I see no other way around it in my
> case. If that setting is not used, the current mechanism is used intead
> (scans for files in the view)

Good to hear that you solved it. If you commit the change or send me a
patch then I can integrate it into the new version that Im working on.
I think I will add this configuration as "hidden" behind an Advanced
button so if anyone has problems with the default behaviour then they
can use this. How does that sound?

//Erik

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]