gpt4 book ai didi

sonarqube - 如何更改现有 Sonar 快照的日期?

转载 作者:行者123 更新时间:2023-12-02 00:07:19 26 4
gpt4 key购买 nike

我最近正在使用 sonar.projectDate 属性构建历史记录。但是,我在日期上犯了一个错误并将其设置为 future (2913-05-29)。现在我无法对该项目运行任何新的分析。由于这是最新的分析,我在历史页面上没有“删除快照”按钮。

所以,我想简单地改变分析的日期,因为它是有效的并且是最新的。我对以下似乎有“错误”日期的表格进行了更改:快照、事件、问题。

update snapshots set 
created_at = to_timestamp('05/29/2013', 'MM/dd/yyyy'),
period2_date = to_timestamp('05/24/2013', 'MM/dd/yyyy'),
period3_date = to_timestamp('04/29/2013', 'MM/dd/yyyy')
where id = ${snapshotId};

update snapshots set
created_at = to_timestamp('05/29/2013', 'MM/dd/yyyy')
where root_snapshot_id = ${snapshotId};

update events set
event_date = to_timestamp('05/29/2013', 'MM/dd/yyyy')
where snapshot_id = ${snapshotId};

严格来说,我认为我不需要这样做,因为它与快照无关,但我认为这有助于解决问题。
update issues set 
issue_creation_date = to_timestamp('05/29/2013', 'MM/dd/yyyy'),
issue_update_date = to_timestamp('05/29/2013', 'MM/dd/yyyy'),
created_at = to_timestamp('05/29/2013', 'MM/dd/yyyy'),
updated_at = to_timestamp('05/29/2013', 'MM/dd/yyyy')
where root_component_id = ${projectId}
and created_at > to_timestamp('01/01/2014', 'MM/dd/yyyy');

更新快照表后,GUI 加载了正确的信息,但我仍然无法开始新的分析。
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project rc-parent: 
Can not execute Sonar: 'sonar.projectDate' property cannot be older than the date of the last known quality snapshot on this project. Value: '2013-06-29'. Latest quality snapshot: '2913-05-29'. This property may only be used to rebuild the past in a chronological order. -> [Help 1]

我现在正在运行 Sonar 3.6,但在“坏”分析运行期间运行的是 3.4.1。

我正在寻找选项。更改日期的正确方法或手动分析删除程序。

最佳答案

对于 MySQL 数据库,执行:

  • 获取项目 ID
    select * from projects where name='foo';
  • 获取项目的当前快照:
    select * from events where resource_id = ${project_id};
  • 首先,检查 build_date 是否具有有效的日期时间
    select * from snapshots where id=${snapshot_id};
    如果是,(对事件也一样)运行:
    update snapshots set created_at=build_date where id=${snapshot_id};update events set event_date=created_date where snapshot_id=${snapshot_id};
    如果不是,请运行:
    update snapshots set created_at=CURDATE() where id=${snapshot_id};update events set event_date=CURDATE() where snapshot_id=${snapshot_id};
  • 关于sonarqube - 如何更改现有 Sonar 快照的日期?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17528603/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com