Tommie 的个人资料: : Tommie照片日志列表更多 工具 帮助

日志


Another try to install the XML schema

Since I haven't managed to get the installation of the XML schema to work, I've come up with 2 different ways to hopefully solve the problem, until I get some answers from MSDN:

  • Try to manually create the Code Metrics table, insert the xml manually into warehouseschema.xml and the build the olap cube and database tables.
  • Try to use the MakeSchemaChanges() method in the adapter to add my Fact table.

The first try was a failure. I added a "Code Metrics" table in the TfsWarehouse DB:

USE [TfsWarehouse] GO /****** Object: Table [dbo].[Code Metrics] Script Date: 12/05/2007 11:32:35 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[Code Metrics]( [__ID] [int] IDENTITY(1,1) NOT NULL, [Maintainability Index] [int] NOT NULL, [Cyclomatic Complexity] [int] NOT NULL, [Depth of Inheritance] [int] NOT NULL, [Class Coupling] [int] NOT NULL, [Lines of Code] [int] NOT NULL, [Build] [int] COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, CONSTRAINT [PK_Code Metrics] PRIMARY KEY CLUSTERED ( [__ID] ASC )WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY]

Note that Build is of datatype int. This is because it seems like all references to a build in other tables are using the __ID column of build (not Build Artifact Moniker as I've incorrectly suggested in this post. I think that perhaps Build Artifact Moniker is used in a layer the application developer is not meant to use). The __ID and Build Artifact Moniker value are in most cases the same (except that the data type is different), but not always as this picture shows:

bam_vs_id

I verified this by publishing another test result. Since earlier I had 2 test results in the database, both referencing Build.__ID == 1. So I chose to associate my newly created test results with Build having __ID == 1 (Build Artifact Moniker == 7, as you can see above). The name of the Build was XjobBuild_20071203.3. And sure, the column "Build" in the table Test Result gives the value of 1 (i.e. it really is the Build.__ID that is used - not Build Artifact Moniker).

Then I added a foreign key referencing the Build table (supposed to represent the <DimensionUse> property):

USE [TfsWarehouse] GO ALTER TABLE [dbo].[Code Metrics] WITH NOCHECK ADD CONSTRAINT [FK_Code Metrics_Build_Build_ID] FOREIGN KEY([Build]) REFERENCES [dbo].[Build] ([__ID]) GO ALTER TABLE [dbo].[Code Metrics] CHECK CONSTRAINT [FK_Code Metrics_Build_Build_ID]

So the foreign key depicts a mapping between TfsWarehouse.Code Metrics.Build and Build.__ID.

Next step was to add our XML into the warehouseschema.xml. I added it as the first fact encountered in the <Facts>....</Facts> property. Went back to http://localhost:8080/Warehouse/v1.0/warehousecontroller.asmx, chose Run, waits for a while and then checks that I got my cube and perspective in Microsoft Excel.

The result: Nothing had changed. Tried to run SetupWarehouse again:

C:\Program Files\Microsoft Visual Studio 2008 Team Foundation Server\Tools>SetupWarehouse -rebuild -v -o -s ORCASBETA2_TFSV -d TfsWarehouse -c warehouseschema.xml -a ORCASBETA2_TFSV\TFSSERVICE -ra ORCASBETA2_TFSV\TFSREPORT -mturl http://orcasbeta2_tfsv:8080 -l log.txt
SetupWarehouse: Warehouse updated successfully.

Goes back to the URL mentioned above, chose Run again, checks in Excel - Nothing. The Code Metrics table is still in the TfsWarehouse database, the olap cube has probably been rebuilt successfully since I haven't got any error messages, and my Fact entry in warehouseschema.xml is intact. But still nothing whatsoever about code metrics in the cube!

I have although encountered a strange thing: If you feed SetupWarehouse with an incorrect xml file (e.g. wrong file name, referencing a file that does not exist), it still says that the warehouse updated successfully:

C:\Program Files\Microsoft Visual Studio 2008 Team Foundation Server\Tools>SetupWarehouse -rebuild -v -o -s ORCASBETA2_TFSV -d TfsWarehouse -c hma.xml -a ORCASBETA2_TFSV\TFSSERVICE -ra ORCASBETA2_TFSV\TFSREPORT -mturl http://orcasbeta2_tfsv:8080 -l log.txt
SetupWarehouse: Warehouse updated successfully.

So perhaps my value passed to the -c parameter has been wrong all the time? Probably not because now my perspectives and cubes are gone - again. I think I would have noticed that before...  Anyway, executing Run (from internet explorer) restores the perspectives and the cube.

Even if you take away some parameters like -rebuild and -o, it still "updates successfully" if given a wrong name of the xml file:

C:\Program Files\Microsoft Visual Studio 2008 Team Foundation Server\Tools>SetupWarehouse -s ORCASBETA2_TFSV -d TfsWarehouse -c hema.xml -a ORCASBETA2_TFSV\TFSSERVICE -ra ORCASBETA2_TFSV\TFSREPORT -mturl http://orcasbeta2_tfsv:8080 -l log.txt
SetupWarehouse: Warehouse updated successfully.

Nothing, nothing, NOTHING seems to make the Code Metrics Fact table appear in the cube. WHY THE HELL NOT? Please tell me I'm stupid and I'm missing something obvious. Please!

评论

请稍候...
很抱歉,您输入的评论太长。请缩短您的评论。
您没有输入任何内容,请重试。
很抱歉,我们当前无法添加您的评论。请稍后重试。
若要添加评论,需要您的家长授予您相应权限。请求权限
您的家长禁用了评论功能。
很抱歉,我们当前无法删除您的评论。请稍后重试。
您已超过了一天之内允许提供的评论数上限。请在 24 小时后重试。
因为我们的系统表明您可能在向其他用户提供垃圾评论,您的帐户已禁用了评论功能。如果您认为我们错误地禁用了您的帐户,请联系 Windows Live 支持部门
完成下面的安全检查,您提供评论的过程才能完成。
您在安全检查中键入的字符必须与图片或音频中的字符一致。

若要添加评论,请使用您的 Windows Live ID 登录(如果您使用过 Hotmail、Messenger 或 Xbox LIVE,您就拥有 Windows Live ID)。登录


还没有 Windows Live ID 吗?请注册

引用通告

此日志的引用通告 URL 是:
http://tomfury.spaces.live.com/blog/cns!F58BF7D0B46F52B9!298.trak
引用此项的网络日志