Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make cleartool executable configurable #65

Closed
fr43nk opened this issue May 8, 2019 · 28 comments
Closed

Make cleartool executable configurable #65

fr43nk opened this issue May 8, 2019 · 28 comments

Comments

@fr43nk
Copy link
Collaborator

fr43nk commented May 8, 2019

To let the user decide which cleartool executable they want to use, there should be a configuration date for that.
This also could handle webviews (#55 and #57) on a workspace configuration layer.

@bw1faeh0
Copy link

bw1faeh0 commented May 9, 2019

Keep in mind, that rcleartool asks for server url, username and password on first use in a session. You should login first:

rcleartool login [ –lna/me login-name ] [ –ser/ver server-url:port ] [ –pas/sword password ]
[ –proxy_lname proxy-login-name ] [ –proxy_password password ]

>rcleartool login -lname [username] -server https://[url]
Password: **********
>

See https://www.ibm.com/support/knowledgecenter/en/SSSH27_8.0.1/com.ibm.rational.clearcase.cc_ref.doc/topics/rct_login.htm

Password shall not be saved in the configuration file but shall be asked on starting the session.

@fr43nk
Copy link
Collaborator Author

fr43nk commented May 9, 2019

I never used rcleartool, so I wasn't aware of this. The doc says, every call to rcleartool requires such information.
I will add some more configuration data to provide username and url. The password will be saved as long as the active window exists. Would this be feasible for you?

@OpenNingia
Copy link
Owner

If that's the case then configuring the path of the executable isn't enough. We are going to need a useRemoteClient: boolean settings to support different behavior like asking for the login password.

Furthermore @fr43nk is correct, we're working in non-interactive mode; as such we need to provide the password on each command.
The password will stay in memory for as long as needed.
We should be extremely careful not to log the password along the executing command thou.

@bw1faeh0
Copy link

bw1faeh0 commented May 9, 2019

Furthermore @fr43nk is correct, we're working in non-interactive mode; as such we need to provide the password on each command.

When I'm using the windows command prompt I use the non-interactive mode too. rcleartool asks for username and password only the first time, afterwards they are not needed, because the session is still active:

D:\ClearCase\>rcleartool lsview -server https://[URL]
Connection to server  "https://[URL]".
Username: [USERNAME]
Password: [PASSWORD]

You are successfully registered as "[USERNAME]" on server "https://[URL]".
  
  [Output of lsview]

Next non-interactive command:

D:\ClearCase\>rcleartool lsview -short -server https://[URL]

  [Output of lsview]

D:\ClearCase\>

As you see, the session seems to be saved in some kind of environmental variable.

You can split the first step into two steps:

D:\ClearCase\>rcleartool login -lname [USERNAME] -server https://[URL]
Password: [PASSWORD]
You are successfully logged in as "USER" on server "https://[URL]".
D:\ClearCase\>
D:\ClearCase\>rcleartool lsview -short -server https://[URL]
[Output of lsview]

(I translated the output from German to English, so maybe the keywords are not exactly the same)

@bw1faeh0
Copy link

bw1faeh0 commented May 9, 2019

I will add some more configuration data to provide username and url. The password will be saved as long as the active window exists. Would this be feasible for you?

Perhaps you could add an option to save the password for the lazy ones ;)

I always find it hard to store passwords in configuration files. Apart from the fact that they are changed every 90 days. I would have no problem typing the password once per session.

@fr43nk
Copy link
Collaborator Author

fr43nk commented May 9, 2019

Please have a look at the new version
https://github.com/fr43nk/vscode-clearcase/releases/tag/2.4.2-rc.4

It will always use the login credentials on every command.
Please report how it works.

@bw1faeh0
Copy link

Sorry, this version does not work too. There is still the popup of cleartool (not detecting a vob). Output of Clearcase SCM is: lsview

My config looks like this:
vscode-clearcase.cleartoolExecutable: D:\Programs\IBM\RationalSDLC\ClearCase\RemoteClient\rcleartool.bat

vscode-clearcase.webviewAddress: https://[URL]

vscode-clearcase.webviewUsername: [my Username]

BTW:
It is not a Webview Address and a Webview Username. It is the Webserver Address and Webserver Username.

@fr43nk
Copy link
Collaborator Author

fr43nk commented May 10, 2019

Please test the new version:
https://github.com/fr43nk/vscode-clearcase/releases/tag/2.4.2-rc.5
Changed configuration of username and address. Please have a look in your configuration.

@bw1faeh0
Copy link

login      
cleartool: Error: Unrecognized command: "login"

Error while login cleartool: Error: Unrecognized command: "login"
Cleartool error: Cleartool command login exited with error code: 1
lsco    
catcs
cleartool: Error: Cannot get view info for current view: not a ClearCase object.

cleartool: Error: Cannot get view info for current view: not a ClearCase object.

Cleartool error: Cleartool command lsco exited with error code: 1
cleartool: Error: Cannot get view info for current view: not a ClearCase object.

Cleartool error: Cleartool command catcs exited with error code: 1
lsco    
catcs
cleartool: Error: Cannot get view info for current view: not a ClearCase object.

cleartool: Error: Cannot get view info for current view: not a ClearCase object.

cleartool: Error: Cannot get view info for current view: not a ClearCase object.

Cleartool error: Cleartool command lsco exited with error code: 1
Cleartool error: Cleartool command catcs exited with error code: 1
lsco    
catcs
cleartool: Error: Cannot get view info for current view: not a ClearCase object.

cleartool: Error: Cannot get view info for current view: not a ClearCase object.

cleartool: Error: Cannot get view info for current view: not a ClearCase object.

Cleartool error: Cleartool command lsco exited with error code: 1
Cleartool error: Cleartool command catcs exited with error code: 1

Could you log the path of the (r)cleartool, you are using?

image
image
image

@fr43nk
Copy link
Collaborator Author

fr43nk commented May 10, 2019

F*** I missed something. It always calls the cleartool command not your configured one. Sorry for that. I will correct that. Stay tuned.

@fr43nk
Copy link
Collaborator Author

fr43nk commented May 10, 2019

Please download and install again the current rc-5
https://github.com/fr43nk/vscode-clearcase/releases/tag/2.4.2-rc.5

@bw1faeh0
Copy link

After Loading of VSC, I was asked for my PW. After that:
image

(perhaps the timeout is to short?!?)

I tried to save a checked-in file, this was the result:
image

@fr43nk
Copy link
Collaborator Author

fr43nk commented May 10, 2019

The checkout: Do you use the clearcase dialog? This is configurable.
The first message: I will have a look at it.

@bw1faeh0
Copy link

bw1faeh0 commented May 10, 2019

The checkout: Do you use the clearcase dialog? This is configurable.

vscode-clearcase.useClearDlg = true;

When I use dynamic views I don't checkout via clearcase explorer. That is why I don't checkout the files before when using a webview, too.
After canceling the dialog message above following additional output was generated:

catcs
lsco    
CRCLI2001E Nicht erkannte Option "-avobs".
Syntax: lsc/heckout | lsco [-l/ong | -s/hort ] [-brt/ype Verzweigungstypselektor] [-cvi/ew] [-me | -use/r Anmeldename] [-r/ecurse | -d/irectory] [Pfadname...]

Cleartool error: Cleartool command lsco exited with error code: 1

@fr43nk
Copy link
Collaborator Author

fr43nk commented May 10, 2019

I am not quit sure, whether the dialog option does work the correct way in your scenario.
Try setting useClearDlg = false to use the rcleartool command you configured. May this works.
As you mentioned unknown option "-avobs" are there no vobs in a webview? There is also a configuration date for that. Look for the "Find checkouts Command Args" option and remove the -avobs parameter

@bw1faeh0
Copy link

Checking out seems to work somehow:

login      
catcs
catcs
CRCLI2014E Sie sind bereits bei Server "https://[URL]" angemeldet.

Cleartool error: Cleartool command login exited with error code: 1
lsco   
catcs
co   
co   
catcs
catcs
CRCLI2059E Element "d:\ClearCase\[...]\version.h" wurde bereits in Ansicht "[View Name]" ausgecheckt.

Cleartool error: Cleartool command co exited with error code: 1
catcs
catcs

(I restarted VSC before this test)

@fr43nk
Copy link
Collaborator Author

fr43nk commented May 10, 2019

Sounds promising somehow 😄
What makes me wonder: there are two co entries. I suppose you only started checkout once, did you?
Does the list of checkedout files work in the SCM view?

@bw1faeh0
Copy link

bw1faeh0 commented May 13, 2019

Does the list of checkedout files work in the SCM view?

STRG J + STRG F brings up a ClearCase Dialog Window to find checkouts:
image

But it does not help, because it is not a dynamic view:
image

STRG J + STRG + I

Check In works, but very slow with no feedback:

co   
catcs
lsco   
CRCLI2059E Element "d:\ClearCase\[]\version.h" wurde bereits in Ansicht "bw1faeh0_GPMG_Develop_CF" ausgecheckt.

Cleartool error: Cleartool command co exited with error code: 1
catcs
lsco   
catcs
lsco   
clearcase, stdout: D:\ClearCase\[]\version.h@@\main\[]\CHECKEDOUT von \main\[]\8  Regel: CHECKEDOUT

ci   
lsco   
catcs

@fr43nk
Copy link
Collaborator Author

fr43nk commented May 13, 2019

STRG J + STRG F brings up a ClearCase Dialog Window to find checkouts:

I meant this as SCM view:
grafik

There are all checked out files listed in this section and if you like view private files, too.
Are files listed there?

@bw1faeh0
Copy link

Sorry, Clearcase is not recognized as SCM:
image

@fr43nk
Copy link
Collaborator Author

fr43nk commented May 13, 2019

Please have a look again at the latest pre release version
https://github.com/fr43nk/vscode-clearcase/releases/tag/2.4.2-rc.5
Maybe uninstall the existing extension first.

Now there should be no error message saying "already logged in". And with that the SCM view should recognize a scm provider. (I hope 🤞)

Did you change the configuration vscode-clearcase.useClearDlg = true; to vscode-clearcase.useClearDlg = false;?
If so, you have the ability to checkout on save without any interruption. The successful checkout should be visible in the statusbar of the current window. Saying something like [/main/version1/CHECKEDOUT]

@bw1faeh0
Copy link

bw1faeh0 commented May 13, 2019

I removed the extension and installed rc.5 again. vscode-clearcase.useClearDlg is false.

Checking SCM:
image

image

(now i modified the file and hit strg +s. I didn't set a checkout comment)

image

image

Checkout seems to work. Now trying to check in:

image

image

File is still checked out...

@fr43nk
Copy link
Collaborator Author

fr43nk commented May 13, 2019

It seams there where still problems handling the login.
If you are still willing to test, then please use the new version.
Note: You can have a look in your user home directory, there should be a folder

.vscode\extensions

Maybe there are a lot of different versions of this extension still existing. They can be deleted
https://github.com/fr43nk/vscode-clearcase/releases/tag/2.4.2-rc.6

@bw1faeh0
Copy link

I removed the dir of the extension within .vscode\extensions. After re-installation I was asked for my pwd. the plugin managed to login:
image

After that I restarted VS Code (just do get a clean starting point). I was asked for the pwd again. I edited my test file, hit strg + s, it took some time, but at the end it looks like this:
image
As you see, I was still logged in even after closing VS Code. But anyway, checkout works:
image
Now I hit STRG J + STRG + I to checkin. It took some time (rcleartool is very slow):

catcs
lsco   
clearcase, stdout: D:\ClearCase\bw1faeh0_GPMG_Develop_CF\EFZM_Dev\GMPG\inc\version.h@@\main\GmPg_Int\GPMG_Develop_CF\CHECKEDOUT von \main\GmPg_Int\GPMG_Develop_CF\10  Regel: CHECKEDOUT

ci
lsco   
catcs

image

So it looks like the the basics are working.

But I see open points:

  • rcleartool checkin and checkout takes very long time (30..40 sec). Is it possible to create some kind of popup to notify the user to wait?
  • the setup of the plugin should be project depended. In my case I have projects using basic clearcase with the cleartool command and projects using webviews and rcleartool. Switching the extension config is inconvenient

Perhaps you can drop me a line for further debugging and testing (if you like): webmaster@mail.flaemig42.de

@fr43nk
Copy link
Collaborator Author

fr43nk commented May 14, 2019

Looks great. Here are my questions:

  • does rcleartool also take such a long time if used outside vscode?
  • is the SCM view working? Are there any checkedout files listed?

Project depended configuration already exists in vscode. Just Store your current workspace Save workspace as.... After that you can easily set configurations via the settings ui.

@stale
Copy link

stale bot commented Jul 15, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jul 15, 2022
@fr43nk
Copy link
Collaborator Author

fr43nk commented Jul 20, 2022

@bw1faeh0 are you still interested in using the plugin with remote clearcase client? I know it was a long time since the last change, but chances are good that remote clearcase support gets into the extension.

@stale stale bot removed the wontfix label Jul 20, 2022
@bw1faeh0
Copy link

@fr43nk
We moved on, leaving clear case behind and switched to git(lab).
So I don't really have a use case for this extension anymore...

@fr43nk fr43nk closed this as completed Jul 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants