【问题标题】:Sonar not supporting api声纳不支持 api
【发布时间】:2013-06-28 20:32:22
【问题描述】:

我正在更新声纳 3.6 的声纳插件,但有一个问题: 这个插件包括工作流类,但没有类,如自 api 3.6 有没有其他的类或方法可以做到这一点?

这是我正在处理的代码:

package org.sonar.plugins.redmine.reviews;

import org.sonar.api.ServerExtension;
import org.sonar.api.workflow.Workflow;
import static org.sonar.api.workflow.condition.Conditions.*;
import org.sonar.api.workflow.screen.CommentScreen;
import org.sonar.plugins.redmine.RedmineConstants;

public class RedmineWorkflowBuilder implements ServerExtension {

  private final Workflow workflow;
  private final RedmineLinkFunction linkFunction;

  public RedmineWorkflowBuilder(Workflow workflow, RedmineLinkFunction linkFunction) {
    this.workflow = workflow;
    this.linkFunction = linkFunction;
  }

  public void start() {
    workflow.addCommand(RedmineConstants.LINK_TO_REDMINE_ID);
    workflow.setScreen(RedmineConstants.LINK_TO_REDMINE_ID, new CommentScreen());
    workflow.addFunction(RedmineConstants.LINK_TO_REDMINE_ID, linkFunction);
    // conditions for this function
    // - on the review ("IDLE" is the non-persisted status of an non-existing review = when a violation does have a review yet)
    workflow.addCondition(RedmineConstants.LINK_TO_REDMINE_ID, not(hasReviewProperty(RedmineConstants.ISSUE_ID)));
    workflow.addCondition(RedmineConstants.LINK_TO_REDMINE_ID, statuses("IDLE", "OPEN", "REOPENED"));
    // - on the project
    workflow.addCondition(RedmineConstants.LINK_TO_REDMINE_ID, hasProjectProperty(RedmineConstants.HOST));
    workflow.addCondition(RedmineConstants.LINK_TO_REDMINE_ID, hasProjectProperty(RedmineConstants.API_ACCESS_KEY));
    workflow.addCondition(RedmineConstants.LINK_TO_REDMINE_ID, hasProjectProperty(RedmineConstants.PROJECT_KEY));
  }
}

【问题讨论】:

    标签: plugins sonarqube


    【解决方案1】:

    您可以查看 SonarQube JIRA 插件 - 它有同样的问题,最近已更新以支持 SonarQube 3.6:

    https://github.com/SonarCommunity/sonar-jira

    【讨论】:

    • 我的问题还在继续:(我怎样才能用 api 获得任何违规信息(主题、描述..)?我还没有为此找到任何课程。
    猜你喜欢
    • 2013-05-20
    • 1970-01-01
    • 1970-01-01
    • 2016-05-15
    • 1970-01-01
    • 2021-05-31
    • 2018-12-20
    • 2013-06-03
    • 1970-01-01
    相关资源
    最近更新 更多