Finding ClearCase deliver target view using cleartool - view

I'm using ClearCase on Windows with snapshot views.
Is there a way to determine using cleartool which view will be used for deliver?
If there's a way that involves digging in the registry it's also ok.

No, you can use any view on the destination stream you want in order to deliver.
Once the deliver is done, the view itself is not recorded.
During a deliver though, a cleartool deliver -status will tell you which view is currently used for said deliver.

Related

MVC Web App Feature Development Development / production strategies?

There is a web app. Let's say I want to add a feature. I can write some code, test it locally, make sure it works - then publish it so it is available to the public. Some features though are very complex and not that easy to be written, tested and shipped the same way.
I want to make it so certain feature I am currently working on is not available to the public even though I publish the app.
Let's say I want to add a custom breadcrumb feature to the app (just for one page to keep it simple). I can write a block of code surrounded by some IsProductionReady variable maintained somewhere in Config file - then once I am done I can set IsProductionReady to True - so now it shows up.
I also want to be able to switch to any other features / changes and publish them without affecting any code, without showing any signs of Breadcrumb feature development. When I am done with the feature I want to be able to just make so it is available to the public.
What are the best practices or strategies to maintain a certain state of a feature? What is the best way to structure it?
If you're using Git, it's better to have a separate branch for each new feature, then after the branch being tested and approved you can merge them into your main develop branch, run another regression test (because different features may interfere each others functionality) and then move it to the Production branch.
Take a look into these urls, I presume you can find your desired scenarios in them :
http://nvie.com/posts/a-successful-git-branching-model/
http://martinfowler.com/bliki/FeatureBranch.html
https://www.atlassian.com/git/tutorials/comparing-workflows/feature-branch-workflow
I would have separate branches on Github between both and keep the structure the same. When your feature is ready, merge to the production branch.

Detecting moved files events

I am trying to develop an application for monitoring operations on a particular folder which includes creating, deleting, modifying, moveing, duplicating and renaming.
After referring to the FileSystemWatcher API, I found that it does not provide a Move event, instead it will generate a separate Delete and Create events for the same file. Of course I can wait for a Create event each time a Delete event is detected and decide whether it is a Move event or not, but it is a little bit strange to me and the appropriate time to wait for is also a problem.
Actually I find that Dropbox is able to detect the Move event correctly even when dropbox process is not running. Nice work for Dropbox team and I wonder how do they make it work on earth.
So my purpose is quite clear : Filtering Move event from other events and making it work offline (which means when the procedure is stopped)
Well, a move operation is basically a "copy & delete" from the FileSystemWatcher's point of view. Without knowing details about the implementation I bet DropBox stores a hash for each file. If a file is removed in one place and created with the same hash in another place, chances are it was moved. You could actually do the same thing.

In TeamCity is it possible to navigate your projects source code?

Does anyone know of a way to view entire source of a build via TeamCity - Jenkins has a nice feature whereby you can get to the workspace really easily. Hope this is possible out-of-the-box or via some other method.
Thanks.
I don't know if there is a way to directly get to the source through the Team City interface, but I do know that as you inspect problems, you can get a stack dump. It wouldn't surprise me if you can.
But, I use a different work flow instead, since the CI's working environment should only be a checkout from your source. Therefore if you have your revision information, you can view the source from your repository:
Use the %build.vcs.number.1% property in your "Build Number Format" field; this will place the revision ID into the build's name. You can then view that source exactly in the repository.
You can configure where the checkouts go, but either way you can navigate to "Team City's" working directory if you have access to that box.
You can get the temporary WC directory through the %system.teamcity.build.checkoutDir% property if you want to see the directory on disk where the checkouts etc. happened at.
see this TeamCity article for more information on changing it.
You can turn on VCS Labeling under the VCS Settings, where a build is auto-labeled in your repository. That naming convention is also configurable.
see this blog for more information.
Hope that helps.

UCM ClearCase error while delivery

I have been seeing this error for the past couple of days. I am not able to make any further deliveries because of this.
This happened when I tried to deliver some dlls and exes(binary files) form my stream to the main stream. The delivery failed because ClearCase cannot merge binary files.
I am not able to "Resume the Delivery" or "Cancel the delivery".
The same error crops up all the time.
I tried to look into the Integration view and found the binary files "hijacked". I undid the hijack. But that too did not solve the issue.
Any help would be appreciated.
You cannot cancel a deliver which is in its complete step.
What you can do is to:
describe the deliver activity in order to list all checked out files
try and check in those files
resume the deliver
You can get the current deliver activity by going (in a shell) at the root directory of your target view and typing:
cleartool lsact -cact
Use the result to list all the versions currently delivered:
cleartool describe -l activity:deliver.xxxx#\yourPVob
Some of those will be in checkout (grep CHECKEDOUT to filter them)
Note that for binary file, you can define a special merge type: see "Clearcase UCM is trying to merge pdf files".
Pending that, you might have to make some "red arrow" between source and destination versions of each not-merged binaries, and copy them manually from source to destination.
See "Merge arrow in clear case".

Script to execute on CVS check-in, without access to the server?

Is it possible to write a script that executes certain instructions, and is triggered by any check-in to a CVS repository?
The script would scan the list of files in the change-set and do a copy operation on certain files in a certain sub-directory.
I would hopefully be able to execute various console applications, including ones written in .NET.
Problem is, I need this done quickly and I don't have access to the CVS server, due to corporate IT red-tape, etc.
Is there a way to set this up on one of the client workstations instead?
Can it be done without interfering with my working folder?
Can you get commit notifications by email as this blog shows? If so, you could be able to use maildrop (or good old procmail, etc) to run arbitrary commands and scripts on your workstation when the commit notification mails arrive.
I found a .NET library that seems up to the task - SharpCVSLib.
http://csharpopensource.com/sharpcvslib.aspx
(Hopefully it will work on a developer workstation and not need to be hosted on the CVS server.)

Resources