Search code examples
jenkinsclearcase

This operation requires a view tag


Context

Within the context of Continuous Integration with Jenkins, I changed the location of my jobs from D:\workspace to D:\. The problem is that I missed to accordingly move the ClearCase views from D:\workspace\JOB_NAME\view to D:\JOB_NAME\view.

Since the view tags of my jobs are represented by Jenkins_${NODE_NAME}_${JOB_NAME}${DASH_WORKSPACE_NUMBER}, Jenkins reacted by creating a duplicate for each of my views:

  • D:\ClearCaseStorage\Views\COMPANY\user\Jenkins_Node1_JobName.vws
  • (no tag)
  • D:\ClearCaseStorage\Views\COMPANY\user\Jenkins_Node1_JobName.1.vws
  • (Jenkins_Node1_JobName).

Everything still works, but I now have many untagged views that pollute the server. Indeed, each view "stole" the view tag from its previous view. I want to remove these ghost views.

Problem

I can't remove an untagged view from the administration console. It says:

This operation requires a view tag.

This operation requires a view tag

I wish I could display the view information in order to get its uuid and then delete it but untagged views don't appear in the view list: cleartool lsview -long.

Questions

  • Is there a way I can delete these views myself without alerting the ClearCase server administrator? If no, how can the administrator delete these views?
  • In order to avoid this behavior to happen again, should I remove ${DASH_WORKSPACE_NUMBER} from the view tag of my jobs?

${DASH_WORKSPACE_NUMBER} is replaced by the number of the workspace if it isn't the primary workspace on the node. This allows to execute several concurrent builds of the same job on the same node.


Solution

  • If you have still access to the previous snapshot views root directory (like D:\workspace\JOB_NAME\view), the view.dat file will give you the view uid.

    That is enough for you to unregister the view, and remove its former tag.

    See "How to delete ClearCase views created by other users?" (or "Delete ClearCase Views Script).

    cleartool rmtag -view theViewToRemove
    cleartool unregister -view -uuid uuid_of_viewToRemove